本文整理汇总了Java中org.eclipse.mylyn.tasks.core.RepositoryResponse类的典型用法代码示例。如果您正苦于以下问题:Java RepositoryResponse类的具体用法?Java RepositoryResponse怎么用?Java RepositoryResponse使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RepositoryResponse类属于org.eclipse.mylyn.tasks.core包,在下文中一共展示了RepositoryResponse类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateTaskData
import org.eclipse.mylyn.tasks.core.RepositoryResponse; //导入依赖的package包/类
private void updateTaskData(TaskData data, BugzillaRepositoryConnector brc, TaskRepository repository) throws CoreException {
data = brc.getTaskData(repository, data.getTaskId(), nullProgressMonitor);
TaskAttribute attrModification1 = data.getRoot().getMappedAttribute(TaskAttribute.DATE_MODIFICATION);
TaskAttribute rta = data.getRoot();
TaskAttribute ta = rta.getMappedAttribute(TaskAttribute.USER_ASSIGNED);
ta = rta.getMappedAttribute(TaskAttribute.SUMMARY);
String val = ta.getValue();
ta.setValue(val + " updated");
Set<TaskAttribute> attrs = new HashSet<TaskAttribute>();
attrs.add(ta);
RepositoryResponse rr = brc.getTaskDataHandler().postTaskData(repository, data, attrs, new NullProgressMonitor());
assertEquals(rr.getReposonseKind(), RepositoryResponse.ResponseKind.TASK_UPDATED);
data = brc.getTaskData(repository, data.getTaskId(), nullProgressMonitor);
rta = data.getRoot();
ta = rta.getMappedAttribute(TaskAttribute.SUMMARY);
assertEquals(val + " updated", ta.getValue());
TaskAttribute attrModification2 = data.getRoot().getMappedAttribute(TaskAttribute.DATE_MODIFICATION);
assertNotSame(attrModification1, attrModification2);
}
示例2: closeIssue
import org.eclipse.mylyn.tasks.core.RepositoryResponse; //导入依赖的package包/类
private void closeIssue(TaskData data, BugzillaRepositoryConnector brc, TaskRepository repository) throws Exception {
//RepositoryConfiguration rc = brc.getClientManager().getClient(repository, nullProgressMonitor).getRepositoryConfiguration();
// refresh
data = brc.getTaskData(repository, data.getTaskId(), nullProgressMonitor);
Set<TaskAttribute> attrs = new HashSet<TaskAttribute>();
TaskAttribute rta = data.getRoot();
TaskAttribute ta = rta.getMappedAttribute(TaskAttribute.OPERATION);
ta.setValue("resolve");
attrs.add(ta);
ta = rta.getMappedAttribute(TaskAttribute.STATUS);
ta.setValue("FIXED");
attrs.add(ta);
RepositoryResponse rr = brc.getTaskDataHandler().postTaskData(repository, data, attrs, nullProgressMonitor);
assertEquals(rr.getReposonseKind(), RepositoryResponse.ResponseKind.TASK_UPDATED);
data = brc.getTaskData(repository, rr.getTaskId(), nullProgressMonitor);
rta = data.getRoot();
ta = rta.getMappedAttribute(TaskAttribute.STATUS);
assertEquals("RESOLVED", ta.getValue());
}
示例3: postTaskData
import org.eclipse.mylyn.tasks.core.RepositoryResponse; //导入依赖的package包/类
@Override
public RepositoryResponse postTaskData(TaskRepository repository, TaskData taskData,
Set<TaskAttribute> oldAttributes, IProgressMonitor monitor) throws CoreException {
AppraisePluginReviewClient client;
try {
client = new AppraisePluginReviewClient(repository);
} catch (GitClientException e) {
throw new CoreException(new Status(
IStatus.ERROR, AppraiseConnectorPlugin.PLUGIN_ID, "Failed to initialize git client", e));
}
String taskId;
if (taskData.isNew()) {
taskId = createNewReview(taskData, client);
} else {
taskId = updateExistingReview(taskData, client);
}
return new RepositoryResponse(RepositoryResponse.ResponseKind.TASK_UPDATED, taskId);
}
示例4: createIssue
import org.eclipse.mylyn.tasks.core.RepositoryResponse; //导入依赖的package包/类
public static String createIssue(BugzillaRepository repo, String summary) throws MalformedURLException, CoreException {
BugzillaRepositoryConnector brc = Bugzilla.getInstance().getRepositoryConnector();
TaskRepository tr = repo.getTaskRepository();
TaskData data = TestUtil.createTaskData(brc, tr, summary, ISSUE_DESCRIPTION, ISSUE_SEVERITY);
RepositoryResponse rr = TestUtil.postTaskData(brc, tr, data);
return rr.getTaskId();
}
示例5: addComment
import org.eclipse.mylyn.tasks.core.RepositoryResponse; //导入依赖的package包/类
public static RepositoryResponse addComment(TaskRepository taskRepository, TaskData data, String comment) throws CoreException {
TaskAttribute ta = data.getRoot().createMappedAttribute(TaskAttribute.COMMENT_NEW);
ta.setValue(comment);
Set<TaskAttribute> attrs = new HashSet<TaskAttribute>();
attrs.add(ta);
return Bugzilla.getInstance().getRepositoryConnector().getTaskDataHandler().postTaskData(taskRepository, data, attrs, new NullProgressMonitor());
}
示例6: testBugzilla
import org.eclipse.mylyn.tasks.core.RepositoryResponse; //导入依赖的package包/类
public void testBugzilla() throws Throwable {
// TaskDataState state;
// TaskData d;
try {
// create issue
TaskData data = createIssue(brc, repository, "bug pruser", "pruser", "bug");
TaskDataStore tds = new TaskDataStore(trm);
// update issue
updateTaskData(data, brc, repository);
// hours worked
timeTracking(data, brc, repository);
// add atachment
data = addAttachement(data, brc, repository, "Adding attachement", "some file", "crap");
// read attachment
readAttachement(data, brc, repository, "crap");
// add comment
String comment = "this is not a comment " + System.currentTimeMillis();
RepositoryResponse rr = TestUtil.addComment(repository, data, comment);
assertEquals(RepositoryResponse.ResponseKind.TASK_UPDATED, rr.getReposonseKind());
// read comments
readComment(data, brc, repository, comment);
changeProduct(data, brc, repository);
// resolve
closeIssue(data, brc, repository);
} catch (Exception e) {
TestUtil.handleException(e);
}
}
示例7: createIssue
import org.eclipse.mylyn.tasks.core.RepositoryResponse; //导入依赖的package包/类
public static TaskData createIssue(BugzillaRepositoryConnector brc, TaskRepository repository, String summary, String desc, String typeName) throws CoreException, MalformedURLException {
TaskData data = TestUtil.createTaskData(brc, repository, summary, desc, typeName);
RepositoryResponse rr = TestUtil.postTaskData(brc, repository, data);
String taskId = rr.getTaskId();
data = brc.getTaskData(repository, taskId, nullProgressMonitor);
assertEquals(rr.getReposonseKind(), RepositoryResponse.ResponseKind.TASK_CREATED);
assertNotNull(data);
return data;
}
示例8: postTaskData
import org.eclipse.mylyn.tasks.core.RepositoryResponse; //导入依赖的package包/类
@Override
public RepositoryResponse postTaskData(@NonNull TaskRepository repository, @NonNull TaskData taskData,
@Nullable Set<TaskAttribute> oldAttributes, @Nullable IProgressMonitor monitor) throws CoreException {
try {
CharmTask charmTask = createTaskFromTaskData(taskData);
connector.getClient(repository).putCharmTasks(charmTask);
} catch (CharmHttpException e) {
throw new CoreException(new Status(IStatus.ERROR, CharmCorePlugin.PLUGIN_ID, e.getErrorReason()));
}
return new RepositoryResponse(ResponseKind.TASK_UPDATED, taskData.getTaskId());
}
示例9: postTaskData
import org.eclipse.mylyn.tasks.core.RepositoryResponse; //导入依赖的package包/类
@Override
public RepositoryResponse postTaskData(TaskRepository repository, TaskData taskData,
Set<TaskAttribute> oldAttributes, IProgressMonitor monitor) throws CoreException
{
// TODO Auto-generated method stub
return null;
}
示例10: getRepositoryResponse
import org.eclipse.mylyn.tasks.core.RepositoryResponse; //导入依赖的package包/类
public RepositoryResponse getRepositoryResponse () {
return rr;
}
示例11: getRepositoryResponse
import org.eclipse.mylyn.tasks.core.RepositoryResponse; //导入依赖的package包/类
public RepositoryResponse getRepositoryResponse() {
return rr;
}
示例12: postTaskData
import org.eclipse.mylyn.tasks.core.RepositoryResponse; //导入依赖的package包/类
@Override
public RepositoryResponse postTaskData (TaskRepository repository, TaskData taskData, Set<TaskAttribute> oldAttributes, IProgressMonitor monitor) throws CoreException {
return null;
}
示例13: postTaskData
import org.eclipse.mylyn.tasks.core.RepositoryResponse; //导入依赖的package包/类
public static RepositoryResponse postTaskData(BugzillaRepositoryConnector brc, TaskRepository repository, TaskData data) throws CoreException {
Set<TaskAttribute> attrs = new HashSet<TaskAttribute>(); // XXX what is this for
return brc.getTaskDataHandler().postTaskData(repository, data, attrs, NULL_PROGRESS_MONITOR);
}
示例14: changeProduct
import org.eclipse.mylyn.tasks.core.RepositoryResponse; //导入依赖的package包/类
private void changeProduct(TaskData data, BugzillaRepositoryConnector brc, TaskRepository repository) throws CoreException, IOException {
data = brc.getTaskData(repository, data.getTaskId(), nullProgressMonitor);
TaskAttribute rta = data.getRoot();
TaskAttribute ta = rta.getMappedAttribute(TaskAttribute.PRODUCT);
BugzillaClient client = brc.getClientManager().getClient(repository, NULL_PROGRESS_MONITOR);
List<String> products = client.getRepositoryConfiguration().getProducts();
String newProject = TEST_PROJECT2;
assertNotNull(newProject);
ta.setValue(newProject);
String version = client.getRepositoryConfiguration(NULL_PROGRESS_MONITOR).getVersions(newProject).get(0);
ta = rta.getMappedAttribute(BugzillaAttribute.VERSION.getKey());
ta.setValue(version);
String component = client.getRepositoryConfiguration(NULL_PROGRESS_MONITOR).getComponents(newProject).get(0);
ta = rta.getMappedAttribute(BugzillaAttribute.COMPONENT.getKey());
ta.setValue(component);
String milestone = client.getRepositoryConfiguration(NULL_PROGRESS_MONITOR).getTargetMilestones(newProject).get(0);
ta = rta.getMappedAttribute(BugzillaAttribute.TARGET_MILESTONE.getKey());
ta.setValue(milestone);
ta = rta.getMappedAttribute(BugzillaAttribute.SET_DEFAULT_ASSIGNEE.getKey());
if (ta != null) {
ta.setValue("1");
}
ta = rta.getMappedAttribute(BugzillaAttribute.CONFIRM_PRODUCT_CHANGE.getKey());
if (ta == null) {
ta = BugzillaTaskDataHandler.createAttribute(rta, BugzillaAttribute.CONFIRM_PRODUCT_CHANGE);
}
if (ta != null) {
ta.setValue("1");
}
RepositoryResponse rr = brc.getTaskDataHandler().postTaskData(repository, data, null, new NullProgressMonitor());
assertEquals(rr.getReposonseKind(), RepositoryResponse.ResponseKind.TASK_UPDATED);
}
示例15: postTaskData
import org.eclipse.mylyn.tasks.core.RepositoryResponse; //导入依赖的package包/类
@Override
public RepositoryResponse postTaskData(TaskRepository repository, TaskData data,
Set<TaskAttribute> attributes, IProgressMonitor monitor)
throws CoreException {
GitlabAttributeMapper attributeMapper = (GitlabAttributeMapper) data.getAttributeMapper();
TaskAttribute root = data.getRoot();
String labels = root.getAttribute(GitlabAttribute.LABELS.getTaskKey()).getValue();
String title = root.getAttribute(GitlabAttribute.TITLE.getTaskKey()).getValue();
String body = root.getAttribute(GitlabAttribute.BODY.getTaskKey()).getValue();
Integer assigneeId = 0;
// We have to check, if the assignee has changed. The gitlab api leaves three posiblities for the assignee ID:
// 0: leave as it is
// -1: unassign
// real id: assign
// If we didnt do this, Gitlab would create a comment everytime we edit the issue and there is still no
// assignee
for(TaskAttribute a : attributes) {
if(a.getId().equals(GitlabAttribute.ASSIGNEE.getTaskKey())) {
GitlabProjectMember assignee = attributeMapper.findProjectMemberByName(
root.getAttribute(GitlabAttribute.ASSIGNEE.getTaskKey()).getValue());
assigneeId = (assignee == null ? -1 : assignee.getId());
}
}
GitlabMilestone milestone = attributeMapper.findMilestoneByName(
root.getAttribute(GitlabAttribute.MILESTONE.getTaskKey()).getValue());
Integer milestoneId = (milestone == null ? 0 : milestone.getId());
GitlabConnection connection = ConnectionManager.get(repository);
GitlabAPI api = connection.api();
try {
monitor.beginTask("Uploading task", IProgressMonitor.UNKNOWN);
GitlabIssue issue = null;
if(data.isNew()) {
issue = api.createIssue(connection.project.getId(), assigneeId, milestoneId, labels, body, title);
return new RepositoryResponse(ResponseKind.TASK_CREATED, "" + issue.getId());
} else {
if(root.getAttribute(TaskAttribute.COMMENT_NEW) != null &&
!root.getAttribute(TaskAttribute.COMMENT_NEW).getValue().equals("")) {
api.createNote(connection.project.getId(), GitlabConnector.getTicketId(data.getTaskId()),
root.getAttribute(TaskAttribute.COMMENT_NEW).getValue());
}
String action = root.getAttribute(TaskAttribute.OPERATION).getValue();
issue = api.editIssue(connection.project.getId(), GitlabConnector.getTicketId(data.getTaskId()), assigneeId,
milestoneId, labels, body, title, GitlabAction.find(action).getGitlabIssueAction());
return new RepositoryResponse(ResponseKind.TASK_UPDATED, "" + issue.getId());
}
} catch (IOException e) {
throw new GitlabException("Unknown connection error!");
} finally {
monitor.done();
}
}