rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
postDao.deleteByTopic(topic.getId()); pollDao.deleteByTopicId(topic.getId());
PostDAO postDao = DataAccessDriver.getInstance().newPostDAO(); PollDAO pollDao = DataAccessDriver.getInstance().newPollDAO();
public void deleteTopics(List topics) throws Exception { // Topic PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("TopicModel.delete")); ForumDAO forumDao = DataAccessDriver.getInstance().newForumDAO(); PostDAO postDao = DataAccessDriver.getInstance().newPos...
p.setInt(1, topic.getId()); p.executeUpdate(); forumDao.decrementTotalTopics(topic.getForumId(), 1); } p.close(); }
for (Iterator iter = topics.iterator(); iter.hasNext(); ) { Topic topic = (Topic)iter.next(); this.removeSubscriptionByTopic(topic.getId()); postDao.deleteByTopic(topic.getId()); pollDao.deleteByTopicId(topic.getId()); p.setInt(1, topic.getId()); p.executeUpdate(); forumDao.decrementTotalTopics(topic.getForumI...
public void deleteTopics(List topics) throws Exception { // Topic PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("TopicModel.delete")); ForumDAO forumDao = DataAccessDriver.getInstance().newForumDAO(); PostDAO postDao = DataAccessDriver.getInstance().newPos...
public List fillTopicsData(PreparedStatement p) throws Exception {
public List fillTopicsData(PreparedStatement p) throws SQLException {
public List fillTopicsData(PreparedStatement p) throws Exception { List l = new ArrayList(); ResultSet rs = p.executeQuery(); SimpleDateFormat df = new SimpleDateFormat(SystemGlobals.getValue(ConfigKeys.DATE_TIME_FORMAT)); StringBuffer sbFirst = new StringBuffer(128); StringBuffer sbLast = new StringBuffer(...
ResultSet rs = p.executeQuery(); SimpleDateFormat df = new SimpleDateFormat(SystemGlobals.getValue(ConfigKeys.DATE_TIME_FORMAT)); StringBuffer sbFirst = new StringBuffer(128); StringBuffer sbLast = new StringBuffer(128); while (rs.next()) { Topic t = this.getBaseTopicData(rs); User u = new User(); u.setId(rs.getIn...
ResultSet rs=null; try { rs = p.executeQuery();
public List fillTopicsData(PreparedStatement p) throws Exception { List l = new ArrayList(); ResultSet rs = p.executeQuery(); SimpleDateFormat df = new SimpleDateFormat(SystemGlobals.getValue(ConfigKeys.DATE_TIME_FORMAT)); StringBuffer sbFirst = new StringBuffer(128); StringBuffer sbLast = new StringBuffer(...
while (rs.next()) { users.put(new Integer(rs.getInt("user_id")), rs.getString("username")); } rs.close(); p.close(); for (Iterator iter = l.iterator(); iter.hasNext(); ) { Topic t = (Topic)iter.next(); t.getPostedBy().setUsername((String)users.get(new Integer(t.getPostedBy().getId()))); t.getLastPostBy().setUsername(...
SimpleDateFormat df = new SimpleDateFormat(SystemGlobals.getValue(ConfigKeys.DATE_TIME_FORMAT)); StringBuffer sbFirst = new StringBuffer(128); StringBuffer sbLast = new StringBuffer(128); while (rs.next()) { Topic t = this.getBaseTopicData(rs); User u = new User(); u.setId(rs.getInt("user_id")); t.setPostedBy(u); ...
public List fillTopicsData(PreparedStatement p) throws Exception { List l = new ArrayList(); ResultSet rs = p.executeQuery(); SimpleDateFormat df = new SimpleDateFormat(SystemGlobals.getValue(ConfigKeys.DATE_TIME_FORMAT)); StringBuffer sbFirst = new StringBuffer(128); StringBuffer sbLast = new StringBuffer(...
public void fixFirstLastPostId(int topicId) throws Exception
public void fixFirstLastPostId(int topicId)
public void fixFirstLastPostId(int topicId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.getFirstLastPostId")); p.setInt(1, topicId); ResultSet rs = p.executeQuery(); if (rs.next()) { int first = rs.getInt("first_post_id"); ...
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.getFirstLastPostId")); p.setInt(1, topicId); ResultSet rs = p.executeQuery(); if (rs.next()) { int first = rs.getInt("first_post_id"); int last = rs.getInt("last_post_id"); rs.close(); p.close(); p = JForum...
PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.getFirstLastPostId")); p.setInt(1, topicId); rs = p.executeQuery(); if (rs.next()) { int first = rs.getInt("first_post_id"); int last = rs.getInt("last_post_id"); rs.close();...
public void fixFirstLastPostId(int topicId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.getFirstLastPostId")); p.setInt(1, topicId); ResultSet rs = p.executeQuery(); if (rs.next()) { int first = rs.getInt("first_post_id"); ...
protected Topic getBaseTopicData(ResultSet rs) throws Exception
protected Topic getBaseTopicData(ResultSet rs) throws SQLException
protected Topic getBaseTopicData(ResultSet rs) throws Exception { Topic t = new Topic(); t.setTitle(rs.getString("topic_title")); t.setId(rs.getInt("topic_id")); t.setTime(new Date(rs.getTimestamp("topic_time").getTime())); t.setStatus(rs.getInt("topic_status")); t.setTotalViews(rs.getInt("topic_views")); t.s...
public int getMaxPostId(int topicId) throws Exception
public int getMaxPostId(int topicId)
public int getMaxPostId(int topicId) throws Exception { int id = -1; PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.getMaxPostId")); p.setInt(1, topicId); ResultSet rs = p.executeQuery(); if (rs.next()) { id = rs.getInt("post_id"); } rs.cl...
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.getMaxPostId")); p.setInt(1, topicId); ResultSet rs = p.executeQuery(); if (rs.next()) { id = rs.getInt("post_id"); } rs.close(); p.close(); return id; }
PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.getMaxPostId")); p.setInt(1, topicId); rs = p.executeQuery(); if (rs.next()) { id = rs.getInt("post_id"); } return id; } catch (SQLException e) { String es = "Erorr getMaxPos...
public int getMaxPostId(int topicId) throws Exception { int id = -1; PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.getMaxPostId")); p.setInt(1, topicId); ResultSet rs = p.executeQuery(); if (rs.next()) { id = rs.getInt("post_id"); } rs.cl...
public int getMinPostId(int topicId) throws Exception
public int getMinPostId(int topicId)
public int getMinPostId(int topicId) throws Exception { int id = -1; PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.getMinPostId")); p.setInt(1, topicId); ResultSet rs = p.executeQuery(); if (rs.next()) { id = rs.getInt("post_id"); } rs.cl...
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.getMinPostId")); p.setInt(1, topicId); ResultSet rs = p.executeQuery(); if (rs.next()) { id = rs.getInt("post_id"); } rs.close(); p.close(); return id; }
PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.getMinPostId")); p.setInt(1, topicId); ResultSet rs = p.executeQuery(); if (rs.next()) { id = rs.getInt("post_id"); } return id; } catch (SQLException e) { String es = "Erorr getMinPostId()"; l...
public int getMinPostId(int topicId) throws Exception { int id = -1; PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.getMinPostId")); p.setInt(1, topicId); ResultSet rs = p.executeQuery(); if (rs.next()) { id = rs.getInt("post_id"); } rs.cl...
public int getTotalPosts(int topicId) throws Exception
public int getTotalPosts(int topicId)
public int getTotalPosts(int topicId) throws Exception { int total = 0; PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.getTotalPosts")); p.setInt(1, topicId); ResultSet rs = p.executeQuery(); if (rs.next()) { total = rs.getInt("total"); } ...
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.getTotalPosts")); p.setInt(1, topicId); ResultSet rs = p.executeQuery(); if (rs.next()) { total = rs.getInt("total"); } rs.close(); p.close(); return total; }
PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.getTotalPosts")); p.setInt(1, topicId); rs = p.executeQuery(); if (rs.next()) { total = rs.getInt("total"); } return total; } catch (SQLException e) { String es = "Erorr getT...
public int getTotalPosts(int topicId) throws Exception { int total = 0; PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.getTotalPosts")); p.setInt(1, topicId); ResultSet rs = p.executeQuery(); if (rs.next()) { total = rs.getInt("total"); } ...
public void incrementTotalReplies(int topicId) throws Exception
public void incrementTotalReplies(int topicId)
public void incrementTotalReplies(int topicId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.incrementTotalReplies")); p.setInt(1, topicId); p.executeUpdate(); p.close(); }
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.incrementTotalReplies")); p.setInt(1, topicId); p.executeUpdate(); p.close(); }
PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.incrementTotalReplies")); p.setInt(1, topicId); p.executeUpdate(); } catch (SQLException e) { String es = "Erorr incrementTotalReplies()"; log.error(es, e); throw new RuntimeException(es, e); } f...
public void incrementTotalReplies(int topicId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.incrementTotalReplies")); p.setInt(1, topicId); p.executeUpdate(); p.close(); }
public void incrementTotalViews(int topicId) throws Exception
public void incrementTotalViews(int topicId)
public void incrementTotalViews(int topicId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.incrementTotalViews")); p.setInt(1, topicId); p.executeUpdate(); p.close(); }
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.incrementTotalViews")); p.setInt(1, topicId); p.executeUpdate(); p.close(); }
PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.incrementTotalViews")); p.setInt(1, topicId); p.executeUpdate(); } catch (SQLException e) { String es = "Erorr incrementTotalViews()"; log.error(es, e); throw new RuntimeException(es, e); } final...
public void incrementTotalViews(int topicId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.incrementTotalViews")); p.setInt(1, topicId); p.executeUpdate(); p.close(); }
public boolean isUserSubscribed(int topicId, int userId) throws Exception
public boolean isUserSubscribed(int topicId, int userId)
public boolean isUserSubscribed(int topicId, int userId) throws Exception { PreparedStatement stmt = JForumExecutionContext.getConnection(). prepareStatement( SystemGlobals.getSql("TopicModel.isUserSubscribed")); ResultSet rs = null; stmt.setInt(1, topicId); stmt.setInt(2, userId); rs = stmt.executeQuery(); ...
PreparedStatement stmt = JForumExecutionContext.getConnection(). prepareStatement( SystemGlobals.getSql("TopicModel.isUserSubscribed")); ResultSet rs = null; stmt.setInt(1, topicId); stmt.setInt(2, userId); rs = stmt.executeQuery(); boolean status = rs.next(); rs.close(); stmt.close(); return status; }
PreparedStatement stmt=null; ResultSet rs = null; try { stmt = JForumExecutionContext.getConnection(). prepareStatement( SystemGlobals.getSql("TopicModel.isUserSubscribed")); stmt.setInt(1, topicId); stmt.setInt(2, userId); rs = stmt.executeQuery(); return rs.next(); } catch (SQLException e) { String es = "Erorr isU...
public boolean isUserSubscribed(int topicId, int userId) throws Exception { PreparedStatement stmt = JForumExecutionContext.getConnection(). prepareStatement( SystemGlobals.getSql("TopicModel.isUserSubscribed")); ResultSet rs = null; stmt.setInt(1, topicId); stmt.setInt(2, userId); rs = stmt.executeQuery(); ...
public void lockUnlock(int[] topicId, int status) throws Exception
public void lockUnlock(int[] topicId, int status)
public void lockUnlock(int[] topicId, int status) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.lockUnlock")); p.setInt(1, status); for (int i = 0; i < topicId.length; i++) { p.setInt(2, topicId[i]); p.executeUpdate(); } p....
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.lockUnlock")); p.setInt(1, status); for (int i = 0; i < topicId.length; i++) { p.setInt(2, topicId[i]); p.executeUpdate(); } p.close(); }
PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.lockUnlock")); p.setInt(1, status); for (int i = 0; i < topicId.length; i++) { p.setInt(2, topicId[i]); p.executeUpdate(); } } catch (SQLException e) { String es = "Erorr lockUnlock()"; log.erro...
public void lockUnlock(int[] topicId, int status) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.lockUnlock")); p.setInt(1, status); for (int i = 0; i < topicId.length; i++) { p.setInt(2, topicId[i]); p.executeUpdate(); } p....
public List notifyUsers(Topic topic) throws Exception
public List notifyUsers(Topic topic)
public List notifyUsers(Topic topic) throws Exception { int posterId = SessionFacade.getUserSession().getUserId(); int anonUser = SystemGlobals.getIntValue(ConfigKeys.ANONYMOUS_USER_ID); PreparedStatement stmt = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.notifyUsers...
PreparedStatement stmt = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.notifyUsers")); ResultSet rs = null;
PreparedStatement stmt=null; ResultSet rs = null; try { stmt = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.notifyUsers"));
public List notifyUsers(Topic topic) throws Exception { int posterId = SessionFacade.getUserSession().getUserId(); int anonUser = SystemGlobals.getIntValue(ConfigKeys.ANONYMOUS_USER_ID); PreparedStatement stmt = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.notifyUsers...
stmt.setInt(1, topic.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, topic.getId()); stmt.setInt(2, posterId); stmt.setInt(3, anonUser);
public List notifyUsers(Topic topic) throws Exception { int posterId = SessionFacade.getUserSession().getUserId(); int anonUser = SystemGlobals.getIntValue(ConfigKeys.ANONYMOUS_USER_ID); PreparedStatement stmt = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.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); } stmt = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.markAllAsUnread")); stmt.setInt(1, topic...
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); } rs.close(); rs=null; stmt.close(); st...
public List notifyUsers(Topic topic) throws Exception { int posterId = SessionFacade.getUserSession().getUserId(); int anonUser = SystemGlobals.getIntValue(ConfigKeys.ANONYMOUS_USER_ID); PreparedStatement stmt = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.notifyUsers...
public void removeSubscription(int topicId, int userId) throws Exception
public void removeSubscription(int topicId, int userId)
public void removeSubscription(int topicId, int userId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.removeSubscription")); p.setInt(1, topicId); p.setInt(2, userId); p.executeUpdate(); p.close(); }
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.removeSubscription")); p.setInt(1, topicId); p.setInt(2, userId); p.executeUpdate(); p.close();
PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.removeSubscription")); p.setInt(1, topicId); p.setInt(2, userId); p.executeUpdate(); } catch (SQLException e) { String es = "Erorr removeSubscription()"; log.error(es, e); throw new RuntimeExcep...
public void removeSubscription(int topicId, int userId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.removeSubscription")); p.setInt(1, topicId); p.setInt(2, userId); p.executeUpdate(); p.close(); }
public void removeSubscriptionByTopic(int topicId) throws Exception
public void removeSubscriptionByTopic(int topicId)
public void removeSubscriptionByTopic(int topicId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.removeSubscriptionByTopic")); p.setInt(1, topicId); p.executeUpdate(); p.close(); }
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.removeSubscriptionByTopic")); p.setInt(1, topicId); p.executeUpdate(); p.close();
PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.removeSubscriptionByTopic")); p.setInt(1, topicId); p.executeUpdate(); } catch (SQLException e) { String es = "Erorr removeSubscriptionByTopic()"; log.error(es, e); throw new RuntimeException(es...
public void removeSubscriptionByTopic(int topicId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.removeSubscriptionByTopic")); p.setInt(1, topicId); p.executeUpdate(); p.close(); }
public List selectAllByForum(int forumId) throws Exception
public List selectAllByForum(int forumId)
public List selectAllByForum(int forumId) throws Exception { return this.selectAllByForumByLimit(forumId, 0, Integer.MAX_VALUE); }
public List selectAllByForumByLimit( int forumId, int startFrom, int count) throws Exception
public List selectAllByForumByLimit(int forumId, int startFrom, int count)
public List selectAllByForumByLimit( int forumId, int startFrom, int count) throws Exception { String sql = SystemGlobals.getSql("TopicModel.selectAllByForumByLimit"); PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(sql); p.setInt(1, forumId); p.setInt(2, startFrom); p.setInt(...
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(sql); p.setInt(1, forumId); p.setInt(2, startFrom); p.setInt(3, count); return this.fillTopicsData(p); }
PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(sql); p.setInt(1, forumId); p.setInt(2, startFrom); p.setInt(3, count); List list = this.fillTopicsData(p); p=null; return list; } catch (SQLException e) { String es = "Erorr selectAllByForumByLimit()"; log.error(es, e); throw ...
public List selectAllByForumByLimit( int forumId, int startFrom, int count) throws Exception { String sql = SystemGlobals.getSql("TopicModel.selectAllByForumByLimit"); PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(sql); p.setInt(1, forumId); p.setInt(2, startFrom); p.setInt(...
public Topic selectById(int topicId) throws Exception
public Topic selectById(int topicId)
public Topic selectById(int topicId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.selectById")); p.setInt(1, topicId); Topic t = new Topic(); List l = this.fillTopicsData(p); if (l.size() > 0) { t = (Topic)l.get(0); } ...
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.selectById")); p.setInt(1, topicId); Topic t = new Topic(); List l = this.fillTopicsData(p); if (l.size() > 0) { t = (Topic)l.get(0); } return t; }
PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.selectById")); p.setInt(1, topicId); Topic t = new Topic(); List l = this.fillTopicsData(p); p=null; if (l.size() > 0) { t = (Topic)l.get(0); } return t; } catch (SQLException e) { String es =...
public Topic selectById(int topicId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.selectById")); p.setInt(1, topicId); Topic t = new Topic(); List l = this.fillTopicsData(p); if (l.size() > 0) { t = (Topic)l.get(0); } ...
public List selectByUserByLimit(int userId, int startFrom, int count) throws Exception
public List selectByUserByLimit(int userId, int startFrom, int count)
public List selectByUserByLimit(int userId, int startFrom, int count) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("TopicModel.selectByUserByLimit").replaceAll(":fids:",ForumRepository.getListAllowedForums())); p.setInt(1,userId); p.setI...
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("TopicModel.selectByUserByLimit").replaceAll(":fids:",ForumRepository.getListAllowedForums())); p.setInt(1,userId); p.setInt(2, startFrom); p.setInt(3, count); return this.fillTopicsData(p); }
PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("TopicModel.selectByUserByLimit").replaceAll(":fids:", ForumRepository.getListAllowedForums())); p.setInt(1,userId); p.setInt(2, startFrom); p.setInt(3, count); List list = this.fillTopicsData(p); p=null;...
public List selectByUserByLimit(int userId, int startFrom, int count) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("TopicModel.selectByUserByLimit").replaceAll(":fids:",ForumRepository.getListAllowedForums())); p.setInt(1,userId); p.setI...
public Topic selectRaw(int topicId) throws Exception
public Topic selectRaw(int topicId)
public Topic selectRaw(int topicId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.selectRaw")); p.setInt(1, topicId); Topic t = new Topic(); ResultSet rs = p.executeQuery(); if (rs.next()) { t = this.getBaseTopicData(rs); } ...
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.selectRaw")); p.setInt(1, topicId); Topic t = new Topic(); ResultSet rs = p.executeQuery(); if (rs.next()) { t = this.getBaseTopicData(rs); } rs.close(); p.close(); return t; }
PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.selectRaw")); p.setInt(1, topicId); Topic t = new Topic(); rs = p.executeQuery(); if (rs.next()) { t = this.getBaseTopicData(rs); } return t; } catch (SQLException e) { Strin...
public Topic selectRaw(int topicId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.selectRaw")); p.setInt(1, topicId); Topic t = new Topic(); ResultSet rs = p.executeQuery(); if (rs.next()) { t = this.getBaseTopicData(rs); } ...
public List selectRecentTopics (int limit) throws Exception
public List selectRecentTopics (int limit)
public List selectRecentTopics (int limit) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("TopicModel.selectRecentTopicsByLimit")); p.setInt(1, limit); return this.fillTopicsData(p); }
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("TopicModel.selectRecentTopicsByLimit")); p.setInt(1, limit); return this.fillTopicsData(p); }
PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("TopicModel.selectRecentTopicsByLimit")); p.setInt(1, limit); List list = this.fillTopicsData(p); p=null; return list; } catch (SQLException e) { String es = "Erorr selectRecentTopics()"; log.error(es, e);...
public List selectRecentTopics (int limit) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("TopicModel.selectRecentTopicsByLimit")); p.setInt(1, limit); return this.fillTopicsData(p); }
public List selectTopicTitlesByIds(Collection idList) throws Exception
public List selectTopicTitlesByIds(Collection idList)
public List selectTopicTitlesByIds(Collection idList) throws Exception { List l = new ArrayList(); String sql = SystemGlobals.getSql("TopicModel.selectTopicTitlesByIds"); StringBuffer sb = new StringBuffer(idList.size() * 2); for (Iterator iter = idList.iterator(); iter.hasNext(); ) { sb.append(iter.next()).ap...
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(sql); ResultSet rs = p.executeQuery(); while (rs.next()) { Map m = new HashMap(); m.put("id", new Integer(rs.getInt("topic_id"))); m.put("title", rs.getString("topic_title")); l.add(m); } rs.close(); p.close(); return l;
PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement(sql); rs = p.executeQuery(); while (rs.next()) { Map m = new HashMap(); m.put("id", new Integer(rs.getInt("topic_id"))); m.put("title", rs.getString("topic_title")); l.add(m); } return l; } catch (SQLExcepti...
public List selectTopicTitlesByIds(Collection idList) throws Exception { List l = new ArrayList(); String sql = SystemGlobals.getSql("TopicModel.selectTopicTitlesByIds"); StringBuffer sb = new StringBuffer(idList.size() * 2); for (Iterator iter = idList.iterator(); iter.hasNext(); ) { sb.append(iter.next()).ap...
public void setFirstPostId(int topicId, int postId) throws Exception
public void setFirstPostId(int topicId, int postId)
public void setFirstPostId(int topicId, int postId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.setFirstPostId")); p.setInt(1, postId); p.setInt(2, topicId); p.executeUpdate(); p.close(); }
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.setFirstPostId")); p.setInt(1, postId); p.setInt(2, topicId); p.executeUpdate(); p.close();
PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.setFirstPostId")); p.setInt(1, postId); p.setInt(2, topicId); p.executeUpdate(); } catch (SQLException e) { String es = "Erorr setFirstPostId()"; log.error(es, e); throw new RuntimeException(es, ...
public void setFirstPostId(int topicId, int postId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.setFirstPostId")); p.setInt(1, postId); p.setInt(2, topicId); p.executeUpdate(); p.close(); }
public void setLastPostId(int topicId, int postId) throws Exception
public void setLastPostId(int topicId, int postId)
public void setLastPostId(int topicId, int postId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.setLastPostId")); p.setInt(1, postId); p.setInt(2, topicId); p.executeUpdate(); p.close(); }
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.setLastPostId")); p.setInt(1, postId); p.setInt(2, topicId); p.executeUpdate(); p.close(); }
PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.setLastPostId")); p.setInt(1, postId); p.setInt(2, topicId); p.executeUpdate(); } catch (SQLException e) { String es = "Erorr setLastPostId()"; log.error(es, e); throw new RuntimeException(es, e)...
public void setLastPostId(int topicId, int postId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.setLastPostId")); p.setInt(1, postId); p.setInt(2, topicId); p.executeUpdate(); p.close(); }
public void setModerationStatus(int forumId, boolean status) throws Exception
public void setModerationStatus(int forumId, boolean status)
public void setModerationStatus(int forumId, boolean status) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.setModerationStatus")); p.setInt(1, status ? 1 : 0); p.setInt(2, forumId); p.executeUpdate(); p.close(); }
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.setModerationStatus")); p.setInt(1, status ? 1 : 0); p.setInt(2, forumId); p.executeUpdate(); p.close();
PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.setModerationStatus")); p.setInt(1, status ? 1 : 0); p.setInt(2, forumId); p.executeUpdate(); } catch (SQLException e) { String es = "Erorr setModerationStatus()"; log.error(es, e); throw new Run...
public void setModerationStatus(int forumId, boolean status) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.setModerationStatus")); p.setInt(1, status ? 1 : 0); p.setInt(2, forumId); p.executeUpdate(); p.close(); }
public void setModerationStatusByTopic(int topicId, boolean status) throws Exception
public void setModerationStatusByTopic(int topicId, boolean status)
public void setModerationStatusByTopic(int topicId, boolean status) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("TopicModel.setModerationStatusByTopic")); p.setInt(1, status ? 1 : 0); p.setInt(2, topicId); p.executeUpdate(); p.close(); ...
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("TopicModel.setModerationStatusByTopic")); p.setInt(1, status ? 1 : 0); p.setInt(2, topicId); p.executeUpdate(); p.close(); }
PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("TopicModel.setModerationStatusByTopic")); p.setInt(1, status ? 1 : 0); p.setInt(2, topicId); p.executeUpdate(); } catch (SQLException e) { String es = "Erorr setModerationStatusByTopic()"; log.error(es, e)...
public void setModerationStatusByTopic(int topicId, boolean status) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement( SystemGlobals.getSql("TopicModel.setModerationStatusByTopic")); p.setInt(1, status ? 1 : 0); p.setInt(2, topicId); p.executeUpdate(); p.close(); ...
public void subscribeUser(int topicId, int userId) throws Exception
public void subscribeUser(int topicId, int userId)
public void subscribeUser(int topicId, int userId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection(). prepareStatement(SystemGlobals.getSql("TopicModel.subscribeUser")); p.setInt(1, topicId); p.setInt(2, userId); p.executeUpdate(); p.close(); }
PreparedStatement p = JForumExecutionContext.getConnection(). prepareStatement(SystemGlobals.getSql("TopicModel.subscribeUser")); p.setInt(1, topicId); p.setInt(2, userId); p.executeUpdate(); p.close(); }
PreparedStatement p=null; try { p = JForumExecutionContext.getConnection(). prepareStatement(SystemGlobals.getSql("TopicModel.subscribeUser")); p.setInt(1, topicId); p.setInt(2, userId); p.executeUpdate(); } catch (SQLException e) { String es = "Erorr subscribeUser()"; log.error(es, e); throw new RuntimeException(es,...
public void subscribeUser(int topicId, int userId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection(). prepareStatement(SystemGlobals.getSql("TopicModel.subscribeUser")); p.setInt(1, topicId); p.setInt(2, userId); p.executeUpdate(); p.close(); }
public Map topicPosters(int topicId) throws Exception
public Map topicPosters(int topicId)
public Map topicPosters(int topicId) throws Exception { Map m = new HashMap(); PreparedStatement p; StringBuffer sql = new StringBuffer(SystemGlobals.getSql("TopicModel.topicPosters")); if (SystemGlobals.getBoolValue(ConfigKeys.DATABASE_SUPPORT_SUBQUERIES)) { int index = sql.indexOf(":ids:"); sql.replace(i...
PreparedStatement p; StringBuffer sql = new StringBuffer(SystemGlobals.getSql("TopicModel.topicPosters")); if (SystemGlobals.getBoolValue(ConfigKeys.DATABASE_SUPPORT_SUBQUERIES)) { int index = sql.indexOf(":ids:"); sql.replace(index, index + 5, SystemGlobals.getSql("TopicModel.distinctPosters")); p = JForumExecution...
PreparedStatement p=null; ResultSet rs=null; try { StringBuffer sql = new StringBuffer(SystemGlobals.getSql("TopicModel.topicPosters")); if (SystemGlobals.getBoolValue(ConfigKeys.DATABASE_SUPPORT_SUBQUERIES)) { int index = sql.indexOf(":ids:"); sql.replace(index, index + 5, SystemGlobals.getSql("TopicModel.distinctPo...
public Map topicPosters(int topicId) throws Exception { Map m = new HashMap(); PreparedStatement p; StringBuffer sql = new StringBuffer(SystemGlobals.getSql("TopicModel.topicPosters")); if (SystemGlobals.getBoolValue(ConfigKeys.DATABASE_SUPPORT_SUBQUERIES)) { int index = sql.indexOf(":ids:"); sql.replace(i...
public void update(Topic topic) throws Exception
public void update(Topic topic)
public void update(Topic topic) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.update")); p.setString(1, topic.getTitle()); p.setInt(2, topic.getLastPostId()); p.setInt(3, topic.getFirstPostId()); p.setInt(4, topic.getType()); ...
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.update")); p.setString(1, topic.getTitle()); p.setInt(2, topic.getLastPostId()); p.setInt(3, topic.getFirstPostId()); p.setInt(4, topic.getType()); p.setInt(5, topic.isModerated() ? 1 : 0); p.setInt(6, topic....
PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.update")); p.setString(1, topic.getTitle()); p.setInt(2, topic.getLastPostId()); p.setInt(3, topic.getFirstPostId()); p.setInt(4, topic.getType()); p.setInt(5, topic.isModerated() ? 1 : 0); p.se...
public void update(Topic topic) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.update")); p.setString(1, topic.getTitle()); p.setInt(2, topic.getLastPostId()); p.setInt(3, topic.getFirstPostId()); p.setInt(4, topic.getType()); ...
public void updateReadStatus(int topicId, int userId, boolean read) throws Exception
public void updateReadStatus(int topicId, int userId, boolean read)
public void updateReadStatus(int topicId, int userId, boolean read) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.updateReadStatus")); p.setInt(1, read ? 1 : 0); p.setInt(2, topicId); p.setInt(3, userId); p.executeUpdate(); p....
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.updateReadStatus")); p.setInt(1, read ? 1 : 0); p.setInt(2, topicId); p.setInt(3, userId); p.executeUpdate(); p.close();
PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.updateReadStatus")); p.setInt(1, read ? 1 : 0); p.setInt(2, topicId); p.setInt(3, userId); p.executeUpdate(); } catch (SQLException e) { String es = "Erorr updateReadStatus()"; log.error(es, e);...
public void updateReadStatus(int topicId, int userId, boolean read) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("TopicModel.updateReadStatus")); p.setInt(1, read ? 1 : 0); p.setInt(2, topicId); p.setInt(3, userId); p.executeUpdate(); p....
public void deleteByTopicId(int topicId) throws Exception;
public void deleteByTopicId(int topicId) ;
public void deleteByTopicId(int topicId) throws Exception;
"Couldn't retrieve weight for " + r.getName() + " in state " + getName()
"Couldn't retrieve weight in state " + getName()
public double getWeight(Residue r) throws IllegalResidueException { if(r == MagicalState.MAGICAL_RESIDUE) { return Double.NEGATIVE_INFINITY; } try { alphabet().validate(r); } catch (IllegalResidueException ire) { throw new IllegalResidueException( ire, "Couldn't retrieve weigh...
p.setString(1, user.getUsername()); p.setString(2, user.getPassword()); p.setString(3, user.getEmail()); p.setString(4, Long.toString(System.currentTimeMillis()));
initNewUser(user, p);
public int addNew(User user) throws Exception { PreparedStatement p = this.getStatementForAutoKeys("UserModel.addNew"); p.setString(1, user.getUsername()); p.setString(2, user.getPassword()); p.setString(3, user.getEmail()); p.setString(4, Long.toString(System.currentTimeMillis())); // <PO:external> When id...
p.setInt(1, user.getId()); p.setString(2, user.getUsername()); p.setString(3, user.getPassword()); p.setString(4, user.getEmail()); p.setString(5, Long.toString(System.currentTimeMillis()));
initNewUser(user, p); p.setInt(5, user.getId());
public void addNewWithId(User user) throws Exception { PreparedStatement p = this.getStatementForAutoKeys("UserModel.addNewWithId"); p.setInt(1, user.getId()); p.setString(2, user.getUsername()); p.setString(3, user.getPassword()); p.setString(4, user.getEmail()); p.setString(5, Long.toString(System.currentTi...
int id = this.executeAutoKeysQuery(p);
p.executeUpdate();
public void addNewWithId(User user) throws Exception { PreparedStatement p = this.getStatementForAutoKeys("UserModel.addNewWithId"); p.setInt(1, user.getId()); p.setString(2, user.getUsername()); p.setString(3, user.getPassword()); p.setString(4, user.getEmail()); p.setString(5, Long.toString(System.currentTi...
u.setAim(rs.getString("user_aim")); u.setAvatar(rs.getString("user_avatar")); u.setGender(rs.getString("gender")); u.setRankId(rs.getInt("rank_id")); u.setThemeId(rs.getInt("themes_id")); u.setPrivateMessagesEnabled(rs.getString("user_allow_pm").equals("1")); u.setNotifyOnMessagesEnabled(rs.getString("user_notify").equ...
fillUserFromResultSet(u, rs);
public User selectById(int userId) throws Exception { PreparedStatement p = JForum.getConnection().prepareStatement(SystemGlobals.getSql("UserModel.selectById")); p.setInt(1, userId); ResultSet rs = p.executeQuery(); User u = new User(); if (rs.next()) { u.setAim(rs.getString("user_aim")); u.setAvatar(rs...
if(orig.getParameters()[j].isClassType()) {
if (orig.getParameters()[j].isClassType() && other.getParameters()[j].isClassType()) {
private CMethod findInitialDeclaration(CMethod orig, CContext context) { CClass ownerSuperClass = orig.getOwner().getSuperClass(); CMethod lastFound = orig; while(ownerSuperClass != null) { CMethod[] methods = ownerSuperClass.getMethods(); f...
public int addNew(Poll poll) throws Exception {
public int addNew(Poll poll) {
public int addNew(Poll poll) throws Exception { this.addNewPoll(poll); this.addNewPollOptions(poll.getId(), poll.getOptions()); return poll.getId(); }
protected void addNewPoll(Poll poll) throws Exception { PreparedStatement p = this.getStatementForAutoKeys("PollModel.addNewPoll"); p.setInt(1, poll.getTopicId()); p.setString(2, poll.getLabel()); p.setInt(3, poll.getLength());
protected void addNewPoll(Poll poll) { PreparedStatement p=null; try { p = this.getStatementForAutoKeys("PollModel.addNewPoll"); p.setInt(1, poll.getTopicId()); p.setString(2, poll.getLabel()); p.setInt(3, poll.getLength());
protected void addNewPoll(Poll poll) throws Exception { PreparedStatement p = this.getStatementForAutoKeys("PollModel.addNewPoll"); p.setInt(1, poll.getTopicId()); p.setString(2, poll.getLabel()); p.setInt(3, poll.getLength()); this.setAutoGeneratedKeysQuery(SystemGlobals.getSql("PollModel.lastGeneratedPollId"));...
this.setAutoGeneratedKeysQuery(SystemGlobals.getSql("PollModel.lastGeneratedPollId")); int pollId = this.executeAutoKeysQuery(p); poll.setId(pollId); p.close(); }
this.setAutoGeneratedKeysQuery(SystemGlobals.getSql("PollModel.lastGeneratedPollId")); int pollId = this.executeAutoKeysQuery(p); poll.setId(pollId); } catch (SQLException e) { String es = "Erorr addNewPoll()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUtils.close(p); } }
protected void addNewPoll(Poll poll) throws Exception { PreparedStatement p = this.getStatementForAutoKeys("PollModel.addNewPoll"); p.setInt(1, poll.getTopicId()); p.setString(2, poll.getLabel()); p.setInt(3, poll.getLength()); this.setAutoGeneratedKeysQuery(SystemGlobals.getSql("PollModel.lastGeneratedPollId"));...
protected void addNewPollOptions(int pollId, List options) throws Exception {
protected void addNewPollOptions(int pollId, List options) {
protected void addNewPollOptions(int pollId, List options) throws Exception { Connection connection = JForumExecutionContext.getConnection(); PreparedStatement p = connection.prepareStatement(SystemGlobals.getSql("PollModel.addNewPollOption")); PreparedStatement max = connection.prepareStatement(SystemGlobals.get...
PreparedStatement p = connection.prepareStatement(SystemGlobals.getSql("PollModel.addNewPollOption")); PreparedStatement max = connection.prepareStatement(SystemGlobals.getSql("PollModel.selectMaxVoteId")); max.setInt(1, pollId); ResultSet rs = max.executeQuery(); rs.next(); int optionId = rs.getInt(1); rs.close(); ...
PreparedStatement p=null; ResultSet rs=null; try { p = connection.prepareStatement(SystemGlobals.getSql("PollModel.selectMaxVoteId")); p.setInt(1, pollId); rs = p.executeQuery(); rs.next(); int optionId = rs.getInt(1); rs.close(); rs=null; p.close(); p=null; p = connection.prepareStatement(SystemGlobals.getSql("Pol...
protected void addNewPollOptions(int pollId, List options) throws Exception { Connection connection = JForumExecutionContext.getConnection(); PreparedStatement p = connection.prepareStatement(SystemGlobals.getSql("PollModel.addNewPollOption")); PreparedStatement max = connection.prepareStatement(SystemGlobals.get...
public void delete(int pollId) throws Exception {
public void delete(int pollId) {
public void delete(int pollId) throws Exception { this.deletePollVotes(pollId); this.deleteAllPollOptions(pollId); this.deletePoll(pollId); }
protected void deleteAllPollOptions(int pollId) throws Exception
protected void deleteAllPollOptions(int pollId)
protected void deleteAllPollOptions(int pollId) throws Exception { PreparedStatement poll = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PollModel.deleteAllPollOptions")); poll.setInt(1, pollId); poll.executeUpdate(); poll.close(); }
PreparedStatement poll = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PollModel.deleteAllPollOptions"));
PreparedStatement poll=null; try { poll = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PollModel.deleteAllPollOptions"));
protected void deleteAllPollOptions(int pollId) throws Exception { PreparedStatement poll = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PollModel.deleteAllPollOptions")); poll.setInt(1, pollId); poll.executeUpdate(); poll.close(); }
poll.setInt(1, pollId); poll.executeUpdate(); poll.close(); }
poll.setInt(1, pollId); poll.executeUpdate(); } catch (SQLException e) { String es = "Erorr deleteAllPollOptions()"; log.error(es, e); throw new RuntimeException(es, e); } finally { DbUtils.close(poll); } }
protected void deleteAllPollOptions(int pollId) throws Exception { PreparedStatement poll = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PollModel.deleteAllPollOptions")); poll.setInt(1, pollId); poll.executeUpdate(); poll.close(); }
public void deleteByTopicId(int topicId) throws Exception {
public void deleteByTopicId(int topicId) {
public void deleteByTopicId(int topicId) throws Exception { //first, lookup the poll id, then delete it PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PollModel.selectPollByTopicId")); p.setInt(1, topicId); ResultSet rs = p.executeQuery(); int pollId = 0;...
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PollModel.selectPollByTopicId")); p.setInt(1, topicId); ResultSet rs = p.executeQuery(); int pollId = 0; if (rs.next()) { pollId = rs.getInt("vote_id"); } rs.close(); p.close(); if (pollId != 0) { delete(pollId); } }
PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PollModel.selectPollByTopicId")); p.setInt(1, topicId); rs = p.executeQuery(); int pollId = 0; if (rs.next()) { pollId = rs.getInt("vote_id"); } if (pollId != 0) { delete(pollId); } }...
public void deleteByTopicId(int topicId) throws Exception { //first, lookup the poll id, then delete it PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PollModel.selectPollByTopicId")); p.setInt(1, topicId); ResultSet rs = p.executeQuery(); int pollId = 0;...
protected void deletePoll(int pollId) throws Exception { PreparedStatement poll = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PollModel.deletePoll")); poll.setInt(1, pollId); poll.executeUpdate(); poll.close();
protected void deletePoll(int pollId) { PreparedStatement poll=null; try { poll = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PollModel.deletePoll")); poll.setInt(1, pollId); poll.executeUpdate(); } catch (SQLException e) { String es = "Erorr deletePoll()"; log.error(es, e); throw new ...
protected void deletePoll(int pollId) throws Exception { PreparedStatement poll = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PollModel.deletePoll")); poll.setInt(1, pollId); poll.executeUpdate(); poll.close(); }
protected void deletePollOptions(int pollId, List deleted) throws Exception {
protected void deletePollOptions(int pollId, List deleted) throws SQLException {
protected void deletePollOptions(int pollId, List deleted) throws Exception { Connection connection = JForumExecutionContext.getConnection(); PreparedStatement options = connection.prepareStatement(SystemGlobals.getSql("PollModel.deletePollOption")); for (Iterator iter = deleted.iterator(); iter.hasNext(); ) { ...
PreparedStatement options = connection.prepareStatement(SystemGlobals.getSql("PollModel.deletePollOption"));
PreparedStatement options=null; try { options = connection.prepareStatement(SystemGlobals.getSql("PollModel.deletePollOption"));
protected void deletePollOptions(int pollId, List deleted) throws Exception { Connection connection = JForumExecutionContext.getConnection(); PreparedStatement options = connection.prepareStatement(SystemGlobals.getSql("PollModel.deletePollOption")); for (Iterator iter = deleted.iterator(); iter.hasNext(); ) { ...
for (Iterator iter = deleted.iterator(); iter.hasNext(); ) { PollOption o = (PollOption)iter.next(); options.setInt(1, pollId); options.setInt(2, o.getId()); options.executeUpdate(); } options.close(); }
for (Iterator iter = deleted.iterator(); iter.hasNext(); ) { PollOption o = (PollOption)iter.next(); options.setInt(1, pollId); options.setInt(2, o.getId()); options.executeUpdate(); } } finally { DbUtils.close(options); } }
protected void deletePollOptions(int pollId, List deleted) throws Exception { Connection connection = JForumExecutionContext.getConnection(); PreparedStatement options = connection.prepareStatement(SystemGlobals.getSql("PollModel.deletePollOption")); for (Iterator iter = deleted.iterator(); iter.hasNext(); ) { ...
protected void deletePollVotes(int pollId) throws Exception { PreparedStatement poll = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PollModel.deletePollVoters")); poll.setInt(1, pollId); poll.executeUpdate(); poll.close(); }
protected void deletePollVotes(int pollId) { PreparedStatement poll=null; try { poll = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PollModel.deletePollVoters")); poll.setInt(1, pollId); poll.executeUpdate(); } catch (SQLException e) { String es = "Erorr deletePollVotes()"; log.error(es...
protected void deletePollVotes(int pollId) throws Exception { PreparedStatement poll = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PollModel.deletePollVoters")); poll.setInt(1, pollId); poll.executeUpdate(); poll.close(); }
public boolean hasUserVotedOnPoll(int pollId, int userId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PollModel.selectVoter")); p.setInt(1, pollId); p.setInt(2, userId); ResultSet rs = p.executeQuery(); boolean hasVotedOnPoll = rs.next(); rs....
public boolean hasUserVotedOnPoll(int pollId, int userId) { PreparedStatement p=null; ResultSet rs=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PollModel.selectVoter")); p.setInt(1, pollId); p.setInt(2, userId); rs = p.executeQuery(); return rs.next(); } catch (SQLExce...
public boolean hasUserVotedOnPoll(int pollId, int userId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PollModel.selectVoter")); p.setInt(1, pollId); p.setInt(2, userId); ResultSet rs = p.executeQuery(); boolean hasVotedOnPoll = rs.next...
protected Poll makePoll(ResultSet rs) throws Exception {
protected Poll makePoll(ResultSet rs) throws SQLException {
protected Poll makePoll(ResultSet rs) throws Exception { Poll poll = new Poll(); poll.setId(rs.getInt("vote_id")); poll.setTopicId(rs.getInt("topic_id")); poll.setLabel(rs.getString("vote_text")); poll.setStartTime(new Date(rs.getTimestamp("vote_start").getTime())); poll.setLength(rs.getInt("vote_length")); r...
protected PollOption makePollOption(ResultSet rs) throws Exception {
protected PollOption makePollOption(ResultSet rs) throws SQLException {
protected PollOption makePollOption(ResultSet rs) throws Exception { PollOption option = new PollOption(); option.setPollId(rs.getInt("vote_id")); option.setId(rs.getInt("vote_option_id")); option.setText(rs.getString("vote_option_text")); option.setVoteCount(rs.getInt("vote_result")); return option; }
public Poll selectById(int pollId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PollModel.selectById")); PreparedStatement o = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PollModel.selectOptionsByPollId")); p.se...
public Poll selectById(int pollId){ PreparedStatement p=null; PreparedStatement o=null; ResultSet ors=null; ResultSet prs=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PollModel.selectById")); p.setInt(1, pollId); prs = p.executeQuery(); Poll poll = null; if (prs.next())...
public Poll selectById(int pollId) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PollModel.selectById")); PreparedStatement o = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PollModel.selectOptionsByPollId")); ...
public void update(Poll poll) throws Exception { this.updatePoll(poll); if (poll.getChanges() != null) { this.deletePollOptions(poll.getId(), poll.getChanges().getDeletedOptions()); this.updatePollOptions(poll.getId(), poll.getChanges().getChangedOptions()); this.addNewPollOptions(poll.getId(), poll.getChanges().getNe...
public void update(Poll poll) { try { this.updatePoll(poll); if (poll.getChanges() != null) { this.deletePollOptions(poll.getId(), poll.getChanges().getDeletedOptions()); this.updatePollOptions(poll.getId(), poll.getChanges().getChangedOptions()); this.addNewPollOptions(poll.getId(), poll.getChanges().getNewOptions())...
public void update(Poll poll) throws Exception { this.updatePoll(poll); if (poll.getChanges() != null) { this.deletePollOptions(poll.getId(), poll.getChanges().getDeletedOptions()); this.updatePollOptions(poll.getId(), poll.getChanges().getChangedOptions()); this.addNewPollOptions(poll.getId(), poll.getChang...
protected void updatePoll(Poll poll) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PollModel.updatePoll"));
protected void updatePoll(Poll poll) throws SQLException { PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PollModel.updatePoll"));
protected void updatePoll(Poll poll) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PollModel.updatePoll")); p.setString(1, poll.getLabel()); p.setInt(2, poll.getLength()); p.setInt(3, poll.getId()); p.executeUpdate(); p.close(); }
p.setString(1, poll.getLabel()); p.setInt(2, poll.getLength()); p.setInt(3, poll.getId()); p.executeUpdate(); p.close(); }
p.setString(1, poll.getLabel()); p.setInt(2, poll.getLength()); p.setInt(3, poll.getId()); p.executeUpdate(); } finally { DbUtils.close(p); } }
protected void updatePoll(Poll poll) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PollModel.updatePoll")); p.setString(1, poll.getLabel()); p.setInt(2, poll.getLength()); p.setInt(3, poll.getId()); p.executeUpdate(); p.close(); }
protected void updatePollOptions(int pollId, List options) throws Exception
protected void updatePollOptions(int pollId, List options) throws SQLException
protected void updatePollOptions(int pollId, List options) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PollModel.updatePollOption")); for (Iterator iter = options.iterator(); iter.hasNext(); ) { PollOption o = (PollOption)iter.next(); ...
PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PollModel.updatePollOption")); for (Iterator iter = options.iterator(); iter.hasNext(); ) { PollOption o = (PollOption)iter.next(); p.setString(1, o.getText()); p.setInt(2, o.getId()); p.setInt(3, pollId); p.executeUp...
PreparedStatement p=null; try { p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PollModel.updatePollOption")); for (Iterator iter = options.iterator(); iter.hasNext(); ) { PollOption o = (PollOption)iter.next(); p.setString(1, o.getText()); p.setInt(2, o.getId()); p.setInt(3, pollId)...
protected void updatePollOptions(int pollId, List options) throws Exception { PreparedStatement p = JForumExecutionContext.getConnection().prepareStatement(SystemGlobals.getSql("PollModel.updatePollOption")); for (Iterator iter = options.iterator(); iter.hasNext(); ) { PollOption o = (PollOption)iter.next(); ...
public void voteOnPoll(int pollId, int optionId, int userId, String ipAddress) throws Exception {
public void voteOnPoll(int pollId, int optionId, int userId, String ipAddress) {
public void voteOnPoll(int pollId, int optionId, int userId, String ipAddress) throws Exception { Connection connection = JForumExecutionContext.getConnection(); PreparedStatement p = connection.prepareStatement(SystemGlobals.getSql("PollModel.incrementVoteCount")); PreparedStatement v = connection.prepareStateme...
PreparedStatement p = connection.prepareStatement(SystemGlobals.getSql("PollModel.incrementVoteCount")); PreparedStatement v = connection.prepareStatement(SystemGlobals.getSql("PollModel.addNewVoter")); p.setInt(1, pollId); p.setInt(2, optionId); v.setInt(1, pollId); v.setInt(2, userId); v.setString(3, ipAddress); p...
PreparedStatement v=null; PreparedStatement p=null; try { p = connection.prepareStatement(SystemGlobals.getSql("PollModel.incrementVoteCount")); v = connection.prepareStatement(SystemGlobals.getSql("PollModel.addNewVoter")); p.setInt(1, pollId); p.setInt(2, optionId); v.setInt(1, pollId); v.setInt(2, userId); v.setSt...
public void voteOnPoll(int pollId, int optionId, int userId, String ipAddress) throws Exception { Connection connection = JForumExecutionContext.getConnection(); PreparedStatement p = connection.prepareStatement(SystemGlobals.getSql("PollModel.incrementVoteCount")); PreparedStatement v = connection.prepareStateme...
public boolean hasUserVotedOnPoll(int pollId, int userId) throws Exception;
public boolean hasUserVotedOnPoll(int pollId, int userId) ;
public boolean hasUserVotedOnPoll(int pollId, int userId) throws Exception;
destFile = FileTestUtils.createUniqueFile( this );
destFile = FileTestUtils.createUniqueFile( getName() );
protected void getFile() throws Exception { message( "Getting test artifact from test repository " + testRepository ); Wagon wagon = getWagon(); wagon.addTransferListener( checksumObserver ); wagon.connect( testRepository ); destFile = FileTestUtils.createUniqueFile( th...
this.response.setHeader("Content-Disposition", "attachment; filename=\"" + ViewCommon.toUtf8String(a.getInfo().getRealFilename()) + "\";");
if (this.request.getHeader("User-Agent").indexOf("Firefox") != -1) { this.response.setHeader("Content-Disposition", "attachment; filename=\"" + new String(a.getInfo().getRealFilename().getBytes(SystemGlobals.getValue(ConfigKeys.ENCODING)), SystemGlobals.getValue(ConfigKeys.DEFAULT_CONTAINER_ENCODING)) + "\";"); } else ...
public void downloadAttach() throws Exception { if (SecurityRepository.canAccess(SecurityConstants.PERM_ATTACHMENTS_ENABLED) && !SecurityRepository.canAccess(SecurityConstants.PERM_ATTACHMENTS_DOWNLOAD)) { this.setTemplateName(TemplateKeys.POSTS_CANNOT_DOWNLOAD); this.context.put("message", I18n.getMessage("A...
stacktop.objs.add(child);
stackTop.objs.add(child);
public void characters(char[] ch, int start, int len) { String child = new String(ch, start, len); stacktop.objs.add(child); }
String[] lineDelimiters = mEditor.getDocument().getLegalLineDelimiters(); String newline = lineDelimiters.length == 0 ? "\n" : lineDelimiters[0];
String newline = TextUtilities.getDefaultLineDelimiter(mEditor.getDocument());
public void run() { String[] lineDelimiters = mEditor.getDocument().getLegalLineDelimiters(); String newline = lineDelimiters.length == 0 ? "\n" : lineDelimiters[0]; mEditor.insertText(0, Comments.createHeaderComment(newline)); mEditor.setPoint(8 + newline.length()); }
public void execute(Task task) throws InterruptedException
public void execute(Task task)
public void execute(Task task) throws InterruptedException { if (SystemGlobals.getBoolValue(ConfigKeys.BACKGROUND_TASKS)) { queue.put(task); synchronized(lock) { if(currentThread == null) { logger.info("Creating a new thread..."); currentThread = new Thread(new WorkerThread(), "jforum"); curr...
queue.put(task); synchronized(lock) {
try { queue.put(task); } catch (InterruptedException e) { String es = "Erorr execute()"; logger.error(es, e); throw new RuntimeException(es, e); } synchronized(lock) {
public void execute(Task task) throws InterruptedException { if (SystemGlobals.getBoolValue(ConfigKeys.BACKGROUND_TASKS)) { queue.put(task); synchronized(lock) { if(currentThread == null) { logger.info("Creating a new thread..."); currentThread = new Thread(new WorkerThread(), "jforum"); curr...