Package com.tmm.enterprise.microblog.security

Examples of com.tmm.enterprise.microblog.security.Account


  @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");
View Full Code Here


  @Transactional
  public Account loadAccountByUserName(String userName)
  {
    Query query = getEntityManager().createQuery("select u from Account u where u.userName = ?1");
    query.setParameter(1, userName);
    Account user = null;
   
    try{
      List<Account> users = (List<Account>)query.getResultList();
      if (users==null || users.isEmpty())
      {
View Full Code Here

    return applicationContext;
  }

  public Account getModifyingAccount() {
    ApplicationUser user = getApplicationUser();
    Account account = getAccountService().loadAccount(user.getAccountId());
    return account;
  }
View Full Code Here

      logger.debug("Error - No Team name entered when navigating to Team home");
      return ControllerHelper.buildErrorMAV(ERROR_MESSAGE);
    }

    String userName = request.getRemoteUser();
    Account user = getAccountService().loadAccountByUserName(userName);

    Team t = (Team) contactService.loadContactableByName(teamName);
    if (t == null) {
      logger.debug("Error - Team name entered does not exist in system");
      return ControllerHelper.buildErrorMAV(ERROR_MESSAGE);
View Full Code Here

      logger.debug("Error - Team name entered does not exist in system");
      return ControllerHelper.buildErrorMAV(ERROR_MESSAGE);
    }

    String userName = request.getRemoteUser();
    Account user = getAccountService().loadAccountByUserName(userName);
    Map<String, Object> model = jsonService.buildUserProfile(user);
    List<Contactable> contacts = contactService.loadAllContactables();
    jsonService.addContactsToModel(contacts, model);
    model.put("team", contactService.buildOrgChart(t));
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

    return questionDao.loadAllQuestionsAskedToUser(currentUser);
  }

  @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

    p = new Person();
    p.setRole(UserRole.MEMBER);
    p.setId(1l);

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

    s = new Status();
    s.setStatus("sent status message..");
    s.setRaisedBy(p);
View Full Code Here

   * @throws ButterflyException
   */
  @Transactional
  public void sendEmail(String senderUserName, String msg, String recipId) throws ButterflyException {
    Person recipient = null;
    Account senderAcc = accountService.loadAccountByUserName(senderUserName);
    Person sender = senderAcc.getUserProfile();
    try {
      Long id = Long.parseLong(recipId);
      recipient = contactService.loadPerson(id);
    } catch (Exception e) {
      throw new ButterflyException(ButterflyExceptionCode.USER002_INVALIDUSERID, "Invalid recipient ID provided - ID must be numeric", e);
View Full Code Here

    controller.setJsonService(jsonService);
  }

  @Test
  public void testAnonhome() {
    Account acc = new Account();
    acc.setId(1l);
    acc.setUserName("rob");

    when(accountService.loadAccountByUserName("rob")).thenReturn(acc);
    when(contactService.loadAllContactables()).thenReturn(
        new ArrayList<Contactable>());
View Full Code Here

TOP

Related Classes of com.tmm.enterprise.microblog.security.Account

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.