Last time, I haven't thought of my work in Eclipse without
Mylyn . With the help of Mylyn, I brought together a task from Jira, used for work, Mantis, used in my own project, Redmine, used for another project ... Fortunately, for all these systems there are ready-made connectors. But today I needed to connect another
PEAR bug tracker, for which there is no connector. Fortunately, good people have provided in Mylyn such a thing as the Generic Web Templates Connector, which, in theory, allows you to connect to any bug tracker. Under the cut, I'll share the experience of setting up this connector for PEAR.
Poryskav on the Internet, I found
this article here . Unfortunately, it is slightly outdated, but it showed me the general way.
Generic Web Templates Connector is not included with Mylyn by default. You can install this connector from the update site:
http://download.eclipse.org/tools/mylyn/update/incubator . There, this connector is called "
Mylyn Connector: Web Templates (Advanced) " (
documentation ).
')
Creating a connection to the repository
After installing the connector, go to the
Task Repositories View and add a new task repository. In the list of storage types, select
Web Templates (Advanced) , click “Next” and proceed to the configuration.

At the beginning we indicate the general parameters of the storage:
- Server:
http://pear.php.net
- Label: name of the repository (to your taste)
- User ID: your username on pear.php.net. You can leave the checkbox “Anonymous” installed and do not specify anything here. I specify my username only in order to be able to use it in queries for filtering tasks (see below).
- Password: password. Generally speaking, it is not needed, but if there is nothing to write here, Eclipse will swear.
Now the fun begins. Expand the “Additional Settings” section. Here we can define variables that will later be available to us in the form of substitutions in templates. I defined the following variables:
- serverURL
http://pear.php.net
Chuck Burgess recommends using http s in his article, but I didn’t. - package_name is the name of the package that interests you. Required if you want to be able to create new tasks from Eclipse.
- limit - how many queries to display in the search results. As you like. You can generally leave it empty.
- id - to be honest, I didn't quite understand why Chuck introduced this variable, but let it be.
All these variables will be available in templates in the form of "$ {variable_name}". For example, the server address will be substituted for
${serverURL}
.
Next, expand the “Advanced Configuration” section and see a lot of scary settings.
- Task URL - address of the task view page:
$ {serverUrl} /bugs/bug.php?id = $ {id}
- New Tasl URL - address for creating a new task (you can leave blank if you are not going to create tasks):
$ {serverUrl} /bugs/report.php?package = $ {package_name}
- Query Request URL - address for querying the task list. It will default to your requests. It will be possible to change in each request individually:
$ {serverUrl} /bugs/search.php?cmd=display&status=OpenFeedback&limit = $ {limit} & package_name% 5b% 5d = $ {package_name}
You can customize this address to your needs, for example, remove the package name or change statuses. - Query Pattern - a template, using which Mylyn will rip out information about tasks from the search results page. The template uses regular expressions and Mylyn special substitutions. I conjured just such a horror:
<tr class="bug-result Asn">[\s]*<td class="bug-id"><a href="/bugs/({Id}[0-9]+)">[0-9]+</a><br /><a href="[^"]*" class="edit">\(edit\)</a></td>[\s]*<td class="bug-date">....-..-..</td>[\s]*<td>({Type}[a-zA-Z]+)</td>[\s]*<td>[^<]*</td>[\s]*<td>[^<]*</td>[\s]*<td>[^<]*</td>[\s]*<td>[^<]*</td>[\s]*<td>({Description}.[^<]+)</td>[\s]*<td>({Owner}[a-zA-Z]+)</td>[\s]*</tr>
It will default to your requests. It will be possible to change in each request individually.
With authorization, I decided not to fool around yet, so I left all the Login * fields blank. Instead, after setting up the repository, I simply logged into pear.php.net as a built-in browser in Eclipse and logged in there, checking the box “remember me”.
Click "Finish". The storage is ready, now you can create a request.
Creating a request to the repository
Queries, as you can guess, are used to retrieve tasks from the repository that satisfy some conditions. Usually assigned to you.
Right click on the repository and select "
New Query ... ". The opened dialog is very similar to the previous one.

In the "
Query Title " field specify the name of the query, for example, "All requests".
The remaining fields by default will be filled in the same way as the fields with the same name in the add storage dialog. Here, if desired, they can be changed to the needs of a specific request. For example, I want to create a query, “Tasks assigned to me,” showing only those tasks where I stand as an executor. To do this, I can edit the "
Query URL " field by adding
&assign=${userId}
(the full URL will be:
${serverUrl}/bugs/search.php?cmd=display&status=OpenFeedback&limit=${limit}&package_name%5b%5d=${package_name}&assign=${userId}
).
On a note:
In this dialog there are two extremely useful buttons " Open " and " Preview ". The first opens performs all substitutions in the Query URL and opens the resulting address in the browser, the second parsit the page at the address of the Query URL using a regular expression in the Query Pattern and returns the tasks found in the list below.
This helps a lot in debugging templates.
Save the request. And if everything is correct, the tasks from PEAR appear in the Mylyn task list:

Of course, for such tasks all Mylyn buns are unavailable, but the main thing is present: context, planning, personal notes. In my opinion, it is enough for work.