Package com.google.appengine.demos.taskengine.shared

Examples of com.google.appengine.demos.taskengine.shared.Task


    DomUtils.addEventListener("click", saveButton, new EventListener() {
      public void onBrowserEvent(Event event) {
        if (currentTask == null) {
          // We have a new Task
          currentTask = new Task("", titleField.getValue(),
              detailsField.getValue(), labelMatrix.getCurrentLabelPriority(),
              false);
          if (validateFields(currentTask)) {
            controller.addNewTask(currentTask);
          } else {
View Full Code Here


      // AppEngine datastore does not allow multiple conditional operators. So
      // we need to select all tasks for this user and then do our own hash
      // join.
      HashMap<String, Task> managedTaskHash = new HashMap<String, Task>();
      for (int i = 0; i < tasks.size(); i++) {
        Task task = tasks.get(i);
        managedTaskHash.put(task.getId(), task);
      }

      // Delete the tasks we need to delete.
      for (int i = 0; i < tasksToDelete.length; i++) {
        String idOfTaskToDelete = tasksToDelete[i];
View Full Code Here

      // This pattern is not the cleanest. But so that we don't have to create
      // another GWT serializable wrapper type, we reuse the TaskData type and
      // simply special case the first entry in the returned array to have
      // meta data about the logged in user.
      Task metaTask = new Task();
      metaTask.setEmail(email);
      metaTask.setDetails(userService.createLogoutURL(
        userService.createLoginURL(getAppUrl())));
      detachedTasks.add(0, metaTask);
      return detachedTasks.toArray(new Task[0]);
    } else {
      return null;
View Full Code Here

    String taskId = null;
    PersistenceManager pm = pmf.getPersistenceManager();
    Transaction tx = pm.currentTransaction();
    try {
      tx.begin();
      Task managedTask = (Task) pm.getObjectById(Task.class,
          existingTask.getId());
      if (managedTask != null) {
        managedTask.setEmail(existingTask.getEmail());
        managedTask.setTitle(existingTask.getTitle());
        managedTask.setDetails(existingTask.getDetails());
        managedTask.setFinished(existingTask.isFinished());
        managedTask.setLabelPriority(existingTask.getLabelPriority());
        taskId = managedTask.getId();
      }
      tx.commit();
    } catch (Exception e) {
      if (tx.isActive()) {
        tx.rollback();
View Full Code Here

        if (tasks == null) {
          onFailure(null);
        } else {
          // The 0th index contains a meta task that is just a container for the
          // user's email address and logout URL
          Task metaTask = tasks[0];
          String userEmail = metaTask.getEmail();
          String logoutUrl = metaTask.getDetails();
          taskList.setUserLoggedIn(userEmail, logoutUrl);

          for (int i = 1, n = tasks.length; i < n; i++) {
            Task task = tasks[i];
            taskList.addTaskToUi(task).setRowAsPersisted(task.getId());
          }
        }
      }

    });
View Full Code Here

TOP

Related Classes of com.google.appengine.demos.taskengine.shared.Task

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.