📜 ⬆️ ⬇️

Mylyn Generic Web Templates Connector and PEAR bug tracker

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:



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:



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.



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.

Source: https://habr.com/ru/post/109472/


All Articles