Search in sources :

Example 1 with CategoryDAO

use of net.jforum.dao.CategoryDAO in project jforum2 by rafaelsteil.

the class ForumAction method insert.

// One more, one more
public void insert() {
    CategoryDAO cm = DataAccessDriver.getInstance().newCategoryDAO();
    this.context.put("groups", new TreeGroup().getNodes());
    this.context.put("selectedList", new ArrayList());
    this.setTemplateName(TemplateKeys.FORUM_ADMIN_INSERT);
    this.context.put("categories", cm.selectAll());
    this.context.put("action", "insertSave");
}
Also used : CategoryDAO(net.jforum.dao.CategoryDAO) TreeGroup(net.jforum.util.TreeGroup) ArrayList(java.util.ArrayList)

Example 2 with CategoryDAO

use of net.jforum.dao.CategoryDAO in project jforum2 by rafaelsteil.

the class ForumStartup method startForumRepository.

/**
	 * Starts the cache control for forums and categories.
	 * @throws RepositoryStartupException is something were wrong.
	 */
public static void startForumRepository() {
    try {
        ForumDAO fm = DataAccessDriver.getInstance().newForumDAO();
        CategoryDAO cm = DataAccessDriver.getInstance().newCategoryDAO();
        ConfigDAO configModel = DataAccessDriver.getInstance().newConfigDAO();
        ForumRepository.start(fm, cm, configModel);
    } catch (Exception e) {
        log.error("Unable to bootstrap JForum repository.", e);
        throw new RepositoryStartupException("Error while trying to start ForumRepository: " + e, e);
    }
}
Also used : ForumDAO(net.jforum.dao.ForumDAO) CategoryDAO(net.jforum.dao.CategoryDAO) ConfigDAO(net.jforum.dao.ConfigDAO) DatabaseException(net.jforum.exceptions.DatabaseException) RepositoryStartupException(net.jforum.exceptions.RepositoryStartupException) RepositoryStartupException(net.jforum.exceptions.RepositoryStartupException)

Example 3 with CategoryDAO

use of net.jforum.dao.CategoryDAO in project jforum2 by rafaelsteil.

the class ForumAction method edit.

// Edit
public void edit() {
    int forumId = this.request.getIntParameter("forum_id");
    ForumDAO forumDao = DataAccessDriver.getInstance().newForumDAO();
    CategoryDAO cm = DataAccessDriver.getInstance().newCategoryDAO();
    this.setTemplateName(TemplateKeys.FORUM_ADMIN_EDIT);
    this.context.put("categories", cm.selectAll());
    this.context.put("action", "editSave");
    this.context.put("forum", forumDao.selectById(forumId));
// Mail Integration
// MailIntegrationDAO integrationDao = DataAccessDriver.getInstance().newMailIntegrationDAO();
// this.context.put("mailIntegration", integrationDao.find(forumId));
}
Also used : ForumDAO(net.jforum.dao.ForumDAO) CategoryDAO(net.jforum.dao.CategoryDAO)

Aggregations

CategoryDAO (net.jforum.dao.CategoryDAO)3 ForumDAO (net.jforum.dao.ForumDAO)2 ArrayList (java.util.ArrayList)1 ConfigDAO (net.jforum.dao.ConfigDAO)1 DatabaseException (net.jforum.exceptions.DatabaseException)1 RepositoryStartupException (net.jforum.exceptions.RepositoryStartupException)1 TreeGroup (net.jforum.util.TreeGroup)1