[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
RE: [mylyn-dev] Programmatically querying Jira using mylyn
|
Hi Stefanos,
(moving this discussion to mylyn-integrators)
While we have generic facilities for querying, we do not have generic
facilities for you to specify a query because the query specification tends
to be very connector specific (e.g. JIRA's filter definition which know
about JIRA-specific attributes). To support what you are after we would
either need a generic way of specifying queries (hard, and questionable
utility) or for you to have a String-based or otherwise externalizable
specification of the query parameters. We are already investigating support
for the latter for generic duplicate detection:
197181: make duplicate detection support generic
https://bugs.eclipse.org/bugs/show_bug.cgi?id=197181
If you could describe your use case we could figure out how to better
support this kind of generic creation. As an additional example check out
how BugzillaQueryTest runs headless, since it has considerably less
coupling, there are also some slightly out-of-date docs here and it would be
great if you could add some notes on your experiences with JIRA to that:
http://wiki.eclipse.org/index.php/Mylyn_Integrator_Reference#Bugzilla_API_.2
8org.eclipse.mylar.bugzilla.core.29_Headless_Use
Mik
> -----Original Message-----
> From: mylyn-dev-bounces@xxxxxxxxxxx [mailto:mylyn-dev-
> bounces@xxxxxxxxxxx] On Behalf Of Stefanos.Zachariadis@xxxxxxx
> Sent: Thursday, July 19, 2007 9:41 AM
> To: mylyn-dev@xxxxxxxxxxx
> Subject: [mylyn-dev] Programmatically querying Jira using mylyn
>
> Hi all,
>
> In the application I'm currently developing, I'm using the mylyn
> tasklist plugin with the Jira connector as an interface to Jira.
>
> As part of the application, I need to set up some queries
> programmatically (i.e., I don't want to go through the mylyn gui). Is
> there a way to do that without calling classes and methods directly in
> the jira connector packages? It seems to me that I shouldn't need to
> know I'm talking to jira directly (not least because all these classes
> are in an internal package), but I can't seem to figure out how. This
> is
> how I'm creating queries now:
>
> (notice that most of these classes are in
> org.eclipse.mylyn.internal.jira - is there another way?)
>
> Thanks,
>
> Stefanos
>
>
>
> Repository r = getRepository(); //a custom abstraction that includes a
> repo kind, location and credentials
>
> TaskListManager manager = TasksUiPlugin.getTaskListManager();
> final TaskRepository repo = new TaskRepository(r.getKind(),
> r.getLocation());
> repo.setAuthenticationCredentials(r.getUserName(), r.getPassword());
> repo.setRepositoryLabel(r.getName());
> Display.getDefault().syncExec(new Runnable() {
> public void run() {
> tasksRepoManager.addRepository(repo,
> TasksUiPlugin.getDefault()
> .getRepositoriesFilePath());
> }
> });
>
> AbstractRepositoryQuery inProgressTasks;
>
> FilterDefinition filter = new FilterDefinition("in progress @ "
> + r.getName());
> Status inProgressStatus = new Status();
> inProgressStatus.setName("In Progress");
> inProgressStatus.setId(Status.STARTED_ID);
> inProgressStatus.setDescription("Items i'm working on");
>
> filter.setProjectFilter(null);
>
> ContentFilter contentFilter = new ContentFilter("", true, true, false,
> false);
>
> filter.setContentFilter(contentFilter);
>
> filter.setStatusFilter(new StatusFilter(new Status[] {
> inProgressStatus,}));
>
> CurrentUserFilter userFilter = new CurrentUserFilter();
>
> filter.setAssignedToFilter(userFilter);
>
> AbstractRepositoryQuery query = new JiraCustomQuery(r.getLocation(),
> filter,
> "UTF-8");
>
> manager.getTaskList().addQuery(query);
> Visit our website at http://www.ubs.com
>
> This message contains confidential information and is intended only
> for the individual named. If you are not the named addressee you
> should not disseminate, distribute or copy this e-mail. Please
> notify the sender immediately by e-mail if you have received this
> e-mail by mistake and delete this e-mail from your system.
>
> E-mails are not encrypted and cannot be guaranteed to be secure or
> error-free as information could be intercepted, corrupted, lost,
> destroyed, arrive late or incomplete, or contain viruses. The sender
> therefore does not accept liability for any errors or omissions in the
> contents of this message which arise as a result of e-mail
> transmission.
> If verification is required please request a hard-copy version. This
> message is provided for informational purposes and should not be
> construed as a solicitation or offer to buy or sell any securities
> or related financial instruments.
>
> UBS Limited is a company registered in England & Wales under company
> number 2035362, whose registered office is at 1 Finsbury Avenue,
> London, EC2M 2PP, United Kingdom.
>
> UBS AG (London Branch) is registered as a branch of a foreign company
> under number BR004507, whose registered office is at
> 1 Finsbury Avenue, London, EC2M 2PP, United Kingdom.
>
> UBS Clearing and Execution Services Limited is a company registered
> in England & Wales under company number 03123037, whose registered
> office is at 1 Finsbury Avenue, London, EC2M 2PP, United Kingdom.
> _______________________________________________
> mylyn-dev mailing list
> mylyn-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/mylyn-dev