Search in sources :

Example 11 with TaskAttribute

use of org.eclipse.mylyn.tasks.core.data.TaskAttribute in project linuxtools by eclipse.

the class OSIOTestRestRequestProvider method getTaskLinks.

@Override
public TaskAttribute getTaskLinks(IOperationMonitor monitor, CommonHttpClient client, OSIORestClient restClient, Space space, TaskData taskData, OSIORestConfiguration config) throws OSIORestException {
    TaskAttribute links = (TaskAttribute) requestMap.get("/workitems/" + taskData.getRoot().getAttribute(OSIORestTaskSchema.getDefault().UUID.getKey()).getValue() + "/relationships/links");
    taskData.getRoot().deepAddCopy(links);
    return links;
}
Also used : TaskAttribute(org.eclipse.mylyn.tasks.core.data.TaskAttribute)

Example 12 with TaskAttribute

use of org.eclipse.mylyn.tasks.core.data.TaskAttribute in project linuxtools by eclipse.

the class OSIOTestRestRequestProvider method getTaskComments.

@SuppressWarnings("unchecked")
@Override
public List<TaskAttribute> getTaskComments(IOperationMonitor monitor, CommonHttpClient client, Space space, TaskData taskData) throws OSIORestException {
    List<TaskAttribute> comments = (List<TaskAttribute>) requestMap.get("/workitems/" + taskData.getRoot().getAttribute(OSIORestTaskSchema.getDefault().UUID.getKey()).getValue() + "/comments");
    TaskAttribute root = taskData.getRoot();
    for (TaskAttribute comment : comments) {
        root.deepAddCopy(comment);
    }
    return comments;
}
Also used : TaskAttribute(org.eclipse.mylyn.tasks.core.data.TaskAttribute) List(java.util.List)

Example 13 with TaskAttribute

use of org.eclipse.mylyn.tasks.core.data.TaskAttribute in project linuxtools by eclipse.

the class OSIOTestRestRequestProvider method getTaskCreator.

@Override
public TaskAttribute getTaskCreator(IOperationMonitor monitor, CommonHttpClient client, TaskData taskData) throws OSIORestException {
    TaskAttribute creator = (TaskAttribute) requestMap.get("/users/" + taskData.getRoot().getAttribute(OSIORestTaskSchema.getDefault().CREATOR_ID.getKey()).getValue());
    taskData.getRoot().deepAddCopy(creator);
    return creator;
}
Also used : TaskAttribute(org.eclipse.mylyn.tasks.core.data.TaskAttribute)

Example 14 with TaskAttribute

use of org.eclipse.mylyn.tasks.core.data.TaskAttribute in project linuxtools by eclipse.

the class OSIOTestRestRequestProvider method getTaskLabels.

@Override
public TaskAttribute getTaskLabels(IOperationMonitor monitor, CommonHttpClient client, Space space, TaskData taskData) throws OSIORestException {
    TaskAttribute labels = (TaskAttribute) requestMap.get("/workitems/" + taskData.getRoot().getAttribute(OSIORestTaskSchema.getDefault().UUID.getKey()).getValue() + "/labels");
    taskData.getRoot().deepAddCopy(labels);
    return labels;
}
Also used : TaskAttribute(org.eclipse.mylyn.tasks.core.data.TaskAttribute)

Example 15 with TaskAttribute

use of org.eclipse.mylyn.tasks.core.data.TaskAttribute in project linuxtools by eclipse.

the class OSIORestClient method setTaskAssignees.

private void setTaskAssignees(TaskData taskData) throws OSIORestException {
    TaskAttribute assigneeIDs = taskData.getRoot().getAttribute(OSIORestTaskSchema.getDefault().ASSIGNEE_IDS.getKey());
    List<String> ids = assigneeIDs.getValues();
    for (String id : ids) {
        restRequestProvider.getTaskAssignee(new NullOperationMonitor(), getClient(), id, taskData);
    }
}
Also used : TaskAttribute(org.eclipse.mylyn.tasks.core.data.TaskAttribute)

Aggregations

TaskAttribute (org.eclipse.mylyn.tasks.core.data.TaskAttribute)36 OSIORestClient (org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestClient)13 TaskData (org.eclipse.mylyn.tasks.core.data.TaskData)13 TestData (org.eclipse.linuxtools.mylyn.osio.rest.test.support.TestData)12 Test (org.junit.Test)12 AbstractTaskDataHandler (org.eclipse.mylyn.tasks.core.data.AbstractTaskDataHandler)11 TaskAttributeMapper (org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper)11 NullOperationMonitor (org.eclipse.linuxtools.internal.mylyn.osio.rest.core.NullOperationMonitor)10 OSIORestConfiguration (org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestConfiguration)10 RepositoryLocation (org.eclipse.mylyn.commons.repositories.core.RepositoryLocation)10 FileReader (java.io.FileReader)7 OSIORestTaskSchema (org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestTaskSchema)5 TaskAttributeMetaData (org.eclipse.mylyn.tasks.core.data.TaskAttributeMetaData)5 JsonWriter (com.google.gson.stream.JsonWriter)3 StringWriter (java.io.StringWriter)3 ArrayList (java.util.ArrayList)3 LinkedHashSet (java.util.LinkedHashSet)3 TreeSet (java.util.TreeSet)3 Space (org.eclipse.linuxtools.internal.mylyn.osio.rest.core.response.data.Space)3 TaskCommentMapper (org.eclipse.mylyn.tasks.core.data.TaskCommentMapper)3