Search in sources :

Example 1 with BookmarkDAO

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

the class BookmarkAction method edit.

public void edit() {
    int id = this.request.getIntParameter("bookmark_id");
    BookmarkDAO bm = DataAccessDriver.getInstance().newBookmarkDAO();
    Bookmark b = bm.selectById(id);
    if (!this.sanityCheck(b)) {
        return;
    }
    this.setTemplateName(TemplateKeys.BOOKMARKS_EDIT);
    this.context.put("bookmark", b);
}
Also used : BookmarkDAO(net.jforum.dao.BookmarkDAO) Bookmark(net.jforum.entities.Bookmark)

Example 2 with BookmarkDAO

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

the class BookmarkAction method delete.

public void delete() {
    int id = this.request.getIntParameter("bookmark_id");
    BookmarkDAO bm = DataAccessDriver.getInstance().newBookmarkDAO();
    Bookmark b = bm.selectById(id);
    if (!this.sanityCheck(b)) {
        return;
    }
    bm.remove(id);
    JForumExecutionContext.setRedirect(this.request.getContextPath() + "/bookmarks/list/" + b.getUserId() + SystemGlobals.getValue(ConfigKeys.SERVLET_EXTENSION));
}
Also used : BookmarkDAO(net.jforum.dao.BookmarkDAO) Bookmark(net.jforum.entities.Bookmark)

Example 3 with BookmarkDAO

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

the class BookmarkAction method updateSave.

public void updateSave() {
    int id = this.request.getIntParameter("bookmark_id");
    BookmarkDAO bm = DataAccessDriver.getInstance().newBookmarkDAO();
    Bookmark b = bm.selectById(id);
    if (!this.sanityCheck(b)) {
        return;
    }
    b.setTitle(this.request.getParameter("title"));
    b.setDescription(this.request.getParameter("description"));
    String visible = this.request.getParameter("visible");
    b.setPublicVisible(StringUtils.isNotBlank(visible));
    bm.update(b);
    this.setTemplateName(TemplateKeys.BOOKMARKS_UPDATE_SAVE);
}
Also used : BookmarkDAO(net.jforum.dao.BookmarkDAO) Bookmark(net.jforum.entities.Bookmark)

Aggregations

BookmarkDAO (net.jforum.dao.BookmarkDAO)3 Bookmark (net.jforum.entities.Bookmark)3