Package com.tmm.enterprise.microblog.domain

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


   * @throws Exception
   */
  @RequestMapping
  public ModelAndView latestUserActivity(@RequestParam String userName,@RequestParam(defaultValue="0") Long latestId,@RequestParam Integer pageNum,HttpServletRequest request) throws Exception {
    Account acc = accountService.loadAccountByUserName(userName);
    Person currentUser = acc.getUserProfile();
    List<Activity> latest = activityService.loadLatestPublicStatus(currentUser, pageNum);
    JsonObject returnObj = new JsonObject();
    if (!latest.isEmpty()) {
      JsonArray array = new JsonArray();
      boolean startRecording = (latestId == 0l);
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

   * @param request
   * @return
   */
  public Person getPerson(HttpServletRequest request) {
    Account acc = getAccount(request);
    Person person = acc.getUserProfile();
    return person;
  }
View Full Code Here

    return getNotifications(request,ObjectType.TRACKER);
  }
 
  private ModelAndView getNotifications(HttpServletRequest request,ObjectType... notificationTypes)
      throws ButterflyException {
    Person user = (Person) contactableService.loadContactableByName(request.getRemoteUser());
    String latestIdStr = request.getParameter("latestUpdateId");
    Long latestId = 0l; // default to 0 so it is never found if no latest ID
    // provided
    if (latestIdStr != null) {
      latestId = Long.parseLong(latestIdStr);
View Full Code Here

    controller.setJsonService(jsonService);
  }

  @Test
  public void testLoadDirectory() {
    Person p = new Person();
    p.setRole(UserRole.MEMBER);
    p.setId(99l);
    Account acc = new Account();
    acc.setUserName("rob");
    acc.setId(999l);
    acc.setUserProfile(p);
    p.setLinkedAccount(acc);

    Team t = new Team();
    t.setName("dev team");
    t.setDescription("na");
    t.addMember(p);
    p.setTeam(t);
    List<Team> ts = new ArrayList<Team>();
    ts.add(t);

    when(contactService.loadAllTeams()).thenReturn(ts);
View Full Code Here

  @Transactional
  public Contactable loadContactableByName(String contactName) throws ButterflyException {
    Account acc = accountService.loadAccountByUserName(contactName);
    if (acc != null) {
      Person user = acc.getUserProfile();
      if (user != null) {
        return user;
      }
    }
View Full Code Here

   */
  @Transactional
  public void connect(String userName, long connectId) throws ButterflyException {
    Account acc = accountService.loadAccountByUserName(userName);
    if (acc != null) {
      Person user = acc.getUserProfile();
      if (user != null) {
        Contactable c = loadContactable(connectId);
        user.addFollowing(c);
      } else {
        throw new ButterflyException(ButterflyExceptionCode.CONTACT002_ERRORMAKINGCONNECTION, "Error making connection: ");
      }
    } else {
      throw new ButterflyException(ButterflyExceptionCode.CONTACT002_ERRORMAKINGCONNECTION, "Error making connection: ");
View Full Code Here

    request = new MockHttpServletRequest();
    response  = new MockHttpServletResponse();
   
    controller.setStatusService(statusService);
   
    p = new Person();
    p.setRole(UserRole.MEMBER);
    p.setId(1l);
   
    s = new Status();
    s.setStatus("sent status message..");
View Full Code Here

  @Transactional
  public void createQuestion(String title, String description, String currentUserName, long assignedToId, String tags) {
    // current user
    Account acc = accountService.loadAccountByUserName(currentUserName);
    Person currentUser = acc.getUserProfile();
    // assigning to
    if (currentUser != null) {
      Contactable contact = contactService.loadContactable(assignedToId);
      Question q = new Question();
      q.setTitle(title);
View Full Code Here

  }

  @Transactional
  public void createAnswer(long questionId, String answer, String currentUserName) {
    Account acc = accountService.loadAccountByUserName(currentUserName);
    Person currentUser = acc.getUserProfile();
    // assigning to
    if (currentUser != null) {
      Question q = loadQuestion(questionId);
      Answer a = new Answer();
      a.setAssignedTo(currentUser);
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.