Package com.tmm.enterprise.microblog.domain

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


   */
  public ModelAndView repeatStatus(HttpServletRequest request, HttpServletResponse response) throws Exception {
    String statusId = request.getParameter("status");
    statusId = statusId.replace("/", "");
    long id = Long.parseLong(statusId);
    Status oldStatus = statusService.loadStatus(id);
    String newStatus = oldStatus.getStatus();
    String userName = request.getRemoteUser();
    statusService.createStatus(newStatus, userName);

    Map<String, String> model = Maps.newHashMap();
    model.put("status", newStatus);
View Full Code Here


    jsonService.setHtmlConverter(bbc);
  }

  @Test
  public void testConvertToJsonStatus() {
    Status s = new Status();
    s.setStatus("test status!");
    Date now = new Date();
    s.setCreationDate(now);
    s.setId(1l);
    JsonObject job = jsonService.convertToJson(s);
    assertEquals(
        "{\"body\":\"test status!\",\"title\":\"test status!\",\"createdAt\":\""
            + now.toString()
            + "\",\"createdBy\":\"UNKNOWN AUTHOR\",\"id\":1,\"displayDate\":\"just now\",\"objectType\":\"STATUS\"}",
View Full Code Here

    // assertEquals("test status being sent!", loaded.getStatus());
  }

  private Status createTestsStatus(String identifier) {
    Person sender = new Person();
    Status s = new Status(sender, "test status " + identifier);
    service.createStatus(s);
    return s;
  }
View Full Code Here

   
    p = new Person();
    p.setRole(UserRole.MEMBER);
    p.setId(1l);
   
    s = new Status();
    s.setStatus("sent status message..");
    s.setRaisedBy(p);
    p.addStatus(s);
    s.setId(99l);
    now = new Date();
View Full Code Here

    p.setId(1l);

    acc = new Account();
    acc.setUserProfile(p);

    s = new Status();
    s.setStatus("sent status message..");
    s.setRaisedBy(p);
    p.addStatus(s);
    s.setId(99l);
    now = new Date();
View Full Code Here

  @Transactional
  public void createStatus(String newStatus, String userName) {
    Account acc = accountService.loadAccountByUserName(userName);
    Person currentUser = acc.getUserProfile();
    if (currentUser != null) {
      Status s = new Status(currentUser, newStatus);
      currentUser.addStatus(s);
      statusDao.persist(s);
    }
  }
View Full Code Here

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

    JsonObject n = new JsonObject();
    Status s = (Status) renderTarget.getActivity();
    n.addProperty("read", renderTarget.isRead());
    String msg = s.getTitle();
    boolean isOwner = s.getRaisedBy() != null && s.getRaisedBy().getNotifications().contains(renderTarget);
    String from;
    if (isOwner) {
      from = "you posted this update";
    } else {
      from = "update posted by " + (s.getRaisedBy() == null ? "Unknown Sender" : s.getRaisedBy().getName());
    }
    n.addProperty("body", msg);
    n.addProperty("from", from);
    n.addProperty("activityId", s.getId());
    n.addProperty("activityType", "Status");

    return n;
  }
View Full Code Here

TOP

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

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.