use of org.dataportabilityproject.serviceProviders.rememberTheMilk.model.TaskSeries in project data-transfer-project by google.
the class RememberTheMilkTaskService method exportTaskList.
private TaskModelWrapper exportTaskList(Resource resource, Optional<PaginationInformation> paginationInformation) throws IOException {
int oldListId = Integer.parseInt(((IdOnlyResource) resource).getId());
GetListResponse oldList = getList(oldListId);
List<TaskList> taskLists = oldList.tasks.list;
List<TaskModel> tasks = new ArrayList<>();
for (TaskList taskList : taskLists) {
if (taskList.taskSeriesList != null) {
for (TaskSeries taskSeries : taskList.taskSeriesList) {
tasks.add(new TaskModel(Integer.toString(oldListId), taskSeries.name, taskSeries.notes.toString()));
for (Task task : taskSeries.tasks) {
// Do something here with completion date, but its odd there can be more than one.
}
}
}
}
return new TaskModelWrapper(null, tasks, null);
}
use of org.dataportabilityproject.serviceProviders.rememberTheMilk.model.TaskSeries in project data-transfer-project by google.
the class RememberTheMilkTaskService method importItem.
@Override
public void importItem(TaskModelWrapper wrapper) throws IOException {
String timeline = createTimeline();
for (TaskListModel taskList : wrapper.getLists()) {
ListInfo listInfo = createTaskList(taskList.getName(), timeline);
jobDataCache.store(taskList.getId(), listInfo.id);
}
for (TaskModel task : wrapper.getTasks()) {
int newList = jobDataCache.getData(task.getTaskListId(), Integer.class);
TaskSeries addedTask = createTask(task.getText(), timeline, newList);
// TODO add note here
}
}
Aggregations