Package models

Examples of models.Category


 
  public static void escapedExpr() {
    renderJapid();
  }
  public static void categories() {
    Category a = new Category();
    a.name = "a";
    Category cate1 = new Category();
    cate1.name = "1";
    Category cate2 = new Category();
    cate2.name = "2";
    Category cate11 = new Category();
    cate11.name = "11";
    Category cate12 = new Category();
    cate12.name = "12";
    a.subCategories = new ArrayList<Category>();
    a.subCategories.add(cate1);
    a.subCategories.add(cate2);
    cate1.subCategories = new ArrayList<Category>();
View Full Code Here


*
*/
@AutoPath
public class Application extends JapidController {
  public static void index() {
    models.Category c = new Category();
    c.name = "my catty!!";
    c.subname = "ago";
    renderJapid(c); // use the default index.html in the japidviews/SampleController directory
   
//    renderJapidWith("@index.html"); // use the default index.html in the japidviews/SampleController directory
View Full Code Here

 
  public static void escapedExpr() {
    renderJapid();
  }
  public static void categories() {
    Category a = new Category();
    a.name = "a";
    Category cate1 = new Category();
    cate1.name = "1";
    Category cate2 = new Category();
    cate2.name = "2";
    Category cate11 = new Category();
    cate11.name = "11";
    Category cate12 = new Category();
    cate12.name = "12";
    a.subCategories = new ArrayList<Category>();
    a.subCategories.add(cate1);
    a.subCategories.add(cate2);
    cate1.subCategories = new ArrayList<Category>();
View Full Code Here

             if(servletPath.equals("/categories/show")) {

            page += "_show";

            String[] tokens = request.getRequestURI().split("/");
      Category category = Category.getById(new Integer(tokens[tokens.length - 1]));
            List<Auction> auctions = Auction.getByCatId(new Integer(tokens[tokens.length - 1]));

      request.setAttribute("auctions", auctions);
      request.setAttribute("category", category);
         }
View Full Code Here

    else if(servletPath.equals("/admin/categories/edit")) {
      if(session.getAttribute("admin") != null && session.getAttribute("admin").equals("true")) {
        page += "_edit";

        String[] tokens = request.getRequestURI().split("/");
        Category category = Category.getById(new Integer(tokens[tokens.length - 1]));

        request.setAttribute("category", category);
      }
    }
    else if(servletPath.equals("/admin/categories/delete")) {
View Full Code Here

    PrintWriter p = response.getWriter();

    if(servletPath.equals("/admin/categories/save")) {
      if(session.getAttribute("admin") != null && session.getAttribute("admin").equals("true")) {
        Category category = new Category();

        MultipartRequest multi = new MultipartRequest(request, "/home/buzz/NetBeansProjects/bweb/web/images/");
        category.setName(multi.getParameter("newName"));
        category.setDescription(multi.getParameter("newDesc"));

        File f = multi.getFile("newLogo");
        String fileName = multi.getFilesystemName("newLogo");

        category.setImgPath(fileName);
        category.save();
      }
          }
    else if(servletPath.equals("/admin/categories/update")) {
      if(session.getAttribute("admin") != null && session.getAttribute("admin").equals("true")) {

        Category category = new Category();

        MultipartRequest multi = new MultipartRequest(request, "/home/buzz/NetBeansProjects/bweb/web/images/");
        category.setId(new Integer(multi.getParameter("editId")));
        category.setName(multi.getParameter("editName"));
        category.setDescription(multi.getParameter("editDesc"));

        String fileName = multi.getFilesystemName("editLogo");

        File f = null;

        if(fileName == null || fileName.equals("")) {
          fileName = multi.getParameter("oldLogo");
        }
        else {
          f = multi.getFile("editLogo");
        }

        category.setImgPath(fileName);
        category.update();
      }
    }

    response.sendRedirect(request.getContextPath() + "/admin/categories");
    }
View Full Code Here

                                                  Category.getAll(),
                                                  form));
        }
        else
        {
            Category category = form.get();
            category.save();
            result = redirect(routes.Categories.showCategories());
        }
        return result;
    }
View Full Code Here

        return result;
    }

    public static Result categoryDetails(String name)
    {
        Category category = Category.findByName(name);
        List<Module> modules = Module.findByCategory(category);
        return ok(categoryDetails.render(currentUser(),
                                         category,
                                         modules));
    }
View Full Code Here

        {
            result = badRequest(form.errorsAsJson());
        }
        else
        {
            Category incoming = form.get();
            Category storedCategory = Category.FIND.byId(incoming.id);
            storedCategory.name = incoming.name;
            storedCategory.save();
            result = ok(Json.toJson(storedCategory));
        }
        return result;
    }
View Full Code Here

TOP

Related Classes of models.Category

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.