Package com.ateam.webstore.ui.views

Examples of com.ateam.webstore.ui.views.View


   * @return
   */
  public OrderDetailsView getOrderDetailsView(Orders order, boolean admin) {

   
    View main = null;
    if (admin) {
      main = getMainAdminView();
    }
    else {
      main = getMainView();
View Full Code Here


    return olv;
  }

  public OrderListView getAllView(boolean inProgressOnly) {
   
    View main = null;
   
//    if (admin) {
//     
//    } else {
//      main = getMainView();
View Full Code Here

   * @return
   */
  public View getMainView() {

    l.fine("building main view");
    View v = new View();
    v.setTitle("A+Team WebStore");
    v.setHeaderTitle(v.getTitle());
   
    if (navLinks == null) {
      l.info("building navigation");
      CategoryService service = new CategoryService();
      ArrayList<Category> categories = new ArrayList<Category>();
     
      categories.add((Category) service.getById(new Long(101)));
      categories.add((Category) service.getById(new Long(102)));
      categories.add((Category) service.getById(new Long(103)));
     
      navLinks = new HashMap<String,String>();

      int i = 0;
      for (Category c : categories) if (i < 3) {
        navLinks.put(c.getName(), req.getContextPath()+"/store?category="+c.getId());
        i++;
      }
     
    }
    else {
      l.fine("navigation exists");
    }
   
    v.setNavLinks(navLinks);

    v = setVisitorInfo(v);
   
    return  v;
  }
View Full Code Here

   * @param message
   * @param contentHeader
   * @return
   */
  public View getMessageView(String message, String contentHeader) {
    View v = new View(getMainView());
    v.setMessage(message);
   
    v.addContentView(new ContentView(JSP_MESSAGE, contentHeader));
   
    return v;
   
  }
View Full Code Here

   * @return
   */
  public View getMainAdminView() {

    l.fine("building main admin view");
    View v = new View();
    v.setTitle("A+Team Administration");
    v.setHeaderTitle(v.getTitle());
   
    v.setShowLogonForm(false);
   
    v = setVisitorInfo(v);
   
    return  v;
  }
View Full Code Here

  /**
   *
   * @return
   */
  public View getAdminHomeView() {
    View v = getMainAdminView();
    v.addContentView(new ContentView(JSP_ADMIN_HOME, "Admin Home"));
    return v;
  }
View Full Code Here

  }
 
 
  public View getFeedbackView() {
   
    View v = new View(getMainView());
   
    v.addContentView(new ContentView(JSP_CUSTOMER_FEEDBACK, "Send Feedback"));
    return v;
  }
View Full Code Here

  @Override
  protected void doGet(HttpServletRequest req, HttpServletResponse resp)
      throws ServletException, IOException {

    View v = null;

    //Debugging
    dumpRequest(req);

    try {
     
     
      if (req.getParameterMap().containsKey(Parameters.LOGIN.getId())) {
        CustomerHandler vh = new CustomerHandler(req);
        v = vh.getLoginView("Please Login");
      }
      else if (req.getParameterMap().containsKey(Parameters.LOGOUT.getId())) {
        CustomerHandler vh = new CustomerHandler(req);
        v = vh.getLogoutView();
      }
      else if (req.getParameterMap().containsKey(Parameters.MY_ACCOUNT.getId())) {
        CustomerHandler vh = new CustomerHandler(req);
        v = vh.getMyAccountView();
      }
      else if (req.getParameterMap().containsKey(Parameters.FORGOT.getId())) {
        CustomerHandler vh = new CustomerHandler(req);
        v = vh.getForgotPasswordView();
      }
      else if (req.getParameterMap().containsKey(Parameters.REGISTER.getId())) {
        CustomerHandler vh = new CustomerHandler(req);
        v = vh.getRegistrationView();
      }   
      else if (req.getParameterMap().containsKey(Parameters.WISHLIST.getId())) {
        WishListHandler wlh = new WishListHandler(req);
        v = wlh.getWishListView();
      }
      else if (req.getParameterMap().containsKey(Parameters.VIEW_CART.getId())) {
        CartHandler ch = new CartHandler(req);
        v = ch.getCartView();
      }
      else if (req.getParameterMap().containsKey(Parameters.CART_ID.getId())) {
        CartHandler ch = new CartHandler(req);
        v = ch.getCartView();
      }
      else if (req.getParameterMap().containsKey(Parameters.CHECKOUT.getId())) {
        CartHandler ch = new CartHandler(req);
        v = ch.checkout();
      }
      else if (req.getParameterMap().containsKey(Parameters.CATEGORY_ID.getId())) {
        ProductHandler ph = new ProductHandler(req);
        v = ph.getCategoryView();
      }
      else if (req.getParameterMap().containsKey(Parameters.ORDER_ID.getId())) {
        OrderHandler oh = new OrderHandler(req);
        v = oh.getOrderDetailsView();
      }
      else if (req.getParameterMap().containsKey(Parameters.ALL_ORDERS.getId())) {
        OrderHandler oh = new OrderHandler(req);
        v = oh.getCustomerOrders();
      }
      else if (req.getParameterMap().containsKey(Parameters.OPEN_ORDERS.getId())) {
        OrderHandler oh = new OrderHandler(req);
        v = oh.getCustomerOrders();
      }
      else if (req.getParameterMap().containsKey(Parameters.PRODUCT.getId())) {
        ProductHandler ph = new ProductHandler(req);
        v = ph.getProductView();
      }
      else if (req.getParameterMap().containsKey(Parameters.ALL_PRODUCTS.getId())) {
        ProductHandler ph = new ProductHandler(req);
        v = ph.getAllView(false);
      }
      else if (req.getParameterMap().containsKey(Parameters.FEEDBACK.getId())) {
        ServiceCaseHandler ch = new ServiceCaseHandler(req);
        v = ch.getFeedbackView();
      }
      else if (req.getParameterMap().containsKey("error")) {
        throw new Exception("Error Test");
      }
      else {
        ProductHandler ph = new ProductHandler(req);
        v = ph.getHomePageView();
      }
     
      if (v != null) {
        if (v.getVisitor() != null) {
          l.info("visitor:"+v.getVisitor().toString());
        }
        else {
          l.info("null visitor");
        }

        l.info(v.toString());
      }
      else {
        v = new View();
        l.warning("null view:");
      }

      v.setServletPath("store");
      req.setAttribute(REQUEST_ATTRIBUTE_VIEW, v);
     
      getServletConfig().getServletContext().getRequestDispatcher(
          JSP_MAIN).forward(req, resp);
View Full Code Here

    l.info("form submission "+req.getSession().getId());
   
    //Debugging
    dumpRequest(req);
   
    View v = null;
   
    try {
     
      //Get the form and process
      FormSubmission results = processFormSubmission(req);
     
      v = results.getResultView();

      v.setServletPath("store");
      req.setAttribute(REQUEST_ATTRIBUTE_VIEW, v);

      l.info(req.getAttribute(REQUEST_ATTRIBUTE_VIEW).toString());

      //Forward to JSP
View Full Code Here

    try {
     
    Visitor vis = (Visitor) req.getSession().getAttribute(SESSION_ATTRIBUTE_VISITOR);
   
    View v = null;   
   
      if (vis != null && vis.isEmployeeAuthenticated()) {
       
        if (req.getParameterMap().containsKey(Parameters.LOGIN.getId())) {
          EmployeeHandler eh = new EmployeeHandler(req);
          v = eh.getLoginView(null);
        }
        if (req.getParameterMap().containsKey(Parameters.LOGOUT.getId())) {
          EmployeeHandler eh = new EmployeeHandler(req);
          v = eh.getLogoutView();
        }
        else if (req.getParameterMap().containsKey(Parameters.ALL_PRODUCTS.getId())) {
          ProductHandler ph = new ProductHandler(req);
          v = ph.getAllView(true);
        }
        else if (req.getParameterMap().containsKey(Parameters.ALL_ORDERS.getId())) {
          OrderHandler oh = new OrderHandler(req);
          v = oh.getAllView(false);
        }
        else if (req.getParameterMap().containsKey(Parameters.EMPLOYEE.getId())) {
          EmployeeHandler eh = new EmployeeHandler(req);
          v = eh.getEmployeeDetailsView();
        }
        else if (req.getParameterMap().containsKey(Parameters.ALL_EMPLOYEES.getId())) {
          EmployeeHandler eh = new EmployeeHandler(req);
          v = eh.getEmployeeListView();
        }
        else if (req.getParameterMap().containsKey(Parameters.ADD_EMPLOYEE.getId())) {
          EmployeeHandler eh = new EmployeeHandler(req);
          v = eh.getAdminAddEmployeeView(null);
        }
        else if (req.getParameterMap().containsKey(Parameters.ORDER_ID.getId())) {
          OrderHandler oh = new OrderHandler(req);
          v = oh.getOrderDetailsView(null,true);
        }
        else if (req.getParameterMap().containsKey(Parameters.PRODUCT.getId())) {
          ProductHandler ph = new ProductHandler(req);
          v = ph.getProductView(true, null);
        }
        else {
          Handler h = new Handler(req);
          v = h.getAdminHomeView();
        }
       
      }
      else {
        Handler h = new Handler(req);
        v = h.getLoginView("Please Login", h.getMainAdminView());
      }

      v.setServletPath("admin");
      req.setAttribute(REQUEST_ATTRIBUTE_VIEW, v);
     
      getServletConfig().getServletContext().getRequestDispatcher(
          JSP_ADMIN_MAIN).forward(req, resp);
     
View Full Code Here

TOP

Related Classes of com.ateam.webstore.ui.views.View

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.