Mylyn Generic Web Templates Connector and the bug tracker at PEAR
Poryskav on the Internet, I found this article. Unfortunately, it is a little outdated, but the General path she pointed out to me.
Generic Web Templates Connector not included in delivery of Mylyn by default. To install this connector from the update site: http://download.eclipse.org/tools/mylyn/update/incubator. There is this connector called "Mylyn Connector: Web Templates (Advanced)" (dokumentacija).
create a storage connection
After you install the connector, go to Task Repositories View and add a new repository task. In the type list, select the storage Web Templates (Advanced), click "Next" and move to setting.

At the beginning of the specified shared storage options:
the
Server:
http://pear.php.net
Label: the name of the store (to your taste)
User ID: your username pear.php.net. You can leave the checkbox "Anonymous" installed and don't specify. I provide your username, just so it can be used in queries to filter tasks (see below).
Password: password. Generally speaking, it is not needed, but if there is nothing to write Eclipse will swear.
Now the fun begins. Expand the section "Additional Settings". Here we can define variables, which will later be available to us in the form of substitutions in templates. I have defined the following variables:
the
serverURL
http://pear.php.netChuck Burgess in his article recommends the use of the https, but I did not.
package_name — the name of the package that interests you. Required if you want to be able to create new tasks from within Eclipse.
limit — how many requests to display in the search results. As you like. You can generally leave blank.
id — honestly, I don't really understand why Chuck introduced this variable, but let it be.
All of these variables will be available in the templates as "${VariableName}". For example, the server address will be substituted for ${serverURL}
.
Next, expand the section "Advanced Configuration" and see a lot of scary>.
the
Task URL — address of the page viewing tasks:
${serverUrl}/bugs/bug.php?id=${id}
New Tasl URL — address to create a new task (may be left blank if you are not going to create tasks):
${serverUrl}/bugs/report.php?package=${package_name}
Query Request URL — address to query for task list. Will be entered by default in your requests. Can be changed at each request individually:
${serverUrl}/bugs/search.php?cmd=display&status=OpenFeedback&limit=${limit}&package_name%5b%5d=${package_name}You can adjust this address to suit your needs, for example, to remove the name of the package or change the statuses.
Query Pattern — a template that Mylyn will pull information about the task from the search results page. The pattern uses regular expressions and special lookup Mylyn. I conjured up this Scarecrow
<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>
Authorization I decided not to fool, so all the fields "Login *" left blank. Instead, after the storage settings, I just dropped the built in Eclipse browser pear.php.net and logged in there, clicking the checkbox "remember me".
Click "Finish". Store ready, you can now create a query.
creating a query
The queries, as you might guess, are used to obtain from the repository of tasks that satisfy some conditions. Usually assigned to you.
Right-click the repository and select "New Query...". The dialog that opens is very similar to the previous one.

In the field "Query Title" specify the query name, such as "All queries".
The other default fields will be filled in the same way as they are the same name field in the add dialog of the vault. Here, if you want, you can change them to fit the needs of the particular request. For example, I want to create a query "Tasks assigned to me", showing only those tasks where I stand by. To do this I can edit the field "Query URLS", adding a
&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}
).note:
In this dialogue there are two extremely useful buttons "Open" and "Preview". The first opens performs all the lookup in the Query URLS, and opens the resulting url in browser, the second parses the page at Query URL with the regular expression in Query Pattern and issues found tasks in the list below.
This greatly helps in debugging templates.
Save the query. And if everything is correct, then the task of the PEAR appear in the task list, Mylyn:

Of course, for such tasks is not available all the buns Mylyn, but the main present: context, planning, personal notes. In my opinion, enough to work.
Комментарии
Отправить комментарий