Package org.internna.ossmoney.model.security

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


      return "investment/view";
    }

    @RequestMapping(value = "/edit", method = RequestMethod.POST)
    public String edit(InvestmentTransaction transaction, ModelMap modelMap) {
      UserDetails user = UserDetails.findCurrentUser();
      InvestmentTransaction loaded = InvestmentTransaction.findInvestmentTransaction(transaction.getId());
      Account account = loaded.getAccountTransaction().getAccount();
      if (account.belongsTo(user)) {
        cache.invalidate(user);
        AccountTransaction accountTransaction = loaded.getAccountTransaction();
View Full Code Here


    }

    @RequestMapping("/remove/{id}")
    public String remove(@PathVariable Long id, ModelMap modelMap) {
      Long accountId = null;
      UserDetails user = UserDetails.findCurrentUser();
      InvestmentTransaction transaction  = InvestmentTransaction.findInvestmentTransaction(id);
      if (transaction != null) {
        AccountTransaction accountTransaction = transaction.getAccountTransaction();
        Account account = accountTransaction.getAccount();
        if (account.belongsTo(user)) {
View Full Code Here

      return "redirect:/financial/accounts/" + (accountId != null ? accountId : "");
    }

    @RequestMapping("/update-prices")
    public String investments(ModelMap modelMap) {
      UserDetails user = UserDetails.findCurrentUser();
      modelMap.addAttribute("investments", Investment.findInvestmentsByOwner(user));
      return "investment/prices";
    }
View Full Code Here

      return "investment/prices";
    }

    @RequestMapping("/prices/{id}")
    public String getPrices(@PathVariable Long id, ModelMap modelMap) {
      UserDetails user = UserDetails.findCurrentUser();
      String currency = "EUR";
      Investment investment = Investment.findInvestment(id);
      Set<InvestmentPrice> prices = new TreeSet<InvestmentPrice>();
      Set<InvestmentPrice> datedPrices = new TreeSet<InvestmentPrice>();
      if (investment.belongsTo(user)) {
View Full Code Here

      }
    }

    @RequestMapping(value = "/prices", method = RequestMethod.POST)
    public String setPrice(Long investmentId, Long priceId, Date operationDate, Double amount, ModelMap modelMap) {
      UserDetails user = UserDetails.findCurrentUser();
      Investment investment = Investment.findInvestment(investmentId);
      InvestmentPrice price = InvestmentPrice.findInvestmentPrice(priceId);
      if (price == null) {
        price = new InvestmentPrice();
        investment.addPrice(price);
View Full Code Here

        .setParameter("owner", owner)
        .getResultList();
    }

    public static Payee findByName(String name) {
      UserDetails owner = UserDetails.findCurrentUser();
      return findByName(name, owner);
    }
View Full Code Here

      return amount;
    }

    @RequestMapping("/categories")
    public String expensesByCategoryOverTime(final ModelMap modelMap) {
      UserDetails user = getCurrentUser();
      modelMap.addAttribute("subcategories", new TreeSet<Subcategory>(Subcategory.findExpenseCategories(user)));
      return "reporting/categories";
    }
View Full Code Here

      return "reporting/categories";
    }

    @RequestMapping("/categories-chart/{id}/{intervals}")
    public String expensesByCategoryOverTimeChartData(@PathVariable final Long id, @PathVariable final String intervals, final ModelMap modelMap) {
      UserDetails user = getCurrentUser();
      Interval interval = getInterval(intervals);
      Subcategory subcat = Subcategory.findSubcategory(id);
      Map<String, BigDecimal> maxValues = cache.getMaxCategoryData(user, subcat, intervals);
      Map<String, Map<Date, NameValuePair<Date, BigDecimal>>> budgetData = cache.getAlloted(user, subcat, intervals);
      Map<String, Map<Date, NameValuePair<Date, BigDecimal>>> currencyData = cache.getCategoryData(user, subcat, intervals);
View Full Code Here

    private UserDetails owner;

    private String web, icon;

    public static FinancialInstitution findByName(String name) {
        UserDetails owner = UserDetails.findCurrentUser();
        return entityManager().createQuery("select f from FinancialInstitution f where name = :name AND owner = :owner", FinancialInstitution.class).setParameter("name", name).setParameter("owner", owner).getSingleResult();
    }
View Full Code Here

    @RequestMapping
    public String index(ModelMap modelMap) {
        modelMap.addAttribute("all", Boolean.TRUE);
        SortedSet<Account> accounts = new TreeSet<Account>();
        UserDetails user = UserDetails.findCurrentUser();
        Set<Account> userAccounts = user.getAccounts();
        if (CollectionUtils.isEmpty(userAccounts)) {
      return CollectionUtils.isEmpty(user.getInstitutions()) ? "administration/createInstitution" : createForm(modelMap);
        }
        accounts.addAll(userAccounts);
      modelMap.addAttribute("accounts", accounts);
        return "accounts/index";
    }
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.