use of org.eclipse.mylyn.tasks.core.data.TaskMapper in project linuxtools by eclipse.
the class OSIORestConnector method updateTaskFromTaskData.
@Override
public void updateTaskFromTaskData(TaskRepository taskRepository, ITask task, TaskData taskData) {
TaskMapper scheme = getTaskMapping(taskData);
scheme.applyTo(task);
task.setUrl(taskData.getRoot().getAttribute(OSIORestTaskSchema.getDefault().TASK_URL.getKey()).getValue());
boolean isComplete = false;
TaskAttribute attributeStatus = taskData.getRoot().getMappedAttribute(TaskAttribute.STATUS);
if (attributeStatus != null) {
String statusValue = attributeStatus.getValue();
isComplete = (statusValue.equals(IOSIORestConstants.RESOLVED) || statusValue.equals(IOSIORestConstants.CLOSED));
}
if (taskData.isPartial()) {
if (isComplete) {
if (task.getCompletionDate() == null) {
task.setCompletionDate(new Date(0));
}
} else {
task.setCompletionDate(null);
}
} else {
inferCompletionDate(task, taskData, scheme, isComplete);
}
}
Aggregations