// Path: modules/global/src/com/company/ordermanagement/entity/Product.java
// @NamePattern("%s|name")
// @Table(name = "OM_PRODUCT")
// @Entity(name = "om$Product")
// public class Product extends StandardEntity {
//     private static final long serialVersionUID = -5073711717993812319L;
// 
//     @Column(name = "NAME", nullable = false)
//     protected String name;
// 
//     @ManyToOne(fetch = FetchType.LAZY, optional = false)
//     @JoinColumn(name = "CATEGORY_ID")
//     protected ProductCategory category;
// 
//     @Lob
//     @Column(name = "DESCRIPTION")
//     protected String description;
// 
//     @JoinTable(name = "OM_PRODUCT_FILE_DESCRIPTOR_LINK",
//         joinColumns = @JoinColumn(name = "PRODUCT_ID"),
//         inverseJoinColumns = @JoinColumn(name = "FILE_DESCRIPTOR_ID"))
//     @ManyToMany
//     protected Set<FileDescriptor> images;
// 
//     public void setDescription(String description) {
//         this.description = description;
//     }
// 
//     public String getDescription() {
//         return description;
//     }
// 
//     public void setImages(Set<FileDescriptor> images) {
//         this.images = images;
//     }
// 
//     public Set<FileDescriptor> getImages() {
//         return images;
//     }
// 
// 
//     public void setName(String name) {
//         this.name = name;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public void setCategory(ProductCategory category) {
//         this.category = category;
//     }
// 
//     public ProductCategory getCategory() {
//         return category;
//     }
// 
// 
// }
// 
// Path: modules/portal/src/com/company/ordermanagement/portal/command/LoginUserCommand.java
// @SuppressWarnings({"UnusedDeclaration"})
// public class LoginUserCommand {
// 
//     private String login;
// 
//     private String password;
// 
//     public String getLogin() {
//         return login;
//     }
// 
//     public void setLogin(String login) {
//         this.login = login;
//     }
// 
//     public String getPassword() {
//         return password;
//     }
// 
//     public void setPassword(String password) {
//         this.password = password;
//     }
// }


import com.company.ordermanagement.entity.Product;
import com.company.ordermanagement.portal.command.LoginUserCommand;
import com.haulmont.cuba.core.app.DataService;
import com.haulmont.cuba.core.global.LoadContext;
import com.haulmont.cuba.portal.security.PortalSessionProvider;
import com.haulmont.cuba.security.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import javax.inject.Inject;
/*
 * Copyright (c) 2015 ordermanagement
 */
package com.company.ordermanagement.portal.controllers;



/**
 * @author mario
 */
@Controller
public class PortalController {

    @Inject
    protected DataService dataService;

    @RequestMapping(value = "/", method = RequestMethod.GET)
    public String index(Model model) {
        if (!PortalSessionProvider.getUserSession().isAuthenticated()) {
// Path: modules/global/src/com/company/ordermanagement/entity/Product.java
// @NamePattern("%s|name")
// @Table(name = "OM_PRODUCT")
// @Entity(name = "om$Product")
// public class Product extends StandardEntity {
//     private static final long serialVersionUID = -5073711717993812319L;
// 
//     @Column(name = "NAME", nullable = false)
//     protected String name;
// 
//     @ManyToOne(fetch = FetchType.LAZY, optional = false)
//     @JoinColumn(name = "CATEGORY_ID")
//     protected ProductCategory category;
// 
//     @Lob
//     @Column(name = "DESCRIPTION")
//     protected String description;
// 
//     @JoinTable(name = "OM_PRODUCT_FILE_DESCRIPTOR_LINK",
//         joinColumns = @JoinColumn(name = "PRODUCT_ID"),
//         inverseJoinColumns = @JoinColumn(name = "FILE_DESCRIPTOR_ID"))
//     @ManyToMany
//     protected Set<FileDescriptor> images;
// 
//     public void setDescription(String description) {
//         this.description = description;
//     }
// 
//     public String getDescription() {
//         return description;
//     }
// 
//     public void setImages(Set<FileDescriptor> images) {
//         this.images = images;
//     }
// 
//     public Set<FileDescriptor> getImages() {
//         return images;
//     }
// 
// 
//     public void setName(String name) {
//         this.name = name;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public void setCategory(ProductCategory category) {
//         this.category = category;
//     }
// 
//     public ProductCategory getCategory() {
//         return category;
//     }
// 
// 
// }
// 
// Path: modules/portal/src/com/company/ordermanagement/portal/command/LoginUserCommand.java
// @SuppressWarnings({"UnusedDeclaration"})
// public class LoginUserCommand {
// 
//     private String login;
// 
//     private String password;
// 
//     public String getLogin() {
//         return login;
//     }
// 
//     public void setLogin(String login) {
//         this.login = login;
//     }
// 
//     public String getPassword() {
//         return password;
//     }
// 
//     public void setPassword(String password) {
//         this.password = password;
//     }
// }


// Path: modules/portal/src/com/company/ordermanagement/portal/controllers/PortalController.java
import com.company.ordermanagement.entity.Product;
import com.company.ordermanagement.portal.command.LoginUserCommand;
import com.haulmont.cuba.core.app.DataService;
import com.haulmont.cuba.core.global.LoadContext;
import com.haulmont.cuba.portal.security.PortalSessionProvider;
import com.haulmont.cuba.security.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import javax.inject.Inject;

/*
 * Copyright (c) 2015 ordermanagement
 */
package com.company.ordermanagement.portal.controllers;



/**
 * @author mario
 */
@Controller
public class PortalController {

    @Inject
    protected DataService dataService;

    @RequestMapping(value = "/", method = RequestMethod.GET)
    public String index(Model model) {
        if (!PortalSessionProvider.getUserSession().isAuthenticated()) {
            final LoginUserCommand loginUserCommand = new LoginUserCommand();