Package com.tmm.enterprise.microblog.domain

Examples of com.tmm.enterprise.microblog.domain.WorkTask


    // FIXME - just put in to get web running.. will need more thought on
    // the rendering approach

    JsonObject n = new JsonObject();
    WorkTask wt = (WorkTask) renderTarget.getActivity();
    n.addProperty("read", renderTarget.isRead());
    String msg = wt.getTitle() == null ? (wt.getDetails().length() > 100 ? wt.getDetails().substring(0, 100) : wt.getDetails()) : (wt.getTitle()
        .length() > 100 ? wt.getTitle().substring(0, 100) : wt.getTitle());
    boolean isOwner = wt.getRaisedBy() != null && wt.getRaisedBy().getNotifications().contains(renderTarget);
    String from;
    if (isOwner) {
      from = "you raised this Work Request";
    } else {
      from = "Work Ticket raised by " + (wt.getRaisedBy() == null ? "Unknown Sender" : wt.getRaisedBy().getName());
    }
    n.addProperty("body", msg);
    n.addProperty("from", from);
    n.addProperty("activityId", wt.getId());
    n.addProperty("activityType", "Question");

    return n;
  }
View Full Code Here


   */
  @RequestMapping("/detail/{taskId}")
  public ModelAndView detail(@PathVariable("taskId") long taskId, HttpServletRequest request, HttpServletResponse response) throws Exception {
    Person currentUser = accountService.getPerson(request);
    notificationService.markAsRead(currentUser, taskId);
    WorkTask t = workTaskService.loadWorkTask(taskId);
    JsonObject task = jsonService.convertToJson(t);

    List<Activity> similarTasks = searchService.searchTasksByTitle(t.getTitle());
    JsonArray similar = new JsonArray();
    for (Activity wt : similarTasks) {
      if (!wt.equals(t)) {
        JsonObject obj = new JsonObject();
        obj.addProperty("title", wt.getTitle());
View Full Code Here

  public void createWorkTask(String title, String description, String currentUserName, long assignedToId, String priority) {
    Account acc = accountService.loadAccountByUserName(currentUserName);
    Person currentUser = acc.getUserProfile();
    if (currentUser != null) {
      Contactable contact = contactService.loadContactable(assignedToId);
      WorkTask wt = new WorkTask();
      wt.setTitle(title);
      wt.setDetails(description);
      wt.setPriority(WorkTask.Priorities.valueOf(priority));
      wt.setRaisedBy(currentUser);
      wt.setAssignedTo(contact);
      workTaskDao.persist(wt);
    }
  }
View Full Code Here

    return workTaskDao.loadAllWorkTasksRaisedToUser(currentUser);
  }

  @Transactional
  public void updateWorkTask(String state, String body, String userName, long assignedToId, String priority, long taskId) {
    WorkTask wt = loadWorkTask(taskId);
    wt.setState(State.valueOf(state));
    wt.setPriority(Priorities.valueOf(priority));
    if (wt.getAssignedTo().getId() != assignedToId) {
      Contactable ass = contactService.loadContactable(assignedToId);
      wt.setAssignedTo(ass);
    }

    if (body != null && !"".equals(body.trim())) {
      Account acc = accountService.loadAccountByUserName(userName);
      Person currentUser = acc.getUserProfile();
      TicketUpdate update = new TicketUpdate();
      update.setDetails(body);
      update.setTicket(wt);
      update.setRaisedBy(currentUser);
      update.setAssignedTo(wt.getRaisedBy());
      wt.addUpdate(update);
      entityManager.persist(update);
    }
  }
View Full Code Here

TOP

Related Classes of com.tmm.enterprise.microblog.domain.WorkTask

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.