// Path: jcart-admin/src/main/java/com/sivalabs/jcart/admin/security/SecurityUtil.java
// public class SecurityUtil
// {
// 	
// 	public static final String MANAGE_CATEGORIES = "ROLE_MANAGE_CATEGORIES";
// 	public static final String MANAGE_PRODUCTS = "ROLE_MANAGE_PRODUCTS";
// 	public static final String MANAGE_ORDERS = "ROLE_MANAGE_ORDERS";
// 	public static final String MANAGE_CUSTOMERS = "ROLE_MANAGE_CUSTOMERS";
// 	public static final String MANAGE_PAYMENT_SYSTEMS = "ROLE_MANAGE_PAYMENT_SYSTEMS";
// 	public static final String MANAGE_USERS = "ROLE_MANAGE_USERS";
// 	public static final String MANAGE_ROLES = "ROLE_MANAGE_ROLES";
// 	public static final String MANAGE_PERMISSIONS = "ROLE_MANAGE_PERMISSIONS";
// 	public static final String MANAGE_SETTINGS = "ROLE_MANAGE_SETTINGS";
// 	
// 	
// }
// 
// Path: jcart-core/src/main/java/com/sivalabs/jcart/customers/CustomerService.java
// @Service
// @Transactional
// public class CustomerService {
// 	@Autowired CustomerRepository customerRepository;
// 	
// 	public Customer getCustomerByEmail(String email) {
// 		return customerRepository.findByEmail(email);
// 	}
// 
// 	public Customer createCustomer(Customer customer) {
// 		return customerRepository.save(customer);
// 	}
// 
// 	public List<Customer> getAllCustomers() {
// 		return customerRepository.findAll();
// 	}
// 
// 	public Customer getCustomerById(Integer id) {
// 		return customerRepository.findOne(id);
// 	}
// 
// 	public List<Order> getCustomerOrders(String email) {
// 		return customerRepository.getCustomerOrders(email);
// 	}
// 
// }
// 
// Path: jcart-core/src/main/java/com/sivalabs/jcart/entities/Customer.java
// @Entity
// @Table(name="customers")
// public class Customer implements Serializable
// {
// 	private static final long serialVersionUID = 1L;
// 	@Id @GeneratedValue(strategy=GenerationType.IDENTITY)
// 	private Integer id;
// 	@Column(name="firstname", nullable=false)
// 	@NotEmpty
// 	private String firstName;
// 	@Column(name="lastname")
// 	private String lastName;
// 	@NotEmpty
// 	@Email
// 	@Column(name="email", nullable=false, unique=true)
// 	private String email;
// 	@NotEmpty
// 	@Column(name="password", nullable=false)
// 	private String password;
// 	private String phone;
// 	
// 	public Integer getId()
// 	{
// 		return id;
// 	}
// 	public void setId(Integer id)
// 	{
// 		this.id = id;
// 	}
// 	public String getFirstName()
// 	{
// 		return firstName;
// 	}
// 	public void setFirstName(String firstName)
// 	{
// 		this.firstName = firstName;
// 	}
// 	public String getLastName()
// 	{
// 		return lastName;
// 	}
// 	public void setLastName(String lastName)
// 	{
// 		this.lastName = lastName;
// 	}
// 	public String getEmail()
// 	{
// 		return email;
// 	}
// 	public void setEmail(String email)
// 	{
// 		this.email = email;
// 	}
// 	public String getPhone()
// 	{
// 		return phone;
// 	}
// 	public void setPhone(String phone)
// 	{
// 		this.phone = phone;
// 	}
// 	public String getPassword() {
// 		return password;
// 	}
// 	public void setPassword(String password) {
// 		this.password = password;
// 	}
// 	
// }


import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.annotation.Secured;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.sivalabs.jcart.admin.security.SecurityUtil;
import com.sivalabs.jcart.customers.CustomerService;
import com.sivalabs.jcart.entities.Customer;
/**
 * 
 */
package com.sivalabs.jcart.admin.web.controllers;




/**
 * @author Siva
 *
 */
@Controller
@Secured(SecurityUtil.MANAGE_CUSTOMERS)
public class CustomerController extends JCartAdminBaseController
{
	private static final String viewPrefix = "customers/";
	
	@Autowired 
	private CustomerService customerService;
	
	@Override
	protected String getHeaderTitle()
	{
		return "Manage Customers";
	}
		
// Path: jcart-admin/src/main/java/com/sivalabs/jcart/admin/security/SecurityUtil.java
// public class SecurityUtil
// {
// 	
// 	public static final String MANAGE_CATEGORIES = "ROLE_MANAGE_CATEGORIES";
// 	public static final String MANAGE_PRODUCTS = "ROLE_MANAGE_PRODUCTS";
// 	public static final String MANAGE_ORDERS = "ROLE_MANAGE_ORDERS";
// 	public static final String MANAGE_CUSTOMERS = "ROLE_MANAGE_CUSTOMERS";
// 	public static final String MANAGE_PAYMENT_SYSTEMS = "ROLE_MANAGE_PAYMENT_SYSTEMS";
// 	public static final String MANAGE_USERS = "ROLE_MANAGE_USERS";
// 	public static final String MANAGE_ROLES = "ROLE_MANAGE_ROLES";
// 	public static final String MANAGE_PERMISSIONS = "ROLE_MANAGE_PERMISSIONS";
// 	public static final String MANAGE_SETTINGS = "ROLE_MANAGE_SETTINGS";
// 	
// 	
// }
// 
// Path: jcart-core/src/main/java/com/sivalabs/jcart/customers/CustomerService.java
// @Service
// @Transactional
// public class CustomerService {
// 	@Autowired CustomerRepository customerRepository;
// 	
// 	public Customer getCustomerByEmail(String email) {
// 		return customerRepository.findByEmail(email);
// 	}
// 
// 	public Customer createCustomer(Customer customer) {
// 		return customerRepository.save(customer);
// 	}
// 
// 	public List<Customer> getAllCustomers() {
// 		return customerRepository.findAll();
// 	}
// 
// 	public Customer getCustomerById(Integer id) {
// 		return customerRepository.findOne(id);
// 	}
// 
// 	public List<Order> getCustomerOrders(String email) {
// 		return customerRepository.getCustomerOrders(email);
// 	}
// 
// }
// 
// Path: jcart-core/src/main/java/com/sivalabs/jcart/entities/Customer.java
// @Entity
// @Table(name="customers")
// public class Customer implements Serializable
// {
// 	private static final long serialVersionUID = 1L;
// 	@Id @GeneratedValue(strategy=GenerationType.IDENTITY)
// 	private Integer id;
// 	@Column(name="firstname", nullable=false)
// 	@NotEmpty
// 	private String firstName;
// 	@Column(name="lastname")
// 	private String lastName;
// 	@NotEmpty
// 	@Email
// 	@Column(name="email", nullable=false, unique=true)
// 	private String email;
// 	@NotEmpty
// 	@Column(name="password", nullable=false)
// 	private String password;
// 	private String phone;
// 	
// 	public Integer getId()
// 	{
// 		return id;
// 	}
// 	public void setId(Integer id)
// 	{
// 		this.id = id;
// 	}
// 	public String getFirstName()
// 	{
// 		return firstName;
// 	}
// 	public void setFirstName(String firstName)
// 	{
// 		this.firstName = firstName;
// 	}
// 	public String getLastName()
// 	{
// 		return lastName;
// 	}
// 	public void setLastName(String lastName)
// 	{
// 		this.lastName = lastName;
// 	}
// 	public String getEmail()
// 	{
// 		return email;
// 	}
// 	public void setEmail(String email)
// 	{
// 		this.email = email;
// 	}
// 	public String getPhone()
// 	{
// 		return phone;
// 	}
// 	public void setPhone(String phone)
// 	{
// 		this.phone = phone;
// 	}
// 	public String getPassword() {
// 		return password;
// 	}
// 	public void setPassword(String password) {
// 		this.password = password;
// 	}
// 	
// }


// Path: jcart-admin/src/main/java/com/sivalabs/jcart/admin/web/controllers/CustomerController.java
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.annotation.Secured;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.sivalabs.jcart.admin.security.SecurityUtil;
import com.sivalabs.jcart.customers.CustomerService;
import com.sivalabs.jcart.entities.Customer;

/**
 * 
 */
package com.sivalabs.jcart.admin.web.controllers;




/**
 * @author Siva
 *
 */
@Controller
@Secured(SecurityUtil.MANAGE_CUSTOMERS)
public class CustomerController extends JCartAdminBaseController
{
	private static final String viewPrefix = "customers/";
	
	@Autowired 
	private CustomerService customerService;
	
	@Override
	protected String getHeaderTitle()
	{
		return "Manage Customers";
	}
		
	@RequestMapping(value="/customers", method=RequestMethod.GET)