Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Mylyn » Problem to extract filed by bug
Problem to extract filed by bug [message #54430] Wed, 23 July 2008 16:52
Eclipse UserFriend
Originally posted by: daxrev.email.it

I have an application where
the problem is the extraction dta by bug

The source code is the follwing:

package org.qualipso.feeder.issue;

import java.io.IOException;
import java.net.MalformedURLException;
import java.util.List;

import org.qualipso.feeder.issue.QualipsoProperties;

import org.eclipse.jface.action.Action;

import org.eclipse.mylyn.internal.bugzilla.core.BugzillaTask;



import org.eclipse.mylyn.tasks.core.AbstractTask;
import org.eclipse.mylyn.tasks.core.AbstractTaskContainer;
import org.eclipse.mylyn.internal.bugzilla.core.RepositoryConfigura tion;

import org.qualipso.advdoc.ws.client.feed.beans.AddLiteralPropertie s_req;
import org.qualipso.advdoc.ws.client.feed.beans.AddLiteralPropertie s_resp;
import org.qualipso.advdoc.ws.client.feed.beans.AddObjectProperties _req;
import org.qualipso.advdoc.ws.client.feed.beans.AddObjectProperties _resp;
import org.qualipso.advdoc.ws.client.feed.beans.CreateResource_req;
import org.qualipso.advdoc.ws.client.feed.beans.CreateResource_resp ;
import org.qualipso.advdoc.ws.client.feed.beans.LiteralProperty;
import org.qualipso.advdoc.ws.client.feed.beans.ObjectProperty;
import org.qualipso.advdoc.ws.client.feed.service.QualiPSoFeedAPISo apClient;
import org.qualipso.feeder.preferences.PreferenceConstants;
import org.xml.sax.SAXException;

import es.tid.frawa.service.servlet.TdiServiceException;

public class TaskFeedAction extends Action {

static String url_doap="http://usefulinc.com/ns/doap";
static String url_foaf="http://xmlns.com/foaf/0.1/";
static String url_dct="http://purl.org/dc/terms/";
static String url_rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns";
static String url_xsd="http://www.w3.org/2001/XMLSchema";
static String url_baetle="http://xmlns.com/baetle/";
static String url_rdfs="http://www.w3.org/2000/01/rdf-schema";
static String url_owl="http://www.w3.org/2002/07/owl";
static String url_sioc="http://rdfs.org/sioc/ns";
static String url_wf="http://www.w3.org/2005/01/wf/flow";
static String url_skos="http://www.w3.org/2004/02/skos/core";
static String url_dc="http://purl.org/dc/elements/1.1/";

List<AbstractTaskContainer> selectedElements;
public TaskFeedAction(List<AbstractTaskContainer> selectedElements) {

super("Send to Repository");
this.selectedElements=selectedElements;

}

@Override
public void run() {

QualipsoProperties qp=new QualipsoProperties();
qp.createAndShowGUI();

String
conn=Activator.getDefault().getPreferenceStore().getString(P referenceConstants.FEED_URL);
//try {
/*QualiPSoFeedAPISoapClient feedAPI =
new QualiPSoFeedAPISoapClient(conn,null,null,null);*/

for (AbstractTaskContainer atc: selectedElements) {

/*if(atc instanceof RepositoryConfiguration)
{

}*/
if (atc instanceof BugzillaTask) {
//BugzillaTask at =(BugzillaTask)selectedElements;
BugzillaTask at =(BugzillaTask)atc;
String bugURI=at.getUrl();

CreateResource_req cr_req = new CreateResource_req();
cr_req.setResourceUri(bugURI);
//feedAPI.CreateResource(cr_req);

AddObjectProperties_req op_req = new
AddObjectProperties_req();
op_req.setResourceUri(bugURI);

if (at.getTaskKind().equalsIgnoreCase("bug")) {
op_req.addObjectProperties(new ObjectProperty(url_rdf+
"#type",url_baetle+ "#Bug"));
System.out.println("#Bug "+ bugURI);
} else {
op_req.addObjectProperties(new ObjectProperty(url_rdf+
"#type",url_baetle+ "#Issue"));
System.out.println("#Issue "+ bugURI);
}
//feedAPI.AddObjectProperties(op_req);

AddLiteralProperties_req lp_req = new AddLiteralProperties_req();
lp_req.setResourceUri(bugURI);
lp_req.addLiteralProperties(new LiteralProperty(url_baetle+
"#description",at.getSummary()));
if (at.getCreationDate()!=null) {
lp_req.addLiteralProperties(new LiteralProperty(url_baetle+
"#created",at.getCreationDate().toString()));
}
lp_req.addLiteralProperties(new LiteralProperty(url_baetle+
"#id",at.getTaskId()));
if (at.getDueDate()!=null) {
lp_req.addLiteralProperties(new LiteralProperty(url_baetle+
"#due_date",at.getDueDate().toString()));
}
lp_req.addLiteralProperties(new LiteralProperty(url_baetle+
"#environment",at.getProduct()));

String authorURI=at.getOwner();

lp_req.addLiteralProperties(new
LiteralProperty(url_baetle+"#assigned_to",authorURI));
//feedAPI.AddLiteralProperties(lp_req);

CreateResource_req crAuthor_req = new CreateResource_req();
crAuthor_req.setResourceUri(authorURI);
//feedAPI.CreateResource(crAuthor_req);

AddObjectProperties_req opAuthor_req = new AddObjectProperties_req();
opAuthor_req.setResourceUri(authorURI);
opAuthor_req.addObjectProperties(new ObjectProperty(url_rdf+
"#type",url_sioc+ "#User"));
//feedAPI.AddObjectProperties(opAuthor_req);

String priorityURI=bugURI+"#priority@"+at.getPriority();
CreateResource_req crPriority_req = new CreateResource_req();
crPriority_req.setResourceUri(priorityURI);
//feedAPI.CreateResource(crPriority_req);

AddObjectProperties_req opPriority_req = new AddObjectProperties_req();
opPriority_req.setResourceUri(priorityURI);
String tipoPriority="#Trivial";
if (at.getPriority().equals("P5")) {
tipoPriority="#Blocker";
}
if (at.getPriority().equals("P3")) {
tipoPriority="#Major";
}
if (at.getPriority().equals("P2")) {
tipoPriority="#Minor";
}
if (at.getPriority().equals("P4")) {
tipoPriority="#Critical";
}
if (at.getPriority().equals("P1")) {
tipoPriority="#Trivial";
}
opPriority_req.addObjectProperties(new ObjectProperty(url_rdf+
"#type",url_baetle+ tipoPriority));
//feedAPI.AddObjectProperties(opPriority_req);

AddObjectProperties_req opBugPriority_req = new
AddObjectProperties_req();
opBugPriority_req.setResourceUri(bugURI);
opBugPriority_req.addObjectProperties(new ObjectProperty(url_baetle+
"#priority",priorityURI));
//feedAPI.AddObjectProperties(opPriority_req);

String statusURI=at.getTaskKind();
System.out.println(statusURI);
//DA QUI HO AGGIUNTO IO
/*int i=0,j=0;
System.out.println(MenuLookDemo.campibug[i][j]);*/

//A QUI
System.out.println(" #assigned_to "+ authorURI);
System.out.println(" #description "+ at.getSummary());
System.out.println(" #created "+ at.getCreationDate());
System.out.println(" #id "+ at.getTaskId());
System.out.println(" #due_date "+ at.getDueDate());
System.out.println(" #environment "+ at.getProduct());
System.out.println(" #priority "+ priorityURI);
System.out.println(" TIPO " + tipoPriority);

// lp_req.addLiteralProperties(new LiteralProperty(url_baetle+
"#description",RepositoryConfiguration.getOSs()));
}
}
/*} catch (MalformedURLException e) {
// TODO Auto-generated catch block
System.out.println(e.getMessage());
} catch (IOException e) {
// TODO Auto-generated catch block
System.out.println(e.getMessage());
} catch (SAXException e) {
// TODO Auto-generated catch block
System.out.println(e.getMessage());
} catch (TdiServiceException e) {
// TODO Auto-generated catch block
System.out.println(e.getMessage());
} */


//super.run();
}
}

The problem is the extraction of other data of bug
OSS ,platform,depends on ,etc

HOW can resolve ?
Previous Topic:Conflict between Mylyn JIRA connector and JIRA Toolkit Plugin?
Next Topic:Context Display
Goto Forum:
  


Current Time: Fri Apr 26 01:33:21 GMT 2024

Powered by FUDForum. Page generated in 0.02491 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top