Chapter 10. Plugins and Themes

I have always liked playing with plugins, not only as a user, but also as a developer. My first written plugin was one for the Apache HTTP server. When I was working on it, I was amazed by the power the plugin API gives to developers. So, since then, I tried to include the plugin engine into every solution I develop.

When I started to learn the Redmine plugin API, I was amazed even more. Honestly, I can't say that I love Rails or am a fan of it, but the plugin API of Redmine is definitely the thing. Unlike other plugin APIs I've seen before, it's not just an API. The Redmine plugin API is based on Rails engine API (Rails just uses a different name for plugins), so it includes Redmine API and Rails API. Also, the API is based on Ruby, which is a very powerful metaprogramming language and provides unsurpassed means for patching code at runtime. This makes the Redmine plugin API absolutely unlimited, that is, you can do almost anything with it.

Certainly, there are a lot of different plugins for Redmine. While Redmine itself is quite functional without plugins, most likely you will find many plugins that you will want to make use of. But, here the first problem appears—it's not easy to find the working plugin for a certain version of Redmine. Also, the official plugin list misses some interesting ones. Therefore, in this chapter, we will learn how to find plugins and will review some of them.

In addition to plugins, we will pay a little attention to Redmine themes, as the theme is what makes an application look different (similar to plugins, we will also review themes that, I want to share with you).

So, who is this chapter for? This chapter is not only for administrators, who can install plugins, but also for project managers and other users, who can use plugins and can ask administrators to install them.

In this chapter, we will cover the following topics:

  • Looking up plugins
  • Installing a plugin
  • Plugins review
  • Themes

Looking up plugins

There is a plugin registry on the Redmine official website, which can be used to find the plugin you need (by the way, this registry is implemented using another plugin, which was written by Jean-Philippe Lang especially for the website). However, if you used it to find, for example, the Git Hosting plugin, you would fail (at least at the time of writing this topic). You would get similar result for some other popular plugins as well. The plugin registry relies on plugin authors. Some authors, for some reason, ignore the registry, whereas others abandon their plugins and let volunteers continue using them, and the volunteers feel rightful to register them on their own behalf. I'm sure, there are other reasons as well. This led to the incomplete plugin list (and to writing this topic).

Tip

Forum dedicated to plugins

In addition to the plugin repository, www.redmine.org provides a forum dedicated to plugins, where you can discuss plugins, ask for help, request custom plugin development, and so on. Go to http://www.redmine.org/projects/redmine/boards/3.

The official plugin registry was introduced relatively recently, so, I believe, it just needs time (and probably, some improvements) to become a reliable source of information about plugins. Meanwhile, we need to show resource to find some plugins, and what is also important is to find their versions, which will work with our Redmine version. That's what we will talk about under this topic.

Official registry

The official Redmine plugin registry should be your primary source of information for searching plugins. It's not ideal, and not all the plugins or their versions are registered there, but it was designed to maintain the plugin list; it supports Redmine versions and allows you to filter plugins by version. It also has a legible structure and so on.

This registry can be accessed through the following URL: http://www.redmine.org/plugins:

Official registry

This page contains five recently registered plugins. And on the sidebar, you see 10 recently released plugins, that is, new versions of those which were registered recently.

Tip

You can subscribe to the new plugin list using the New Plugin a RSS link.

To search the plugin list, just type keywords into the Search box in the top-right corner. But, note that you need to do this while being on the plugin list page, or alternatively, you can just select the Redmine plugins checkbox in the search form, as shown in the following screenshot:

Official registry

We can also browse the plugin list by clicking on the Browse all Plugins... link in the bottom-left corner. After doing this, we'll be redirected to the complete plugin list sorted alphabetically, as shown in the following screenshot:

Official registry

Note the drop-down list in the top-right corner; we can use this element to filter the plugin list by a certain Redmine version. But remember that some plugin versions may be not registered in the official repository yet (you can try finding recent versions on Github though, read the next topic on how to do this).

Tip

Subscribing to new versions of the plugin

On the plugin page, in the bottom-right corner, you can find the Atom link, which can be used to subscribe to new versions of a certain plugin.

Github

Redmine was written using Ruby on Rails, such as Github. Github is a project hosting and collaboration service, which is loved by open source developers mainly due to its social networking capabilities. Thus, Ruby on Rails code is now hosted on Github. For these reasons, this great service is loved by rubists. So, it would not be a surprise that most Redmine plugins can also be found on Github.

In other words, Github can be a secondary source of the information for searching Redmine plugins. So, let's see how we can search there.

To search Redmine plugins, you should use the following URL: https://github.com/search.

Refer to the following screenshot:

Github

In this form, select Repositories for the Search for field and Ruby for the Search Language field. After that, you can put your keywords into the search box along with the Redmine keyword (and maybe, plugin).

Search results will include all repositories, which match your keywords, including original ones and forks (copies). Therefore, it can be hard to find the fork of a Redmine plugin, which is compatible with the version of Redmine you are using. It can be hard but is still possible.

Tip

Limiting results by the last push date

You can search Github by the last push date using the pushed: keyword. For example, use the query Redmine plugin pushed:[2012-09-16 TO *] to find all repositories, which were modified after the release of Redmine 2.1.0 (which was on 16th September, 2012).

Thus, if we searched for the Ultraviolet plugin, which is believed to work with Redmine up to version 1.3.x in the official repository (at the time of writing), we most likely would encounter some of its forks, as shown in the following screenshot:

Github

This is the fork of Andy Bailey (neosonic). Below the repository name, you see the source repository (after forked from), which is also the original repository of Chris Gahan (epitron), the original author of the plugin.

The source repository can also be forked. The original one is the one which is not forked from any other repository (in most cases, if the original code is hosted on Github).

To find the most recently updated plugin, which theoretically should support the most recent version of Redmine, we need to open the network graph. This graph can be made available by clicking the number of forks (14 on the previous screenshot).

Refer to the following screenshot:

Github

On this graph, spots are commits (code changes). We need to find the latest commits, therefore, we drag the graph by clicking on it, moving the mouse cursor to the left-hand side. The latest commits were made on approximately 13th July by Jean-Sébastien Pédron.

Hovering our mouse cursor over the spot shows brief information about the commit, which includes the author, the hash, and the message. In this particular case, the commit was made to support Rails 3, which is required by Redmine 2.x. So, it looks like the repository of yakaz contains the version of the plugin that, we need. To move to this repository just click on the spot.

Tip

Plugin forks on Github are made by volunteers, who make changes required by them or their organization. So, most recent commits do not automatically mean support for recent versions of Redmine. Always read commit messages to get an idea of what are changes are for. Also note that the authors of forks are not necessarily good at programming (as well as original authors). Therefore, their forks can be buggy. It's also a good idea to always read the Github's README file, which is shown on the repository start page, as this file can contain some information about the code state and known issues.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset