use of org.dataportabilityproject.serviceProviders.rememberTheMilk.model.ListInfo 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
}
}
use of org.dataportabilityproject.serviceProviders.rememberTheMilk.model.ListInfo in project data-transfer-project by google.
the class RememberTheMilkTaskService method exportTaskLists.
private TaskModelWrapper exportTaskLists(Optional<PaginationInformation> paginationInformation) throws IOException {
List<TaskListModel> lists = new ArrayList<>();
List<Resource> subResources = new ArrayList<>();
for (ListInfo oldListInfo : getLists().listInfoList.lists) {
if (oldListInfo.name.equals("All Tasks")) {
// don't copy that over.
continue;
}
lists.add(new TaskListModel(Integer.toString(oldListInfo.id), oldListInfo.name));
subResources.add(new IdOnlyResource(Integer.toString(oldListInfo.id)));
}
return new TaskModelWrapper(lists, null, new ContinuationInformation(subResources, null));
}
Aggregations