use of net.jforum.entities.AttachmentExtensionGroup in project jforum2 by rafaelsteil.
the class GenericAttachmentDAO method getExtensionGroup.
protected AttachmentExtensionGroup getExtensionGroup(ResultSet rs) throws SQLException {
AttachmentExtensionGroup g = new AttachmentExtensionGroup();
g.setId(rs.getInt("extension_group_id"));
g.setName(rs.getString("name"));
g.setUploadIcon(rs.getString("upload_icon"));
g.setAllow(rs.getInt("allow") == 1);
g.setDownloadMode(rs.getInt("download_mode"));
return g;
}
use of net.jforum.entities.AttachmentExtensionGroup in project jforum2 by rafaelsteil.
the class AttachmentsAction method extensionGroupsSave.
public void extensionGroupsSave() {
AttachmentExtensionGroup g = new AttachmentExtensionGroup();
g.setAllow(this.request.getParameter("allow") != null);
g.setDownloadMode(this.request.getIntParameter("download_mode"));
g.setName(this.request.getParameter("name"));
g.setUploadIcon(this.request.getParameter("upload_icon"));
DataAccessDriver.getInstance().newAttachmentDAO().addExtensionGroup(g);
this.extensionGroups();
}
use of net.jforum.entities.AttachmentExtensionGroup in project jforum2 by rafaelsteil.
the class AttachmentsAction method extensionGroupsUpdate.
public void extensionGroupsUpdate() {
AttachmentDAO am = DataAccessDriver.getInstance().newAttachmentDAO();
// Check if there are records to remove
String[] delete = this.request.getParameterValues("delete");
List deleteList = new ArrayList();
if (delete != null) {
deleteList = Arrays.asList(delete);
am.removeExtensionGroups(delete);
}
// Update
int total = this.request.getIntParameter("total_records");
for (int i = 0; i < total; i++) {
if (deleteList.contains(this.request.getParameter("id_" + i))) {
continue;
}
AttachmentExtensionGroup g = new AttachmentExtensionGroup();
g.setId(this.request.getIntParameter("id_" + i));
g.setAllow(this.request.getParameter("allow_" + i) != null);
g.setDownloadMode(this.request.getIntParameter("download_mode_" + i));
g.setName(this.request.getParameter("name_" + i));
g.setUploadIcon(this.request.getParameter("upload_icon_" + i));
am.updateExtensionGroup(g);
}
this.extensionGroups();
}
Aggregations