Package com.tmm.enterprise.microblog.domain

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


   * @return
   * @throws Exception
   */
  @RequestMapping("/list")
  public ModelAndView list(HttpServletRequest request, HttpServletResponse response) throws Exception {
    Person currentUser = accountService.getPerson(request);
    Map<String, Object> model = Maps.newHashMap();
    JsonArray raisedTasks = new JsonArray();
    JsonArray assignedTasks = new JsonArray();
    if (currentUser != null) {
      List<WorkTask> raised = workTaskService.loadWorkTasksRaised(currentUser);
View Full Code Here


   * @return
   * @throws Exception
   */
  @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());
View Full Code Here

   *
   * @param user
   * @param model
   */
  public void addUserInfoToModel(Account user, Map<String, Object> model) {
    Person profile = user.getUserProfile();
    String name = profile == null ? user.getUserName() : profile.getName();
    model.put("username", name);

    String teamName = profile == null ? "N/A" : (profile.getTeam() == null ? "N/A" : profile.getTeam().getName());
    model.put("teamname", teamName);

    String status = (profile == null || profile.getStatuses().isEmpty()) ? "You do not currently have any status set" : profile.getLatestStatus()
        .getStatus();
    model.put("currentStatus", HtmlHelper.italics(status));
  }
View Full Code Here

   * @param user
   * @param model
   * @throws ButterflyException
   */
  public void addConnectionsToModel(Account user, Map<String, Object> model) throws ButterflyException {
    Person p = user.getUserProfile();
    if (p != null) {
      JsonArray peopleArray = new JsonArray();
      JsonArray teamArray = new JsonArray();
      for (Contactable c : p.getFollowing()) {
        if(c.getObjectType() == ObjectType.PERSON)
        {
          peopleArray.add(convertToJson(c));
        }
        else if(c.getObjectType() == ObjectType.TEAM)
View Full Code Here

  }

  @Transactional
  public ToDo createToDo(String title, String description, String userName) throws ButterflyException {
    Account acc = accountService.loadAccountByUserName(userName);
    Person currentUser = acc.getUserProfile();
    if (currentUser!=null){
      ToDo todo = new ToDo();
      todo.setTitle(title);
      todo.setDetails(description);
      todo.setRaisedBy(currentUser);
      todo.setAssignedTo(currentUser);
      currentUser.addTodoItem(todo);
      todoDao.persist(todo);
      return todo;
    }
    throw new ButterflyException(ButterflyExceptionCode.USER003_INVALIDUSER, "Unable to create new ToDo - Account does not have associated Person");
  }
View Full Code Here

 
  @Test
  public void testLoadAllPersons() {
    List<Person> people = service.loadAllPersons();
    assertEquals("Check DB is empty first", 0, people.size());
    Person p = new Person();
    service.createPerson(p);
    people = service.loadAllPersons();
    assertEquals("check person has been created", 1, people.size());
  }
View Full Code Here

public class CreateNotification extends BatchProcess {

  @Transactional
  public void execute() throws Exception {
    setCredentials();
    Person belongsTo = getContactableService().loadPerson(50);

    ToDo todo = new ToDo();
    todo.setAssignedTo(belongsTo);
    todo.setDetails("its a todo item!");
    todo.setTitle("new todo..");
View Full Code Here

    // assertNotNull(loaded);
    // 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

   * @return
   * @throws Exception
   */
  @RequestMapping
  public ModelAndView latestActivity(@RequestParam(defaultValue="0") Integer latestId,@RequestParam(defaultValue="0") Integer pageNum,HttpServletRequest request) throws Exception {
    Person currentUser = accountService.getPerson(request);
    List<Notification> latest = notificationService.loadNotificationsForUser(currentUser, pageNum);
    JsonObject returnObj = new JsonObject();
    if (!latest.isEmpty()) {
      JsonArray array = new JsonArray();
      boolean startRecording = (latestId == 0l);
      for (int i = latest.size() - 1; i >= 0; i--) {
        if (latest.get(i).getActivity() == null) {
          continue;
        }
        Activity a = latest.get(i).getActivity();
        if (startRecording) {
          JsonObject o = jsonService.convertToJson(a);
          o.addProperty("isOwner", currentUser.equals(a.getRaisedBy()));
          array.add(o);
        }

        // check whether to update status from here
        if (a.getId().equals(latestId)) {
View Full Code Here

      account.addRole(r);
      account.setUserName(name);
      account.setEmail(email);
      account.setFirstName(firstName);
      account.setLastName(lastName);
      Person userProf = new Person();
      userProf.setRole(UserRole.MEMBER);
      userProf.setLinkedAccount(account);
      account.setUserProfile(userProf);

      getAccountDAO().persist(account);

      // now update password once we have the account created (we need the
View Full Code Here

TOP

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

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.