rem stringlengths 0 477k | add stringlengths 0 313k | context stringlengths 6 599k |
|---|---|---|
IDocument document = mExplorer.getDocument(); | IDocument document = mExpressionNavigator.getDocument(); | protected boolean selectSpaces(int caretPos) { try { IDocument document = mExplorer.getDocument(); int length = document.getLength(); if (caretPos > 0 && caretPos < length) { char chAfter = document.getChar(caretPos); char chBefore = document.get... |
try { ITypedRegion partition = mExplorer.getDocument().getPartition(caretPos); if (SchemePartitionScanner.isStringPartition(partition.getType())) { selectRange(partition.getOffset(), partition.getOffset() + partition.getLength()); return true; } } catch (BadLocationException exception) { } | ITypedRegion partition = SchemeTextUtilities.getPartition(mExpressionNavigator.getDocument(), caretPos); if (SchemePartitionScanner.isStringPartition(partition.getType())) { selectRange(partition.getOffset(), partition.getOffset() + partition.getLength()); return true; } | protected boolean selectString(int caretPos) { try { ITypedRegion partition = mExplorer.getDocument().getPartition(caretPos); if (SchemePartitionScanner.isStringPartition(partition.getType())) { selectRange(partition.getOffset(), partition.getOffset() + partition.getLengt... |
public int addNew(Forum forum) throws Exception { | public int addNew(Forum forum) { | public int addNew(Forum forum) throws Exception { // Gets the higher order PreparedStatement pOrder = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.getMaxOrder")); ResultSet rs = pOrder.executeQuery(); if (rs.next()) { forum.setOrder(rs.getInt(1) + 1); } rs.close(); ... |
PreparedStatement pOrder = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.getMaxOrder")); ResultSet rs = pOrder.executeQuery(); | PreparedStatement pOrder=null; ResultSet rs=null; try { pOrder = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.getMaxOrder")); rs = pOrder.executeQuery(); | public int addNew(Forum forum) throws Exception { // Gets the higher order PreparedStatement pOrder = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.getMaxOrder")); ResultSet rs = pOrder.executeQuery(); if (rs.next()) { forum.setOrder(rs.getInt(1) + 1); } rs.close(); ... |
rs.close(); pOrder.close(); | rs.close(); rs=null; pOrder.close(); pOrder=null; | public int addNew(Forum forum) throws Exception { // Gets the higher order PreparedStatement pOrder = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.getMaxOrder")); ResultSet rs = pOrder.executeQuery(); if (rs.next()) { forum.setOrder(rs.getInt(1) + 1); } rs.close(); ... |
PreparedStatement p = this.getStatementForAutoKeys("ForumModel.addNew"); | pOrder = this.getStatementForAutoKeys("ForumModel.addNew"); | public int addNew(Forum forum) throws Exception { // Gets the higher order PreparedStatement pOrder = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.getMaxOrder")); ResultSet rs = pOrder.executeQuery(); if (rs.next()) { forum.setOrder(rs.getInt(1) + 1); } rs.close(); ... |
p.setInt(1, forum.getCategoryId()); p.setString(2, forum.getName()); p.setString(3, forum.getDescription()); p.setInt(4, forum.getOrder()); p.setInt(5, forum.isModerated() ? 1 : 0); | pOrder.setInt(1, forum.getCategoryId()); pOrder.setString(2, forum.getName()); pOrder.setString(3, forum.getDescription()); pOrder.setInt(4, forum.getOrder()); pOrder.setInt(5, forum.isModerated() ? 1 : 0); | public int addNew(Forum forum) throws Exception { // Gets the higher order PreparedStatement pOrder = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.getMaxOrder")); ResultSet rs = pOrder.executeQuery(); if (rs.next()) { forum.setOrder(rs.getInt(1) + 1); } rs.close(); ... |
this.setAutoGeneratedKeysQuery(SystemGlobals.getSql("ForumModel.lastGeneratedForumId")); int forumId = this.executeAutoKeysQuery(p); | this.setAutoGeneratedKeysQuery(SystemGlobals.getSql("ForumModel.lastGeneratedForumId")); int forumId = this.executeAutoKeysQuery(pOrder); | public int addNew(Forum forum) throws Exception { // Gets the higher order PreparedStatement pOrder = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.getMaxOrder")); ResultSet rs = pOrder.executeQuery(); if (rs.next()) { forum.setOrder(rs.getInt(1) + 1); } rs.close(); ... |
p.close(); forum.setId(forumId); return forumId; } | forum.setId(forumId); return forumId; } catch (SQLException e) { String es = "Erorr addNew()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUtils.close(rs, pOrder); } } | public int addNew(Forum forum) throws Exception { // Gets the higher order PreparedStatement pOrder = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.getMaxOrder")); ResultSet rs = pOrder.executeQuery(); if (rs.next()) { forum.setOrder(rs.getInt(1) + 1); } rs.close(); ... |
private Forum changeForumOrder(Forum forum, Forum related, boolean up) throws Exception | private Forum changeForumOrder(Forum forum, Forum related, boolean up) | private Forum changeForumOrder(Forum forum, Forum related, boolean up) throws Exception { int tmpOrder = related.getOrder(); related.setOrder(forum.getOrder()); forum.setOrder(tmpOrder); // ******** PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.set... |
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.setOrderById")); p.setInt(1, forum.getOrder()); p.setInt(2, forum.getId()); p.executeUpdate(); p.close(); p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.setOrder... | PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.setOrderById")); p.setInt(1, forum.getOrder()); p.setInt(2, forum.getId()); p.executeUpdate(); p.close(); p=null; p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSq... | private Forum changeForumOrder(Forum forum, Forum related, boolean up) throws Exception { int tmpOrder = related.getOrder(); related.setOrder(forum.getOrder()); forum.setOrder(tmpOrder); // ******** PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.set... |
public List checkUnreadTopics(int forumId, long lastVisit) throws Exception | public List checkUnreadTopics(int forumId, long lastVisit) | public List checkUnreadTopics(int forumId, long lastVisit) throws Exception { List l = new ArrayList(); PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.checkUnreadTopics")); p.setInt(1, forumId); p.setTimestamp(2, new Timestamp(lastVisit)); Result... |
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.checkUnreadTopics")); p.setInt(1, forumId); p.setTimestamp(2, new Timestamp(lastVisit)); ResultSet rs = p.executeQuery(); while (rs.next()) { Topic t = new Topic(); t.setId(rs.getInt("topic_id")); t.setTime(n... | PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.checkUnreadTopics")); p.setInt(1, forumId); p.setTimestamp(2, new Timestamp(lastVisit)); rs = p.executeQuery(); while (rs.next()) { Topic t = new Topic(); t.setId(rs.getInt("t... | public List checkUnreadTopics(int forumId, long lastVisit) throws Exception { List l = new ArrayList(); PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.checkUnreadTopics")); p.setInt(1, forumId); p.setTimestamp(2, new Timestamp(lastVisit)); Result... |
protected int countForumPosts(int forumId) throws Exception | protected int countForumPosts(int forumId) | protected int countForumPosts(int forumId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("ForumModel.countForumPosts")); p.setInt(1, forumId); ResultSet rs = p.executeQuery(); rs.next(); int total = rs.getInt(1); rs.close(); p.close(); ... |
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("ForumModel.countForumPosts")); p.setInt(1, forumId); ResultSet rs = p.executeQuery(); rs.next(); | PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("ForumModel.countForumPosts")); p.setInt(1, forumId); rs = p.executeQuery(); rs.next(); | protected int countForumPosts(int forumId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("ForumModel.countForumPosts")); p.setInt(1, forumId); ResultSet rs = p.executeQuery(); rs.next(); int total = rs.getInt(1); rs.close(); p.close(); ... |
int total = rs.getInt(1); rs.close(); p.close(); return total; } | if (rs.next()) { return rs.getInt(1); } return 0; } catch (SQLException e) { String es = "Erorr countForumPosts()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUtils.close(rs, p); } } | protected int countForumPosts(int forumId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("ForumModel.countForumPosts")); p.setInt(1, forumId); ResultSet rs = p.executeQuery(); rs.next(); int total = rs.getInt(1); rs.close(); p.close(); ... |
public void decrementTotalTopics(int forumId, int count) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.decrementTotalTopics")); p.setInt(1, count); p.setInt(2, forumId); p.executeUpdate(); p.close(); | public void decrementTotalTopics(int forumId, int count) { PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.decrementTotalTopics")); p.setInt(1, count); p.setInt(2, forumId); p.executeUpdate(); | public void decrementTotalTopics(int forumId, int count) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.decrementTotalTopics")); p.setInt(1, count); p.setInt(2, forumId); p.executeUpdate(); p.close(); // If there are no more topic... |
int totalTopics = this.getTotalTopics(forumId); if (totalTopics < 1) { this.setLastPost(forumId, 0); } } | int totalTopics = this.getTotalTopics(forumId); if (totalTopics < 1) { this.setLastPost(forumId, 0); } } catch (SQLException e) { String es = "Erorr selectActiveBannerByPlacement()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUtils.close(p); } } | public void decrementTotalTopics(int forumId, int count) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.decrementTotalTopics")); p.setInt(1, count); p.setInt(2, forumId); p.executeUpdate(); p.close(); // If there are no more topic... |
public void delete(int forumId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.delete")); p.setInt(1, forumId); | public void delete(int forumId) { PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.delete")); p.setInt(1, forumId); | public void delete(int forumId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.delete")); p.setInt(1, forumId); p.executeUpdate(); p.close(); } |
p.executeUpdate(); p.close(); } | p.executeUpdate(); } catch (SQLException e) { String es = "Erorr delete()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUtils.close(p); } } | public void delete(int forumId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.delete")); p.setInt(1, forumId); p.executeUpdate(); p.close(); } |
protected Forum fillForum(ResultSet rs) throws Exception { | protected Forum fillForum(ResultSet rs) throws SQLException { | protected Forum fillForum(ResultSet rs) throws Exception { Forum f = new Forum(); f.setId(rs.getInt("forum_id")); f.setIdCategories(rs.getInt("categories_id")); f.setName(rs.getString("forum_name")); f.setDescription(rs.getString("forum_desc")); f.setOrder(rs.getInt("forum_order")); f.setTotalTopics(rs.getInt("... |
public ForumStats getBoardStatus() throws Exception | public ForumStats getBoardStatus() | public ForumStats getBoardStatus() throws Exception { ForumStats fs = new ForumStats(); fs.setPosts(this.getTotalMessages()); Connection c = JForumExecutionContext.getConnection(); // Total Users Statement s = c.createStatement(); ResultSet rs = s.executeQuery(SystemGlobals.getSql("UserModel.totalUsers")); rs... |
Statement s = c.createStatement(); ResultSet rs = s.executeQuery(SystemGlobals.getSql("UserModel.totalUsers")); rs.next(); fs.setUsers(rs.getInt(1)); rs.close(); s.close(); s = c.createStatement(); rs = s.executeQuery(SystemGlobals.getSql("TopicModel.totalTopics")); rs.next(); fs.setTopics(rs.getInt(1)); rs.close(); ... | Statement s=null; ResultSet rs=null; try { s = c.createStatement(); rs = s.executeQuery(SystemGlobals.getSql("UserModel.totalUsers")); rs.next(); fs.setUsers(rs.getInt(1)); rs.close(); rs=null; s.close(); s=null; s = c.createStatement(); rs = s.executeQuery(SystemGlobals.getSql("TopicModel.totalTopics")); rs.next();... | public ForumStats getBoardStatus() throws Exception { ForumStats fs = new ForumStats(); fs.setPosts(this.getTotalMessages()); Connection c = JForumExecutionContext.getConnection(); // Total Users Statement s = c.createStatement(); ResultSet rs = s.executeQuery(SystemGlobals.getSql("UserModel.totalUsers")); rs... |
private LastPostInfo getLastPostInfo(int forumId, boolean tryFix) throws Exception | private LastPostInfo getLastPostInfo(int forumId, boolean tryFix) | private LastPostInfo getLastPostInfo(int forumId, boolean tryFix) throws Exception { LastPostInfo lpi = new LastPostInfo(); PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.lastPostInfo")); p.setInt(1, forumId); ResultSet rs = p.executeQuery(); if (rs.... |
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.lastPostInfo")); p.setInt(1, forumId); | PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.lastPostInfo")); p.setInt(1, forumId); | private LastPostInfo getLastPostInfo(int forumId, boolean tryFix) throws Exception { LastPostInfo lpi = new LastPostInfo(); PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.lastPostInfo")); p.setInt(1, forumId); ResultSet rs = p.executeQuery(); if (rs.... |
ResultSet rs = p.executeQuery(); | rs = p.executeQuery(); | private LastPostInfo getLastPostInfo(int forumId, boolean tryFix) throws Exception { LastPostInfo lpi = new LastPostInfo(); PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.lastPostInfo")); p.setInt(1, forumId); ResultSet rs = p.executeQuery(); if (rs.... |
lpi.setHasInfo(true); TopicDAO tm = DataAccessDriver.getInstance().newTopicDAO(); Topic t = tm.selectById(lpi.getTopicId()); if (t.getId() == 0) { tm.fixFirstLastPostId(lpi.getTopicId()); } tryFix = false; } else if (tryFix) { rs.close(); p.close(); int postId = this.getMaxPostId(forumId); p = JForumExecutionCon... | lpi.setHasInfo(true); | private LastPostInfo getLastPostInfo(int forumId, boolean tryFix) throws Exception { LastPostInfo lpi = new LastPostInfo(); PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.lastPostInfo")); p.setInt(1, forumId); ResultSet rs = p.executeQuery(); if (rs.... |
rs.close(); p.close(); return (tryFix ? this.getLastPostInfo(forumId, false) : lpi); } | TopicDAO tm = DataAccessDriver.getInstance().newTopicDAO(); Topic t = tm.selectById(lpi.getTopicId()); if (t.getId() == 0) { tm.fixFirstLastPostId(lpi.getTopicId()); } tryFix = false; } else if (tryFix) { rs.close(); rs=null; p.close(); p=null; int postId = this.getMaxPostId(forumId); p = JForumExecutionContext.ge... | private LastPostInfo getLastPostInfo(int forumId, boolean tryFix) throws Exception { LastPostInfo lpi = new LastPostInfo(); PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.lastPostInfo")); p.setInt(1, forumId); ResultSet rs = p.executeQuery(); if (rs.... |
public int getMaxPostId(int forumId) throws Exception { | public int getMaxPostId(int forumId) { | public int getMaxPostId(int forumId) throws Exception { int id = -1; PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.getMaxPostId")); p.setInt(1, forumId); ResultSet rs = p.executeQuery(); if (rs.next()) { id = rs.getInt("post_id"); } rs.close(); ... |
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.getMaxPostId")); p.setInt(1, forumId); | PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.getMaxPostId")); p.setInt(1, forumId); | public int getMaxPostId(int forumId) throws Exception { int id = -1; PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.getMaxPostId")); p.setInt(1, forumId); ResultSet rs = p.executeQuery(); if (rs.next()) { id = rs.getInt("post_id"); } rs.close(); ... |
ResultSet rs = p.executeQuery(); if (rs.next()) { id = rs.getInt("post_id"); } | rs = p.executeQuery(); if (rs.next()) { id = rs.getInt("post_id"); } | public int getMaxPostId(int forumId) throws Exception { int id = -1; PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.getMaxPostId")); p.setInt(1, forumId); ResultSet rs = p.executeQuery(); if (rs.next()) { id = rs.getInt("post_id"); } rs.close(); ... |
rs.close(); p.close(); return id; } | return id; } catch (SQLException e) { String es = "Erorr getMaxPostId()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUtils.close(rs, p); } } | public int getMaxPostId(int forumId) throws Exception { int id = -1; PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.getMaxPostId")); p.setInt(1, forumId); ResultSet rs = p.executeQuery(); if (rs.next()) { id = rs.getInt("post_id"); } rs.close(); ... |
public List getModeratorList(int forumId) throws Exception | public List getModeratorList(int forumId) | public List getModeratorList(int forumId) throws Exception { List l = new ArrayList(); PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("ForumModel.getModeratorList")); p.setInt(1, forumId); ResultSet rs = p.executeQuery(); while (rs.next()) { ModeratorInf... |
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("ForumModel.getModeratorList")); p.setInt(1, forumId); | PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("ForumModel.getModeratorList")); p.setInt(1, forumId); | public List getModeratorList(int forumId) throws Exception { List l = new ArrayList(); PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("ForumModel.getModeratorList")); p.setInt(1, forumId); ResultSet rs = p.executeQuery(); while (rs.next()) { ModeratorInf... |
ResultSet rs = p.executeQuery(); while (rs.next()) { ModeratorInfo mi = new ModeratorInfo(); mi.setId(rs.getInt("id")); mi.setName(rs.getString("name")); l.add(mi); } rs.close(); p.close(); return l; } | rs = p.executeQuery(); while (rs.next()) { ModeratorInfo mi = new ModeratorInfo(); mi.setId(rs.getInt("id")); mi.setName(rs.getString("name")); l.add(mi); } return l; } catch (SQLException e) { String es = "Erorr getModeratorList()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUtils.close(rs,... | public List getModeratorList(int forumId) throws Exception { List l = new ArrayList(); PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("ForumModel.getModeratorList")); p.setInt(1, forumId); ResultSet rs = p.executeQuery(); while (rs.next()) { ModeratorInf... |
public int getTotalMessages() throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("ForumModel.totalMessages")); ResultSet rs = p.executeQuery(); rs.next(); | public int getTotalMessages() { PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("ForumModel.totalMessages")); rs = p.executeQuery(); rs.next(); | public int getTotalMessages() throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("ForumModel.totalMessages")); ResultSet rs = p.executeQuery(); rs.next(); int total = rs.getInt("total_messages"); rs.close(); p.close(); return total; } |
int total = rs.getInt("total_messages"); rs.close(); p.close(); | if (rs.next()) { return rs.getInt("total_messages"); } | public int getTotalMessages() throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("ForumModel.totalMessages")); ResultSet rs = p.executeQuery(); rs.next(); int total = rs.getInt("total_messages"); rs.close(); p.close(); return total; } |
return total; } | return 0; } catch (SQLException e) { String es = "Erorr getTotalMessages()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUtils.close(rs, p); } } | public int getTotalMessages() throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("ForumModel.totalMessages")); ResultSet rs = p.executeQuery(); rs.next(); int total = rs.getInt("total_messages"); rs.close(); p.close(); return total; } |
public int getTotalTopics(int forumId) throws Exception { | public int getTotalTopics(int forumId) { | public int getTotalTopics(int forumId) throws Exception { int total = 0; PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.getTotalTopics")); p.setInt(1, forumId); ResultSet rs = p.executeQuery(); if (rs.next()) { total = rs.getInt(1); } rs.close();... |
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.getTotalTopics")); p.setInt(1, forumId); ResultSet rs = p.executeQuery(); | PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.getTotalTopics")); p.setInt(1, forumId); rs = p.executeQuery(); | public int getTotalTopics(int forumId) throws Exception { int total = 0; PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.getTotalTopics")); p.setInt(1, forumId); ResultSet rs = p.executeQuery(); if (rs.next()) { total = rs.getInt(1); } rs.close();... |
rs.close(); p.close(); return total; } | return total; } catch (SQLException e) { String es = "Erorr getTotalTopics()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUtils.close(rs, p); } } | public int getTotalTopics(int forumId) throws Exception { int total = 0; PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.getTotalTopics")); p.setInt(1, forumId); ResultSet rs = p.executeQuery(); if (rs.next()) { total = rs.getInt(1); } rs.close();... |
public void incrementTotalTopics(int forumId, int count) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.incrementTotalTopics")); p.setInt(1, count); p.setInt(2, forumId); p.executeUpdate(); p.close(); | public void incrementTotalTopics(int forumId, int count) { PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.incrementTotalTopics")); p.setInt(1, count); p.setInt(2, forumId); p.executeUpdate(); } catch (SQLException e) { String es = "Erorr incr... | public void incrementTotalTopics(int forumId, int count) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.incrementTotalTopics")); p.setInt(1, count); p.setInt(2, forumId); p.executeUpdate(); p.close(); } |
public boolean isUserSubscribed(int forumId, int userId) throws Exception { PreparedStatement stmt = JForumExecutionContext.getConnection(). prepareStatement( SystemGlobals.getSql("ForumModel.isUserSubscribed")); ResultSet rs = null; stmt.setInt(1, forumId); stmt.setInt(2, userId); rs = stmt.executeQuery(); boolean s... | public boolean isUserSubscribed(int forumId, int userId) { PreparedStatement stmt=null; ResultSet rs = null; try { stmt = JForumExecutionContext.getConnection(). prepareStatement( SystemGlobals.getSql("ForumModel.isUserSubscribed")); stmt.setInt(1, forumId); stmt.setInt(2, userId); rs = stmt.executeQuery(); return r... | public boolean isUserSubscribed(int forumId, int userId) throws Exception { PreparedStatement stmt = JForumExecutionContext.getConnection(). prepareStatement( SystemGlobals.getSql("ForumModel.isUserSubscribed")); ResultSet rs = null; stmt.setInt(1, forumId); stmt.setInt(2, userId); rs = stmt.executeQuery(); ... |
public void moveTopics(String[] topics, int fromForumId, int toForumId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.moveTopics")); PreparedStatement t = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("Pos... | public void moveTopics(String[] topics, int fromForumId, int toForumId) { PreparedStatement p=null; PreparedStatement t=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.moveTopics")); t = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql... | public void moveTopics(String[] topics, int fromForumId, int toForumId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.moveTopics")); PreparedStatement t = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("... |
for (int i = 0; i < topics.length; i++) { int topicId = Integer.parseInt(topics[i]); p.setInt(2, topicId); t.setInt(2, topicId); p.executeUpdate(); t.executeUpdate(); tdao.setModerationStatusByTopic(topicId, f.isModerated()); } | p.setInt(1, toForumId); t.setInt(1, toForumId); | public void moveTopics(String[] topics, int fromForumId, int toForumId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.moveTopics")); PreparedStatement t = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("... |
this.decrementTotalTopics(fromForumId, topics.length); this.incrementTotalTopics(toForumId, topics.length); this.setLastPost(fromForumId, this.getMaxPostId(fromForumId)); this.setLastPost(toForumId, this.getMaxPostId(toForumId)); | TopicDAO tdao = DataAccessDriver.getInstance().newTopicDAO(); | public void moveTopics(String[] topics, int fromForumId, int toForumId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.moveTopics")); PreparedStatement t = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("... |
p.close(); } | Forum f = this.selectById(toForumId); for (int i = 0; i < topics.length; i++) { int topicId = Integer.parseInt(topics[i]); p.setInt(2, topicId); t.setInt(2, topicId); p.executeUpdate(); t.executeUpdate(); tdao.setModerationStatusByTopic(topicId, f.isModerated()); } this.decrementTotalTopics(fromForumId, topics.leng... | public void moveTopics(String[] topics, int fromForumId, int toForumId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.moveTopics")); PreparedStatement t = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("... |
public List notifyUsers(Forum forum) throws Exception { | public List notifyUsers(Forum forum) { | public List notifyUsers(Forum forum) throws Exception { int posterId = SessionFacade.getUserSession().getUserId(); int anonUser = SystemGlobals.getIntValue(ConfigKeys.ANONYMOUS_USER_ID); PreparedStatement stmt = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.notifyUsers")... |
PreparedStatement stmt = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.notifyUsers")); ResultSet rs = null; | PreparedStatement stmt=null; ResultSet rs = null; try { stmt = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.notifyUsers")); | public List notifyUsers(Forum forum) throws Exception { int posterId = SessionFacade.getUserSession().getUserId(); int anonUser = SystemGlobals.getIntValue(ConfigKeys.ANONYMOUS_USER_ID); PreparedStatement stmt = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.notifyUsers")... |
stmt.setInt(1, forum.getId()); stmt.setInt(2, posterId); stmt.setInt(3, anonUser); rs = stmt.executeQuery(); List users = new ArrayList(); while(rs.next()) { User user = new User(); | stmt.setInt(1, forum.getId()); stmt.setInt(2, posterId); stmt.setInt(3, anonUser); | public List notifyUsers(Forum forum) throws Exception { int posterId = SessionFacade.getUserSession().getUserId(); int anonUser = SystemGlobals.getIntValue(ConfigKeys.ANONYMOUS_USER_ID); PreparedStatement stmt = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.notifyUsers")... |
user.setId(rs.getInt("user_id")); user.setEmail(rs.getString("user_email")); user.setUsername(rs.getString("username")); user.setLang(rs.getString("user_lang")); users.add(user); } | rs = stmt.executeQuery(); List users = new ArrayList(); while(rs.next()) { User user = new User(); user.setId(rs.getInt("user_id")); user.setEmail(rs.getString("user_email")); user.setUsername(rs.getString("username")); user.setLang(rs.getString("user_lang")); users.add(user); } | public List notifyUsers(Forum forum) throws Exception { int posterId = SessionFacade.getUserSession().getUserId(); int anonUser = SystemGlobals.getIntValue(ConfigKeys.ANONYMOUS_USER_ID); PreparedStatement stmt = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.notifyUsers")... |
rs.close(); stmt.close(); return users; | return users; } catch (SQLException e) { String es = "Erorr notifyUsers()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUtils.close(rs, stmt); } | public List notifyUsers(Forum forum) throws Exception { int posterId = SessionFacade.getUserSession().getUserId(); int anonUser = SystemGlobals.getIntValue(ConfigKeys.ANONYMOUS_USER_ID); PreparedStatement stmt = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.notifyUsers")... |
public void removeSubscription(int forumId, int userId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.removeSubscription")); p.setInt(1, forumId); p.setInt(2, userId); p.executeUpdate(); p.close(); | public void removeSubscription(int forumId, int userId) { PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.removeSubscription")); p.setInt(1, forumId); p.setInt(2, userId); p.executeUpdate(); } catch (SQLException e) { String es = "Erorr remov... | public void removeSubscription(int forumId, int userId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.removeSubscription")); p.setInt(1, forumId); p.setInt(2, userId); p.executeUpdate(); p.close(); } |
public void removeSubscriptionByForum(int forumId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.removeSubscriptionByForum")); p.setInt(1, forumId); p.executeUpdate(); p.close(); | public void removeSubscriptionByForum(int forumId) { PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.removeSubscriptionByForum")); p.setInt(1, forumId); p.executeUpdate(); } catch (SQLException e) { String es = "Erorr removeSubscriptionByForu... | public void removeSubscriptionByForum(int forumId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.removeSubscriptionByForum")); p.setInt(1, forumId); p.executeUpdate(); p.close(); } |
public List selectAll() throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.selectAll")); List l = new ArrayList(); | public List selectAll() { PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.selectAll")); List l = new ArrayList(); | public List selectAll() throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.selectAll")); List l = new ArrayList(); ResultSet rs = p.executeQuery(); while (rs.next()) { l.add(this.fillForum(rs)); } rs.close(); p.close(); return l; ... |
ResultSet rs = p.executeQuery(); | rs = p.executeQuery(); | public List selectAll() throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.selectAll")); List l = new ArrayList(); ResultSet rs = p.executeQuery(); while (rs.next()) { l.add(this.fillForum(rs)); } rs.close(); p.close(); return l; ... |
rs.close(); p.close(); return l; } | return l; } catch (SQLException e) { String es = "Erorr selectAll()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUtils.close(rs, p); } } | public List selectAll() throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.selectAll")); List l = new ArrayList(); ResultSet rs = p.executeQuery(); while (rs.next()) { l.add(this.fillForum(rs)); } rs.close(); p.close(); return l; ... |
public Forum selectById(int forumId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.selectById")); p.setInt(1, forumId); | public Forum selectById(int forumId) { PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.selectById")); p.setInt(1, forumId); | public Forum selectById(int forumId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.selectById")); p.setInt(1, forumId); ResultSet rs = p.executeQuery(); Forum f = new Forum(); if (rs.next()) { f = this.fillForum(rs); } rs.clos... |
ResultSet rs = p.executeQuery(); | rs = p.executeQuery(); | public Forum selectById(int forumId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.selectById")); p.setInt(1, forumId); ResultSet rs = p.executeQuery(); Forum f = new Forum(); if (rs.next()) { f = this.fillForum(rs); } rs.clos... |
if (rs.next()) { f = this.fillForum(rs); } rs.close(); p.close(); return f; } | if (rs.next()) { f = this.fillForum(rs); } return f; } catch (SQLException e) { String es = "Erorr selectById()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUtils.close(rs, p); } } | public Forum selectById(int forumId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.selectById")); p.setInt(1, forumId); ResultSet rs = p.executeQuery(); Forum f = new Forum(); if (rs.next()) { f = this.fillForum(rs); } rs.clos... |
public void setLastPost(int forumId, int postId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.updateLastPost")); | public void setLastPost(int forumId, int postId) { PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.updateLastPost")); | public void setLastPost(int forumId, int postId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.updateLastPost")); p.setInt(1, postId); p.setInt(2, forumId); p.executeUpdate(); p.close(); } |
p.executeUpdate(); p.close(); } | p.executeUpdate(); } catch (SQLException e) { String es = "Erorr setLastPost()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUtils.close(p); } } | public void setLastPost(int forumId, int postId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.updateLastPost")); p.setInt(1, postId); p.setInt(2, forumId); p.executeUpdate(); p.close(); } |
public void setModerated(int categoryId, boolean status) throws Exception | public void setModerated(int categoryId, boolean status) | public void setModerated(int categoryId, boolean status) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.setModerated")); p.setInt(1, status ? 1 : 0); p.setInt(2, categoryId); p.executeUpdate(); p.close(); } |
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.setModerated")); p.setInt(1, status ? 1 : 0); p.setInt(2, categoryId); p.executeUpdate(); p.close(); } | PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.setModerated")); p.setInt(1, status ? 1 : 0); p.setInt(2, categoryId); p.executeUpdate(); } catch (SQLException e) { String es = "Erorr setModerated()"; log.error(es, e); throw new RuntimeExcepti... | public void setModerated(int categoryId, boolean status) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.setModerated")); p.setInt(1, status ? 1 : 0); p.setInt(2, categoryId); p.executeUpdate(); p.close(); } |
public Forum setOrderDown(Forum forum, Forum related) throws Exception { | public Forum setOrderDown(Forum forum, Forum related) { | public Forum setOrderDown(Forum forum, Forum related) throws Exception { return this.changeForumOrder(forum, related, false); } |
public Forum setOrderUp(Forum forum, Forum related) throws Exception | public Forum setOrderUp(Forum forum, Forum related) | public Forum setOrderUp(Forum forum, Forum related) throws Exception { return this.changeForumOrder(forum, related, true); } |
public void subscribeUser(int forumId, int userId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection(). prepareStatement(SystemGlobals.getSql("ForumModel.subscribeUser")); p.setInt(1, forumId); p.setInt(2, userId); p.executeUpdate(); p.close(); | public void subscribeUser(int forumId, int userId) { PreparedStatement p=null; try { p = JForumExecutionContext.getConnection(). prepareStatement(SystemGlobals.getSql("ForumModel.subscribeUser")); p.setInt(1, forumId); p.setInt(2, userId); p.executeUpdate(); } catch (SQLException e) { String es = "Erorr subscribeUser... | public void subscribeUser(int forumId, int userId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection(). prepareStatement(SystemGlobals.getSql("ForumModel.subscribeUser")); p.setInt(1, forumId); p.setInt(2, userId); p.executeUpdate(); p.close(); } |
public void update(Forum forum) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.update")); | public void update(Forum forum) { PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.update")); | public void update(Forum forum) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.update")); p.setInt(1, forum.getCategoryId()); p.setString(2, forum.getName()); p.setString(3, forum.getDescription()); p.setInt(4, forum.isModerated() ... |
p.executeUpdate(); p.close(); } | p.executeUpdate(); } catch (SQLException e) { String es = "Erorr update()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUtils.close(p); } } | public void update(Forum forum) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("ForumModel.update")); p.setInt(1, forum.getCategoryId()); p.setString(2, forum.getName()); p.setString(3, forum.getDescription()); p.setInt(4, forum.isModerated() ... |
t.isImplicitType() && (t.isAbstract() || (t.getOuter() != null && t.getOuter().isAbstract())); | t.isImplicitType() && !t.canBeInstantiated(); | private void buildJavaTypeGraph(CaesarTypeGraph completeGraph) { Map typeMap = completeGraph.getTypeMap(); // generate graph for (Iterator it = typeMap.entrySet().iterator(); it.hasNext();) { CaesarTypeNode t = (CaesarTypeNode) ((Map.Entry)it.next()).getValue(); ... |
if(notNeededType) next.partOfANotNeededChain = true; | next.partOfANotNeededChain = notNeededType; | private void buildJavaTypeGraph(CaesarTypeGraph completeGraph) { Map typeMap = completeGraph.getTypeMap(); // generate graph for (Iterator it = typeMap.entrySet().iterator(); it.hasNext();) { CaesarTypeNode t = (CaesarTypeNode) ((Map.Entry)it.next()).getValue(); ... |
next.partOfANotNeededChain = notNeededType; | private void buildJavaTypeGraph(CaesarTypeGraph completeGraph) { Map typeMap = completeGraph.getTypeMap(); // generate graph for (Iterator it = typeMap.entrySet().iterator(); it.hasNext();) { CaesarTypeNode t = (CaesarTypeNode) ((Map.Entry)it.next()).getValue(); ... | |
this.context.put("smilies", SmiliesRepository.getSmilies()); | public void quote() throws Exception { PostDAO pm = DataAccessDriver.getInstance().newPostDAO(); Post p = pm.selectById(this.request.getIntParameter("post_id")); if (!this.anonymousPost(p.getForumId())) { return; } Topic t = TopicRepository.getTopic(new Topic(p.getTopicId())); if (t == null) { t = DataAcce... | |
throw new ParseException("Current BioEntry already has a taxon"); | System.err.println( "Warning: attempted to set taxon twice with different values. Keeping first value. "+ "old value (retained): "+this.taxon+" new value: "+taxon); | public void setTaxon(NCBITaxon taxon) throws ParseException { if (taxon==null) throw new ParseException("Taxon cannot be null"); if (this.taxon!=null){ if(! this.taxon.equals(taxon)){ throw new ParseException("Current BioEntry already has a taxon"); } //al... |
int check = (first + last) / 2; Location checkL = (Location) componentList.get(check); | check = (first + last) / 2; checkL = (Location) componentList.get(check); | public Location locationUpstreamOfPoint(int p) { int first = 0; int last = componentList.size() - 1; while (first <= last) { int check = (first + last) / 2; Location checkL = (Location) componentList.get(check); if (checkL.contains(p)) return checkL; if (p < checkL.getMin()) last = check - 1; ... |
return (Location) componentList.get(Math.max(last, first) + 1); | if (p < checkL.getMin()) { return checkL; } else { return (Location) componentList.get(check + 1); } | public Location locationUpstreamOfPoint(int p) { int first = 0; int last = componentList.size() - 1; while (first <= last) { int check = (first + last) / 2; Location checkL = (Location) componentList.get(check); if (checkL.contains(p)) return checkL; if (p < checkL.getMin()) last = check - 1; ... |
return null; } catch (NullPointerException ex) { | public Location locationUpstreamOfPoint(int p) { int first = 0; int last = componentList.size() - 1; while (first <= last) { int check = (first + last) / 2; Location checkL = (Location) componentList.get(check); if (checkL.contains(p)) return checkL; if (p < checkL.getMin()) last = check - 1; ... | |
public void activateAccount() throws Exception | public void activateAccount() | public void activateAccount() throws Exception { String hash = this.request.getParameter("hash"); int userId = (new Integer(this.request.getParameter("user_id"))).intValue(); String message = ""; UserDAO um = DataAccessDriver.getInstance().newUserDAO(); User u = um.selectById(userId); boolean isOk = um.validate... |
String message = ""; | public void activateAccount() throws Exception { String hash = this.request.getParameter("hash"); int userId = (new Integer(this.request.getParameter("user_id"))).intValue(); String message = ""; UserDAO um = DataAccessDriver.getInstance().newUserDAO(); User u = um.selectById(userId); boolean isOk = um.validate... | |
String message; | public void activateAccount() throws Exception { String hash = this.request.getParameter("hash"); int userId = (new Integer(this.request.getParameter("user_id"))).intValue(); String message = ""; UserDAO um = DataAccessDriver.getInstance().newUserDAO(); User u = um.selectById(userId); boolean isOk = um.validate... | |
private boolean canEdit() throws Exception | private boolean canEdit() | private boolean canEdit() throws Exception { int tmpId = SessionFacade.getUserSession().getUserId(); boolean canEdit = SessionFacade.isLogged() && tmpId == this.request.getIntParameter("user_id"); if (!canEdit) { this.profile(); } return canEdit; } |
public void edit() throws Exception | public void edit() | public void edit() throws Exception { if (this.canEdit()) { int userId = this.request.getIntParameter("user_id"); UserDAO um = DataAccessDriver.getInstance().newUserDAO(); User u = um.selectById(userId); this.context.put("u", u); this.context.put("action", "editSave"); this.context.put("pageTitle", I18n.... |
public void editDone() throws Exception | public void editDone() | public void editDone() throws Exception { this.context.put("editDone", true); this.edit(); } |
public void editSave() throws Exception | public void editSave() | public void editSave() throws Exception { if (this.canEdit()) { int userId = this.request.getIntParameter("user_id"); List warns = UserCommon.saveUser(userId); if (warns.size() > 0) { this.context.put("warns", warns); this.edit(); } else { JForumExecutionContext.setRedirect(this.request.getConte... |
public void insertSave() throws Exception | public void insertSave() | public void insertSave() throws Exception { UserSession userSession = SessionFacade.getUserSession(); int userId = userSession.getUserId(); if ((!SystemGlobals.getBoolValue(ConfigKeys.REGISTRATION_ENABLED) && !SecurityRepository.get(userId).canAccess(SecurityConstants.PERM_ADMINISTRATION)) || ConfigKeys.TYPE... |
public void list() throws Exception | public void list() | public void list() throws Exception { int start = this.preparePagination(DataAccessDriver.getInstance().newUserDAO().getTotalUsers()); int usersPerPage = SystemGlobals.getIntValue(ConfigKeys.USERS_PER_PAGE); List users = DataAccessDriver.getInstance().newUserDAO().selectAll(start ,usersPerPage); this.contex... |
public void listGroup() throws Exception | public void listGroup() | public void listGroup() throws Exception { int groupId = this.request.getIntParameter("group_id"); int start = this.preparePagination(DataAccessDriver.getInstance().newUserDAO().getTotalUsersByGroup(groupId)); int usersPerPage = SystemGlobals.getIntValue(ConfigKeys.USERS_PER_PAGE); List users = DataAccess... |
public void login() throws Exception | public void login() | public void login() throws Exception { if (ConfigKeys.TYPE_SSO.equals(SystemGlobals.getValue(ConfigKeys.AUTHENTICATION_TYPE))) { this.registrationDisabled(); return; } if (this.request.getParameter("returnPath") != null) { this.context.put("returnPath", this.request.getParameter("returnPath")); } this.co... |
public void logout() throws Exception | public void logout() | public void logout() throws Exception { JForumExecutionContext.setRedirect(this.request.getContextPath() + "/forums/list" + SystemGlobals.getValue(ConfigKeys.SERVLET_EXTENSION)); UserSession userSession = SessionFacade.getUserSession(); SessionFacade.storeSessionData(userSession.getSessionId(), JForumExecution... |
public void lostPasswordSend() throws Exception | public void lostPasswordSend() | public void lostPasswordSend() throws Exception { String email = this.request.getParameter("email"); String username = this.request.getParameter("username"); User user = this.prepareLostPassword(username, email); if (user == null) { // user could not be found this.context.put("message", I18n.getMessage("P... |
private boolean parseBasicAuthentication() throws Exception { | private boolean parseBasicAuthentication() { | private boolean parseBasicAuthentication() throws Exception { if (hasBasicAuthentication(request)) { String auth = request.getHeader("Authorization"); String decoded = new String(new sun.misc.BASE64Decoder().decodeBuffer(auth.substring(6))); int p = decoded.indexOf(':'); ... |
String decoded = new String(new sun.misc.BASE64Decoder().decodeBuffer(auth.substring(6))); | String decoded; try { decoded = new String(new sun.misc.BASE64Decoder().decodeBuffer(auth.substring(6))); } catch (IOException e) { String es = "Erorr add()"; logger.error(es, e); throw new RuntimeException(es, e); } | private boolean parseBasicAuthentication() throws Exception { if (hasBasicAuthentication(request)) { String auth = request.getHeader("Authorization"); String decoded = new String(new sun.misc.BASE64Decoder().decodeBuffer(auth.substring(6))); int p = decoded.indexOf(':'); ... |
public User prepareLostPassword(String username, String email) throws Exception | public User prepareLostPassword(String username, String email) | public User prepareLostPassword(String username, String email) throws Exception { User user = null; UserDAO um = DataAccessDriver.getInstance().newUserDAO(); if (email != null && !email.trim().equals("")) { username = um.getUsernameByEmail(email); } if (username != null && !username.trim().equals("")) { List ... |
public void profile() throws Exception | public void profile() | public void profile() throws Exception { DataAccessDriver da = DataAccessDriver.getInstance(); UserDAO udao = da.newUserDAO(); User u = udao.selectById(this.request.getIntParameter("user_id")); if (u.getId() == 0) { this.userNotFound(); } else { this.setTemplateName(TemplateKeys.USER_PROFILE); this.cont... |
public void recoverPassword() throws Exception | public void recoverPassword() | public void recoverPassword() throws Exception { String hash = this.request.getParameter("hash"); this.setTemplateName(TemplateKeys.USER_RECOVERPASSWORD); this.context.put("recoverHash", hash); } |
public void recoverPasswordValidate() throws Exception | public void recoverPasswordValidate() | public void recoverPasswordValidate() throws Exception { String hash = this.request.getParameter("recoverHash"); String email = this.request.getParameter("email"); String message = ""; boolean isOk = DataAccessDriver.getInstance().newUserDAO().validateLostPasswordHash(email, hash); if (isOk) { String passwor... |
String message = ""; | String message; | public void recoverPasswordValidate() throws Exception { String hash = this.request.getParameter("recoverHash"); String email = this.request.getParameter("email"); String message = ""; boolean isOk = DataAccessDriver.getInstance().newUserDAO().validateLostPasswordHash(email, hash); if (isOk) { String passwor... |
public void registrationComplete() throws Exception | public void registrationComplete() | public void registrationComplete() throws Exception { int userId = SessionFacade.getUserSession().getUserId(); ForumRepository.setLastRegisteredUser( DataAccessDriver.getInstance().newUserDAO().selectById(userId)); ForumRepository.incrementTotalUsers(); String profilePage = JForumExecutionContext.getRequest(... |
public void searchKarma() throws Exception | public void searchKarma() | public void searchKarma() throws Exception { int start = this.preparePagination(DataAccessDriver.getInstance().newUserDAO().getTotalUsers()); int usersPerPage = SystemGlobals.getIntValue(ConfigKeys.USERS_PER_PAGE); //Load all users with your karma List users = DataAccessDriver.getInstance().newUserDAO().selectAl... |
public void validateLogin() throws Exception | public void validateLogin() | public void validateLogin() throws Exception { String password; String username; if (parseBasicAuthentication()) { username = (String)this.request.getAttribute("username"); password = (String)this.request.getAttribute("password"); } else { username = this.request.getParameter("username"); password = thi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.