Package org.mapache.business.category

Examples of org.mapache.business.category.Category


        while(resultSet.next()){
            categories.add(fetchRecordInCategoryObject(resultSet));
        }
    }
    private Category fetchRecordInCategoryObject(ResultSet record) throws SQLException {
        Category c = new Category();
        c.setCategoryID(record.getInt("CategoryID"));
        c.setName(record.getString("Name"));
        try{
            c.setTopicCount(record.getInt("TopicCount"));
        }catch(SQLException e){
            c.setTopicCount(-1);
        }
        return c;
    }
View Full Code Here


        }
        return categories;
    }
   
    public Category loadCategoryByCategoryId(int id) throws MapacheException {
        Category c = null;
        try {
            _oConn = MySQLDAOFactory.createConnection();
           _loadCategoryByCategoryIdStmt =
                    _oConn.prepareStatement("SELECT CategoryID,Name FROM Category WHERE CategoryID = ?");
            _loadCategoryByCategoryIdStmt.setInt(1, id);
View Full Code Here

        }
        return categories;
    }
   
    public Category loadCategoryByCategoryName_visitor(String name) throws MapacheException {
        Category c = null;
        try {
            _oConn = MySQLDAOFactory.createConnection();
           _loadCategoryByCategoryIdStmt =
                    _oConn.prepareStatement("SELECT CategoryID,Name FROM Category WHERE Name = ?");
            _loadCategoryByCategoryIdStmt.setString(1, name);
View Full Code Here

        return _categories;
    }

    private Category getCategory() {
        String name = (String)FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("category");
        Category c = null;
        if(name !=null && name.length()>0){
            try {
                c = getBlogController().loadCategoryByCategoryName(name.replaceAll("_"," "));
            } catch (MapacheException e) {
                // TODO
View Full Code Here

        List<Category> categories;
        try {
            categories = getBusinessController().loadAllCategories();
          
            for (Iterator it = categories.iterator(); it.hasNext(); ){
                Category c = (Category)it.next();
                categorySelectItems.add(new SelectItem(c,c.getName(),String.valueOf(c.getCategoryID())));
            }
        } catch (MapacheException e) {
             // TODO log error message into file
             e.printStackTrace();
        }
View Full Code Here

         }
         return "deleteClicked";
    }

    public String createTopic() {
         Category newCategory = new Category();
         newCategory.setName(_name);
         try {
             getBusinessController().createCategory(newCategory);
             FacesContext.getCurrentInstance().addMessage(null,new FacesMessage(FacesMessage.SEVERITY_INFO,MapacheUIUtils.getTranslation("info_category_created",null),MapacheUIUtils.getTranslation("info_category_created",null)));
             _createMode = false;
         } catch (MapacheException e) {
View Full Code Here

TOP

Related Classes of org.mapache.business.category.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.