Package org.internna.ossmoney.model.security

Examples of org.internna.ossmoney.model.security.UserDetails


        return details(Account.findAccount(id), modelMap);
    }

    protected String details(Account account, ModelMap modelMap) {
      if (account != null) {
            UserDetails user = UserDetails.findCurrentUser();
            if (account.belongsTo(user)) {
                modelMap.addAttribute("account", account);
                modelMap.addAttribute("transactions", new TreeSet<AccountTransaction>(account.getTransactions()));
            }
        }
View Full Code Here


        return account.isCreditCard() ? "accounts/detailscc" : account.isBankAccount() ? "accounts/details" : "accounts/investment";
    }

    @RequestMapping("/create")
    public String createForm(ModelMap modelMap) {
      UserDetails user = UserDetails.findCurrentUser();
      Set<FinancialInstitution> institutions = new TreeSet<FinancialInstitution>(user.getInstitutions());
      if (CollectionUtils.isEmpty(institutions)) {
        return "administration/createInstitution";
      }
    modelMap.addAttribute("institutions", institutions);
      modelMap.addAttribute("types", AccountType.findAllAccountTypes());
View Full Code Here

        return "accounts/add";
    }

    @RequestMapping("/add/{account}")
    public String addTransaction(@PathVariable Long account, ModelMap modelMap) {
        UserDetails user = fillTransactionModel(modelMap);
        fillProvidedAccount(account, user, modelMap);
        return "accounts/add";
    }
View Full Code Here

        fillProvidedAccount(account, user, modelMap);
        return "accounts/add";
    }

    protected UserDetails fillTransactionModel(ModelMap modelMap) {
        UserDetails user = fillTransferTransactionModel(modelMap);
        modelMap.addAttribute("payees", new TreeSet<Payee>(user.getPayees()));
        modelMap.addAttribute("categories", new TreeSet<Subcategory>(Subcategory.findSelectableCategories(user)));
        return user;
    }
View Full Code Here

        modelMap.addAttribute("categories", new TreeSet<Subcategory>(Subcategory.findSelectableCategories(user)));
        return user;
    }

    protected UserDetails fillTransferTransactionModel(ModelMap modelMap) {
        UserDetails user = UserDetails.findCurrentUser();
        List<Account> accounts = Account.findOpenAccounts(user);
      modelMap.addAttribute("accounts", accounts);
        String currency = "EUR";
        if (!CollectionUtils.isEmpty(accounts)) {
            currency = accounts.get(0).getCurrency();
View Full Code Here

        return "accounts/transfer";
    }

    @RequestMapping("/transfer/{account}")
    public String transfer(@PathVariable Long account, ModelMap modelMap) {
        UserDetails user = fillTransferTransactionModel(modelMap);
        fillProvidedAccount(account, user, modelMap);
        return "accounts/transfer";
    }
View Full Code Here

    @RequestMapping("/balance/{accountId}")
    public String balance(@PathVariable Long accountId, ModelMap modelMap) {
      Account account = Account.findAccount(accountId);
        if (account != null) {
            UserDetails user = UserDetails.findCurrentUser();
            if (account.belongsTo(user) && account.isCreditCard()) {
              modelMap.addAttribute("account", account);
              modelMap.addAttribute("origin", user.getBankAccounts());
              modelMap.addAttribute("transactions", AccountTransaction.findUnreconciledTransactions(account));
            }
        }
        return "accounts/balance";
    }
View Full Code Here

    public String balance(Long accountId, Long originId, String transactions, Date operationDate, ModelMap modelMap) {
      if (hasText(transactions)) {
        Account origin = Account.findAccount(originId);
        Account account = Account.findAccount(accountId);
        if ((account != null) && (origin != null)) {
          UserDetails user = UserDetails.findCurrentUser();
          if (account.belongsTo(user) && origin.belongsTo(user)) {
            cache.invalidate(user);
            accountService.balance(user, account, origin, operationDate, transactions.split("-"));
          }
        }
View Full Code Here

    }

    @RequestMapping("/view/{id}")
    public String view(@PathVariable Long id, ModelMap modelMap) {
      Account account = Account.findAccount(id);
      UserDetails user = UserDetails.findCurrentUser();
      modelMap.addAttribute("institutions", new TreeSet<FinancialInstitution>(user.getInstitutions()));
      if (account.belongsTo(user)) {
        modelMap.addAttribute("account", account);
      }
      return "accounts/view";
    }
View Full Code Here

      return "accounts/view";
    }

    @RequestMapping(value = "/edit", method = RequestMethod.POST)
    public String edit(Account account, ModelMap modelMap) {
      UserDetails user = UserDetails.findCurrentUser();
      Account loaded = Account.findAccount(account.getId());
      if (loaded.belongsTo(user)) {
        cache.invalidate(user);
      loaded.setIsbn(account.getIsbn());
        loaded.setName(account.getName());
View Full Code Here

TOP

Related Classes of org.internna.ossmoney.model.security.UserDetails

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.