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);
}
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));
}
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);
}
Aggregations