rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
topic = item.getString(); t = new Topic(topic); if (t.isReadOnlyTopic(virtualWiki)) {
topicName = item.getString(); topic = WikiBase.getInstance().getHandler().lookupTopic(virtualWiki, topicName); if (topic.getReadOnly()) {
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { FileUpload upload = new FileUpload(); String tempDir = Utilities.relativeDirIfNecessary(Environment.getValue(Environment.PROP_ATTACH_TEMP_DIR)); File tempDirFile = new File(tempDir); tempDirFile.m...
StringBuffer contents = new StringBuffer(base.readRaw(virtualWiki, topic));
StringBuffer contents = new StringBuffer(base.readRaw(virtualWiki, topicName));
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { FileUpload upload = new FileUpload(); String tempDir = Utilities.relativeDirIfNecessary(Environment.getValue(Environment.PROP_ATTACH_TEMP_DIR)); File tempDirFile = new File(tempDir); tempDirFile.m...
Change change = new Change(virtualWiki, topic, user, new java.util.Date());
Change change = new Change(virtualWiki, topicName, user, new java.util.Date());
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { FileUpload upload = new FileUpload(); String tempDir = Utilities.relativeDirIfNecessary(Environment.getValue(Environment.PROP_ATTACH_TEMP_DIR)); File tempDirFile = new File(tempDir); tempDirFile.m...
base.write(virtualWiki, contents.toString(), topic, user, request.getRemoteAddr());
base.write(virtualWiki, contents.toString(), topicName, user, request.getRemoteAddr());
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { FileUpload upload = new FileUpload(); String tempDir = Utilities.relativeDirIfNecessary(Environment.getValue(Environment.PROP_ATTACH_TEMP_DIR)); File tempDirFile = new File(tempDir); tempDirFile.m...
base.unlockTopic(virtualWiki, topic);
base.unlockTopic(virtualWiki, topicName);
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { FileUpload upload = new FileUpload(); String tempDir = Utilities.relativeDirIfNecessary(Environment.getValue(Environment.PROP_ATTACH_TEMP_DIR)); File tempDirFile = new File(tempDir); tempDirFile.m...
next.append(topic);
next.append(topicName);
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { FileUpload upload = new FileUpload(); String tempDir = Utilities.relativeDirIfNecessary(Environment.getValue(Environment.PROP_ATTACH_TEMP_DIR)); File tempDirFile = new File(tempDir); tempDirFile.m...
pageInfo.setAction(WikiPageInfo.ACTION_MOVE);
private void move(HttpServletRequest request, ModelAndView next, WikiPageInfo pageInfo) throws Exception { String virtualWiki = JAMWikiServlet.getVirtualWikiFromURI(request); String topicName = JAMWikiServlet.getTopicFromRequest(request); if (!StringUtils.hasText(topicName)) { throw new WikiException(new WikiMess...
pageInfo.setAction(WikiPageInfo.ACTION_MOVE);
private void move(HttpServletRequest request, ModelAndView next, WikiPageInfo pageInfo) throws Exception { String virtualWiki = JAMWikiServlet.getVirtualWikiFromURI(request); String topicName = JAMWikiServlet.getTopicFromRequest(request); if (!StringUtils.hasText(topicName)) { throw new WikiException(new WikiMess...
setBooleanProperty(props, request, Environment.PROP_PARSER_ALLOW_TEMPLATES);
private void properties(HttpServletRequest request, ModelAndView next, WikiPageInfo pageInfo) throws Exception { Properties props = new Properties(); try { setProperty(props, request, Environment.PROP_BASE_DEFAULT_TOPIC); setProperty(props, request, Environment.PROP_BASE_LOGO_IMAGE); setBooleanProperty(props, ...
getFlowCtx().start(new CompanyEditWidget(id), null, null);
getFlowCtx().start(new CompanyEditWidget(id), null, new FlowContext.Handler() { public void onFinish(Object returnValue) throws Exception { log.debug("Company added with Id of " + returnValue + " sucessfully"); refreshList(); } public void onCancel() throws Exception { } } );
public void handleEventEdit(String eventParameter) throws Exception { log.debug("Event 'edit' received!"); Long id = ((CompanyMO) this.list.getRowFromRequestId(eventParameter)).getId(); log.debug("Company selected with Id of " + id); getFlowCtx().start(new CompanyEditWidget(id), null, null); }
getContractDAO().removeByCompanyId(id);
public void handleEventRemove(String eventParameter) throws Exception { log.debug("Event 'remove' received!"); Long id = ((CompanyMO) this.list.getRowFromRequestId(eventParameter)).getId(); getGeneralDAO().remove(CompanyMO.class, id); refreshList(); log.debug("Company with Id of " + id + " removed suce...
getFlowCtx().start(new CompanyEditWidget(id), null, null);
getFlowCtx().start(new CompanyEditWidget(id), null, new FlowContext.Handler() { public void onFinish(Object returnValue) throws Exception { log.debug("Company added with Id of " + returnValue + " sucessfully"); refreshList(); } public void onCancel() throws Exception { } });
public void handleEventSelect(String eventParameter) throws Exception { log.debug("Event 'select' received!"); Long id = ((CompanyMO) this.list.getRowFromRequestId(eventParameter)).getId(); log.debug("Company selected with Id of " + id); if (editMode) getFlowCtx().start(new CompanyEditWidget(id), nul...
String topic = null;
String topic = text;
private static String parseTopic(String text) { String topic = null; int pos = text.indexOf('#'); if (pos > 0) { topic = text.substring(0, pos).trim(); } pos = text.indexOf('?'); if (pos > 0) { topic = text.substring(0, pos).trim(); } return topic; }
WikiBase.initialise(request.getLocale(), null);
WikiBase.initialise(request.getLocale(), user);
private void addVirtualWiki(HttpServletRequest request, ModelAndView next) throws Exception { String newWiki = request.getParameter("newVirtualWiki"); this.pageInfo.setPageAction(JAMWikiServlet.ACTION_ADMIN); this.pageInfo.setSpecial(true); this.pageInfo.setPageTitle("Special:Admin"); try { logger.debug("Adding...
logger.info("Rolling back database transactions");
logger.warn("Rolling back database transactions");
protected void handleErrors(Object[] params) { if (params == null) return; try { logger.info("Rolling back database transactions"); Connection conn = (Connection)params[0]; conn.rollback(); } catch (Exception e) { logger.error("Unable to rollback connection", e); } }
if (topic.getAdminOnly()) { if (!Utilities.isAdmin(request)) { next.addObject(JAMWikiServlet.PARAMETER_TITLE, Utilities.getMessage("login.title", request.getLocale())); String redirect = Utilities.buildInternalLink(request.getContextPath(), virtualWiki, "Special:Edit"); next.addObject("redirect", redirect); this.pageIn...
if (topic.getAdminOnly() && !Utilities.isAdmin(request)) { next.addObject("errorMessage", "Editing administrative topics requires login"); viewLogin(request, next, JAMWikiServlet.getTopicFromURI(request)); return;
private void edit(HttpServletRequest request, ModelAndView next) throws Exception { request.getSession().setMaxInactiveInterval(60 * Environment.getIntValue(Environment.PROP_TOPIC_EDIT_TIME_OUT)); String topicName = JAMWikiServlet.getTopicFromRequest(request); if (!StringUtils.hasText(topicName)) { // FIXME - har...
next.addObject("errorMessage", "Editing a topic requires login");
public ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) { ModelAndView next = new ModelAndView("wiki"); try { if (mustLogin(request)) { viewLogin(request, next, JAMWikiServlet.getTopicFromURI(request)); } else if (isSave(request)) { save(request, next); } else ...
if (user.getUserId() > 0 && WikiBase.getHandler().lookupWikiUser(user.getLogin(), oldPassword, false) == null) {
if (user.getUserId() > 0 && WikiBase.getHandler().lookupWikiUser(user.getLogin(), oldPassword) == null) {
private Vector validate(HttpServletRequest request, WikiUser user) throws Exception { Vector errors = new Vector(); try { Utilities.validateUserName(user.getLogin()); } catch (WikiException e) { errors.add(e.getWikiMessage()); } String oldPassword = request.getParameter("oldPassword"); if (user.getUserId() >...
setupSpecialPage(virtualWiki, Utilities.getMessage("specialpages.startingpoints", locale), user); setupSpecialPage(virtualWiki, Utilities.getMessage("specialpages.leftMenu", locale), user); setupSpecialPage(virtualWiki, Utilities.getMessage("specialpages.topArea", locale), user); setupSpecialPage(virtualWiki, Utilities...
setupSpecialPage(virtualWiki, Utilities.getMessage("specialpages.startingpoints", locale), user, false); setupSpecialPage(virtualWiki, Utilities.getMessage("specialpages.leftMenu", locale), user, true); setupSpecialPage(virtualWiki, Utilities.getMessage("specialpages.topArea", locale), user, true); setupSpecialPage(vir...
public void initialize(Locale locale, WikiUser user) throws Exception { if (!Environment.getBooleanValue(Environment.PROP_BASE_INITIALIZED)) { return; } Collection all = getVirtualWikiList(); if (user != null && user.getUserId() < 1) addWikiUser(user); for (Iterator iterator = all.iterator(); iterator.hasNext()...
protected void setupSpecialPage(String virtualWiki, String topicName, WikiUser user) throws Exception {
protected void setupSpecialPage(String virtualWiki, String topicName, WikiUser user, boolean adminOnly) throws Exception {
protected void setupSpecialPage(String virtualWiki, String topicName, WikiUser user) throws Exception { if (exists(virtualWiki, topicName)) { return; } String baseFileDir = Environment.getValue(Environment.PROP_BASE_FILE_DIR); if (!StringUtils.hasText(baseFileDir)) { // do not set up special pages until initia...
topic.setAdminOnly(adminOnly);
protected void setupSpecialPage(String virtualWiki, String topicName, WikiUser user) throws Exception { if (exists(virtualWiki, topicName)) { return; } String baseFileDir = Environment.getValue(Environment.PROP_BASE_FILE_DIR); if (!StringUtils.hasText(baseFileDir)) { // do not set up special pages until initia...
topic + "&action=" + WikiServlet.ACTION_HISTORY + "&type=all")
topic + "&action=" + JAMController.ACTION_HISTORY + "&type=all")
private void rss(HttpServletRequest request, HttpServletResponse response, ModelAndView next) throws Exception { String topic = JAMController.getTopicFromRequest(request); String virtualWiki = JAMController.getVirtualWikiFromURI(request); try { // get the latest pages int howManyDatesToGoBack = Environment.getI...
if (!Utilities.isAdmin(request)) { WikiMessage errorMessage = new WikiMessage("admin.message.loginrequired"); return ServletUtil.viewLogin(request, pageInfo, "Special:Admin", errorMessage); }
protected ModelAndView handleJAMWikiRequest(HttpServletRequest request, HttpServletResponse response, ModelAndView next, WikiPageInfo pageInfo) throws Exception { if (!Utilities.isAdmin(request)) { WikiMessage errorMessage = new WikiMessage("admin.message.loginrequired"); return ServletUtil.viewLogin(request, pag...
return files;
Vector temp = new Vector(); for (int i=0; i < files.length; i++) { if (files[i].isDirectory()) continue; temp.add(files[i]); } File[] results = new File[temp.size()]; for (int i=0; i < temp.size(); i++) { results[i] = (File)temp.elementAt(i); } return results;
private File[] retrieveCategoryFiles(String virtualWiki) throws Exception { File file = FileHandler.getPathFor(virtualWiki, null, FileHandler.CATEGORIES_DIR); File[] files = file.listFiles(); return files; }
Collection allWikis = WikiBase.getDataHandler().getVirtualWikiList();
Collection allWikis = WikiBase.getDataHandler().getVirtualWikiList(null);
public synchronized void refreshIndex() throws Exception { Collection allWikis = WikiBase.getDataHandler().getVirtualWikiList(); Topic topic; for (Iterator iterator = allWikis.iterator(); iterator.hasNext();) { long start = System.currentTimeMillis(); int count = 0; VirtualWiki virtualWiki = (VirtualWiki)iter...
next.addObject(WikiServlet.PARAMETER_ACTION, WikiServlet.ACTION_LOCKLIST); next.addObject(WikiServlet.PARAMETER_SPECIAL, new Boolean(true));
next.addObject(JAMController.PARAMETER_ACTION, JAMController.ACTION_LOCKLIST); next.addObject(JAMController.PARAMETER_SPECIAL, new Boolean(true));
private void lockList(HttpServletRequest request, ModelAndView next) throws Exception { String topic = JAMController.getTopicFromRequest(request); String virtualWiki = JAMController.getVirtualWikiFromURI(request); List locks = null; try { locks = WikiBase.getInstance().getHandler().getLockList(virtualWiki); } c...
next.addObject(WikiServlet.PARAMETER_ACTION, WikiServlet.ACTION_LOGIN); next.addObject(WikiServlet.PARAMETER_SPECIAL, new Boolean(true));
next.addObject(JAMController.PARAMETER_ACTION, JAMController.ACTION_LOGIN); next.addObject(JAMController.PARAMETER_SPECIAL, new Boolean(true));
private void unlock(HttpServletRequest request, ModelAndView next) throws Exception { String topic = JAMController.getTopicFromRequest(request); String virtualWiki = JAMController.getVirtualWikiFromURI(request); if (!Utilities.isAdmin(request)) { String redirect = Utilities.buildInternalLink(request.getContextPat...
stmt.setInt(7, (topic.getDeleted() ? 1 : 0)); stmt.setInt(8, (topic.getAdminOnly() ? 1 : 0));
public void insertTopic(Topic topic) throws Exception { int virtualWikiId = DatabaseHandler.lookupVirtualWikiId(topic.getVirtualWiki()); WikiPreparedStatement stmt = new WikiPreparedStatement(STATEMENT_INSERT_TOPIC); stmt.setInt(1, topic.getTopicId()); stmt.setInt(2, virtualWikiId); stmt.setString(3, topic.getNam...
BufferedImage image = (BufferedImage)WikiCache.retrieveFromCache(CACHE_IMAGES, key); if (image != null) return image;
Element cacheElement = WikiCache.retrieveFromCache(CACHE_IMAGES, key); if (cacheElement != null) { return (BufferedImage)cacheElement.getObjectValue(); }
private static BufferedImage loadImage(File file) throws Exception { String key = file.getPath(); BufferedImage image = (BufferedImage)WikiCache.retrieveFromCache(CACHE_IMAGES, key); if (image != null) return image; FileInputStream fis = null; try { fis = new FileInputStream(file); image = ImageIO.read(fis); ...
WikiPreparedStatement stmt = new WikiPreparedStatement(STATEMENT_SELECT_CATEGORIES);
String sql = formatStatement(STATEMENT_SELECT_CATEGORIES, pagination); WikiPreparedStatement stmt = new WikiPreparedStatement(sql);
public WikiResultSet getCategories(int virtualWikiId, Pagination pagination) throws Exception { WikiPreparedStatement stmt = new WikiPreparedStatement(STATEMENT_SELECT_CATEGORIES); stmt.setInt(1, virtualWikiId); stmt.setInt(2, pagination.getEnd()); stmt.setInt(3, pagination.getNumResults()); return stmt.executeQu...
stmt.setInt(2, pagination.getEnd()); stmt.setInt(3, pagination.getNumResults());
public WikiResultSet getCategories(int virtualWikiId, Pagination pagination) throws Exception { WikiPreparedStatement stmt = new WikiPreparedStatement(STATEMENT_SELECT_CATEGORIES); stmt.setInt(1, virtualWikiId); stmt.setInt(2, pagination.getEnd()); stmt.setInt(3, pagination.getNumResults()); return stmt.executeQu...
WikiPreparedStatement stmt = new WikiPreparedStatement(STATEMENT_SELECT_RECENT_CHANGES);
String sql = formatStatement(STATEMENT_SELECT_RECENT_CHANGES, pagination); WikiPreparedStatement stmt = new WikiPreparedStatement(sql);
public WikiResultSet getRecentChanges(String virtualWiki, Pagination pagination, boolean descending) throws Exception { WikiPreparedStatement stmt = new WikiPreparedStatement(STATEMENT_SELECT_RECENT_CHANGES); stmt.setString(1, virtualWiki); stmt.setInt(2, pagination.getEnd()); stmt.setInt(3, pagination.getNumResul...
stmt.setInt(2, pagination.getEnd()); stmt.setInt(3, pagination.getNumResults());
public WikiResultSet getRecentChanges(String virtualWiki, Pagination pagination, boolean descending) throws Exception { WikiPreparedStatement stmt = new WikiPreparedStatement(STATEMENT_SELECT_RECENT_CHANGES); stmt.setString(1, virtualWiki); stmt.setInt(2, pagination.getEnd()); stmt.setInt(3, pagination.getNumResul...
WikiPreparedStatement stmt = null;
String sql = null;
public WikiResultSet getUserContributions(String virtualWiki, String userString, Pagination pagination, boolean descending) throws Exception { WikiPreparedStatement stmt = null; if (Utilities.isIpAddress(userString)) { stmt = new WikiPreparedStatement(STATEMENT_SELECT_WIKI_USER_CHANGES_ANONYMOUS); } else { stmt...
stmt = new WikiPreparedStatement(STATEMENT_SELECT_WIKI_USER_CHANGES_ANONYMOUS);
sql = formatStatement(STATEMENT_SELECT_WIKI_USER_CHANGES_ANONYMOUS, pagination);
public WikiResultSet getUserContributions(String virtualWiki, String userString, Pagination pagination, boolean descending) throws Exception { WikiPreparedStatement stmt = null; if (Utilities.isIpAddress(userString)) { stmt = new WikiPreparedStatement(STATEMENT_SELECT_WIKI_USER_CHANGES_ANONYMOUS); } else { stmt...
stmt = new WikiPreparedStatement(STATEMENT_SELECT_WIKI_USER_CHANGES_LOGIN);
sql = formatStatement(STATEMENT_SELECT_WIKI_USER_CHANGES_LOGIN, pagination);
public WikiResultSet getUserContributions(String virtualWiki, String userString, Pagination pagination, boolean descending) throws Exception { WikiPreparedStatement stmt = null; if (Utilities.isIpAddress(userString)) { stmt = new WikiPreparedStatement(STATEMENT_SELECT_WIKI_USER_CHANGES_ANONYMOUS); } else { stmt...
stmt.setInt(3, pagination.getEnd()); stmt.setInt(4, pagination.getNumResults());
public WikiResultSet getUserContributions(String virtualWiki, String userString, Pagination pagination, boolean descending) throws Exception { WikiPreparedStatement stmt = null; if (Utilities.isIpAddress(userString)) { stmt = new WikiPreparedStatement(STATEMENT_SELECT_WIKI_USER_CHANGES_ANONYMOUS); } else { stmt...
WikiPreparedStatement stmt = new WikiPreparedStatement(STATEMENT_SELECT_TOPIC_BY_TYPE);
String sql = formatStatement(STATEMENT_SELECT_TOPIC_BY_TYPE, pagination); WikiPreparedStatement stmt = new WikiPreparedStatement(sql);
public WikiResultSet lookupTopicByType(int virtualWikiId, int topicType, Pagination pagination) throws Exception { WikiPreparedStatement stmt = new WikiPreparedStatement(STATEMENT_SELECT_TOPIC_BY_TYPE); stmt.setInt(1, virtualWikiId); stmt.setInt(2, topicType); stmt.setInt(3, pagination.getEnd()); stmt.setInt(4, p...
stmt.setInt(3, pagination.getEnd()); stmt.setInt(4, pagination.getNumResults());
public WikiResultSet lookupTopicByType(int virtualWikiId, int topicType, Pagination pagination) throws Exception { WikiPreparedStatement stmt = new WikiPreparedStatement(STATEMENT_SELECT_TOPIC_BY_TYPE); stmt.setInt(1, virtualWikiId); stmt.setInt(2, topicType); stmt.setInt(3, pagination.getEnd()); stmt.setInt(4, p...
String[] locations = new TldLocationsCache((ServletContext) getEnvironment().getEntry(ServletContext.class)).getLocation(uri);
String[] locations = tldLocationsCache.getLocation(uri);
public Map getTagMap(String uri) { if (!taglibs.containsKey(uri)) { //XXX: little wasteful String[] locations = new TldLocationsCache((ServletContext) getEnvironment().getEntry(ServletContext.class)).getLocation(uri); if (locations != null) { String tldLoc = locations[1] == null ? locations[0...
if (tldLocationsCache == null) initTldLocationsCache((ServletContext)getEnvironment().getEntry(ServletContext.class));
protected void init() throws Exception { super.init(); loc = (LocalizationContext) getEnvironment().getEntry(LocalizationContext.class); }
public StandardFlowContextResettingMessage(StandardPresentationWidget flow) {
public StandardFlowContextResettingMessage(Widget flow) {
public StandardFlowContextResettingMessage(StandardPresentationWidget flow) { this.flow = flow; }
if (Environment.getValue(Environment.PROP_DB_TYPE).equals(WikiDatabase.DB_TYPE_MYSQL)) {
if (Environment.getValue(Environment.PROP_DB_TYPE).equals(WikiBase.DATA_HANDLER_MYSQL)) {
public static Vector upgrade031(Vector messages) throws Exception { Connection conn = null; try { // FIXME - hard coding conn = DatabaseConnection.getConnection(); conn.setAutoCommit(false); // add redirection column String sql = "alter table jam_topic add column redirect_to VARCHAR(200) "; DatabaseConne...
} else if (Environment.getValue(Environment.PROP_DB_TYPE).equals(WikiDatabase.DB_TYPE_MSSQL)) {
} else if (Environment.getValue(Environment.PROP_DB_TYPE).equals(WikiBase.DATA_HANDLER_MSSQL)) {
public static Vector upgrade031(Vector messages) throws Exception { Connection conn = null; try { // FIXME - hard coding conn = DatabaseConnection.getConnection(); conn.setAutoCommit(false); // add redirection column String sql = "alter table jam_topic add column redirect_to VARCHAR(200) "; DatabaseConne...
if (!Environment.getValue(Environment.PROP_DB_TYPE).equals(WikiDatabase.DB_TYPE_MYSQL)) {
if (!Environment.getValue(Environment.PROP_DB_TYPE).equals(WikiBase.DATA_HANDLER_MYSQL)) {
public static Vector upgrade031(Vector messages) throws Exception { Connection conn = null; try { // FIXME - hard coding conn = DatabaseConnection.getConnection(); conn.setAutoCommit(false); // add redirection column String sql = "alter table jam_topic add column redirect_to VARCHAR(200) "; DatabaseConne...
expr.add(new OrExpression().add( new GreaterThanExpression(startVar, startVal)).add( new EqualsExpression(startVar, startVal))); expr.add(new OrExpression().add( new LowerThanExpression(endVar, endVal)).add( new EqualsExpression(endVar, endVal)));
if (startVar != null && startVal != null) { expr.add(new OrExpression().add( new GreaterThanExpression(startVar, startVal)).add( new EqualsExpression(startVar, startVal))); } if (endVar != null && endVal != null) { expr.add(new OrExpression().add( new LowerThanExpression(endVar, endVal)).add( new EqualsExpression(endVa...
protected Expression buildAction(Expression startVar, Expression endVar, Expression startVal, Expression endVal) { AndExpression expr = new AndExpression(); expr.add(new OrExpression().add( new GreaterThanExpression(startVar, startVal)).add( new EqualsExpression(startVar, startVal))); expr.add(new ...
return new AndExpression().add( new GreaterThanExpression(startVar, startVal)).add( new LowerThanExpression(endVar, endVal));
AndExpression expr = new AndExpression(); if (startVar != null && startVal != null) { expr.add(new GreaterThanExpression(startVar, startVal)); } if (endVar != null && endVal != null) { expr.add(new LowerThanExpression(endVar, endVal)); } return expr;
protected Expression buildAction(Expression startVar, Expression endVar, Expression startVal, Expression endVal) { return new AndExpression().add( new GreaterThanExpression(startVar, startVal)).add( new LowerThanExpression(endVar, endVal)); }
expr.add(new OrExpression().add( new LowerThanExpression(startVar, endVal)).add( new EqualsExpression(startVar, endVal))); expr.add(new OrExpression().add( new GreaterThanExpression(endVar, startVal)).add( new EqualsExpression(endVar, startVal)));
if (startVar != null && endVal != null) { expr.add(new OrExpression().add( new LowerThanExpression(startVar, endVal)).add( new EqualsExpression(startVar, endVal))); } if (endVar != null && startVal != null) { expr.add(new OrExpression().add( new GreaterThanExpression(endVar, startVal)).add( new EqualsExpression(endVar,...
protected Expression buildAction(Expression startVar, Expression endVar, Expression startVal, Expression endVal) { AndExpression expr = new AndExpression(); expr.add(new OrExpression().add( new LowerThanExpression(startVar, endVal)).add( new EqualsExpression(startVar, endVal))); expr.add(new OrExpr...
return new AndExpression().add( new LowerThanExpression(startVar, endVal)).add( new GreaterThanExpression(endVar, startVal));
AndExpression expr = new AndExpression(); if (startVar != null && endVal != null) { expr.add(new LowerThanExpression(startVar, endVal)); } if (endVar != null && startVal != null) { expr.add(new GreaterThanExpression(endVar, startVal)); } return expr;
protected Expression buildAction(Expression startVar, Expression endVar, Expression startVal, Expression endVal) { return new AndExpression().add( new LowerThanExpression(startVar, endVal)).add( new GreaterThanExpression(endVar, startVal)); }
expr.add(new OrExpression().add( new LowerThanExpression(startVar, startVal)).add( new EqualsExpression(startVar, startVal))); expr.add(new OrExpression().add( new GreaterThanExpression(endVar, endVal)).add( new EqualsExpression(endVar, endVal)));
if (startVar != null && startVal != null) { expr.add(new OrExpression().add( new LowerThanExpression(startVar, startVal)).add( new EqualsExpression(startVar, startVal))); } if (endVar != null && endVal != null) { expr.add(new OrExpression().add( new GreaterThanExpression(endVar, endVal)).add( new EqualsExpression(endVa...
protected Expression buildAction(Expression startVar, Expression endVar, Expression startVal, Expression endVal) { AndExpression expr = new AndExpression(); expr.add(new OrExpression().add( new LowerThanExpression(startVar, startVal)).add( new EqualsExpression(startVar, startVal))); expr.add(new Or...
return new AndExpression().add( new LowerThanExpression(startVar, startVal)).add( new GreaterThanExpression(endVar, endVal));
AndExpression expr = new AndExpression(); if (startVar != null && startVal != null) { expr.add(new LowerThanExpression(startVar, startVal)); } if (endVar != null && endVal != null) { expr.add(new GreaterThanExpression(endVar, endVal)); } return expr;
protected Expression buildAction(Expression startVar, Expression endVar, Expression startVal, Expression endVal) { return new AndExpression().add( new LowerThanExpression(startVar, startVal)).add( new GreaterThanExpression(endVar, endVal)); }
private void allTopics(HttpServletRequest request, ModelAndView next) throws Exception {
private void allTopics(HttpServletRequest request, ModelAndView next, WikiPageInfo pageInfo) throws Exception {
private void allTopics(HttpServletRequest request, ModelAndView next) throws Exception { String virtualWiki = JAMWikiServlet.getVirtualWikiFromURI(request); Collection all = WikiBase.getHandler().getAllTopicNames(virtualWiki); next.addObject("all", all); next.addObject("topicCount", new Integer(all.size())); this...
this.pageInfo.setPageTitle(new WikiMessage("alltopics.title")); this.pageInfo.setPageAction(JAMWikiServlet.ACTION_ALL_TOPICS); this.pageInfo.setSpecial(true);
pageInfo.setPageTitle(new WikiMessage("alltopics.title")); pageInfo.setPageAction(JAMWikiServlet.ACTION_ALL_TOPICS); pageInfo.setSpecial(true);
private void allTopics(HttpServletRequest request, ModelAndView next) throws Exception { String virtualWiki = JAMWikiServlet.getVirtualWikiFromURI(request); Collection all = WikiBase.getHandler().getAllTopicNames(virtualWiki); next.addObject("all", all); next.addObject("topicCount", new Integer(all.size())); this...
allTopics(request, next);
allTopics(request, next, pageInfo);
public ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) { ModelAndView next = new ModelAndView("wiki"); try { if (isTopic(request, "Special:AllTopics")) { allTopics(request, next); } else { viewTopic(request, next); } } catch (Exception e) { viewError(reques...
viewTopic(request, next);
viewTopic(request, next, pageInfo);
public ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) { ModelAndView next = new ModelAndView("wiki"); try { if (isTopic(request, "Special:AllTopics")) { allTopics(request, next); } else { viewTopic(request, next); } } catch (Exception e) { viewError(reques...
viewError(request, next, e);
return viewError(request, e);
public ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) { ModelAndView next = new ModelAndView("wiki"); try { if (isTopic(request, "Special:AllTopics")) { allTopics(request, next); } else { viewTopic(request, next); } } catch (Exception e) { viewError(reques...
loadDefaults(request, next, this.pageInfo);
loadDefaults(request, next, pageInfo);
public ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) { ModelAndView next = new ModelAndView("wiki"); try { if (isTopic(request, "Special:AllTopics")) { allTopics(request, next); } else { viewTopic(request, next); } } catch (Exception e) { viewError(reques...
private void viewTopic(HttpServletRequest request, ModelAndView next) throws Exception {
private void viewTopic(HttpServletRequest request, ModelAndView next, WikiPageInfo pageInfo) throws Exception {
private void viewTopic(HttpServletRequest request, ModelAndView next) throws Exception { String topic = JAMWikiServlet.getTopicFromURI(request); if (!StringUtils.hasText(topic)) { String virtualWikiName = getVirtualWikiFromURI(request); VirtualWiki virtualWiki = WikiBase.getHandler().lookupVirtualWiki(virtualWik...
super.viewTopic(request, next, topic);
super.viewTopic(request, next, pageInfo, topic);
private void viewTopic(HttpServletRequest request, ModelAndView next) throws Exception { String topic = JAMWikiServlet.getTopicFromURI(request); if (!StringUtils.hasText(topic)) { String virtualWikiName = getVirtualWikiFromURI(request); VirtualWiki virtualWiki = WikiBase.getHandler().lookupVirtualWiki(virtualWik...
return "<a title=\"" + text + "\" href=\"" + url + "\">" + text + "</a>";
String css = ""; if (!WikiBase.exists(virtualWiki, topic)) { css = " class=\"edit\""; } return "<a title=\"" + text + "\" href=\"" + url + "\"" + css + ">" + text + "</a>";
protected static String buildWikiLink(String context, String virtualWiki, String raw) { try { if (raw == null || raw.length() <= 4) { // no topic, display the raw text return raw; } // strip the first and last brackets String topic = raw.substring(2, raw.length() - 2).trim(); if (topic.length() <= 0) ...
loader = Environment.class.getClassLoader();
private static URL getURL(String filename) { Method method = null; ClassLoader loader = null; URL url = null; try { // first try to use the standard class loader path method = Thread.class.getMethod("getContextClassLoader", null); } catch (NoSuchMethodException e) { logger.error("Error while searching for r...
url = loader.getResource(filename); if (url != null) return url;
url = loader.getResource("/"); if (url != null) { try { return new URL(url.toString() + filename); } catch (Exception e) { logger.warn("Could not build URL for " + filename); } }
private static URL getURL(String filename) { Method method = null; ClassLoader loader = null; URL url = null; try { // first try to use the standard class loader path method = Thread.class.getMethod("getContextClassLoader", null); } catch (NoSuchMethodException e) { logger.error("Error while searching for r...
if (topic.isReadOnlyTopic(virtualWiki)) {
if (topic.getReadOnly()) {
private void edit(HttpServletRequest request, ModelAndView next) throws Exception { request.getSession().setMaxInactiveInterval(60 * Environment.getIntValue(Environment.PROP_TOPIC_EDIT_TIME_OUT)); String topicName = JAMController.getTopicFromRequest(request); if (topicName == null || topicName.length() == 0) { //...
if (WikiBase.getInstance().isAdminOnlyTopic(request.getLocale(), virtualWiki, topicName)) {
if (topic.getAdminOnly()) {
private void edit(HttpServletRequest request, ModelAndView next) throws Exception { request.getSession().setMaxInactiveInterval(60 * Environment.getIntValue(Environment.PROP_TOPIC_EDIT_TIME_OUT)); String topicName = JAMController.getTopicFromRequest(request); if (topicName == null || topicName.length() == 0) { //...
String topic = request.getParameter(JAMController.PARAMETER_TOPIC);
String topicName = request.getParameter(JAMController.PARAMETER_TOPIC);
private void save(HttpServletRequest request, ModelAndView next) throws Exception { // a save request has been made WikiBase.removeCachedContents(); String topic = request.getParameter(JAMController.PARAMETER_TOPIC); String virtualWiki = JAMController.getVirtualWikiFromURI(request); String user = request.getRemot...
if (topic == null) {
if (topicName == null) {
private void save(HttpServletRequest request, ModelAndView next) throws Exception { // a save request has been made WikiBase.removeCachedContents(); String topic = request.getParameter(JAMController.PARAMETER_TOPIC); String virtualWiki = JAMController.getVirtualWikiFromURI(request); String user = request.getRemot...
Topic t = new Topic(topic); if (t.isReadOnlyTopic(virtualWiki)) { logger.warn("The topic " + topic + " is read only and cannot be saved");
Topic topic = WikiBase.getInstance().getHandler().lookupTopic(virtualWiki, topicName); if (topic == null) { topic = new Topic(); topic.setName(topicName); } if (topic.getReadOnly()) { logger.warn("The topic " + topicName + " is read only and cannot be saved");
private void save(HttpServletRequest request, ModelAndView next) throws Exception { // a save request has been made WikiBase.removeCachedContents(); String topic = request.getParameter(JAMController.PARAMETER_TOPIC); String virtualWiki = JAMController.getVirtualWikiFromURI(request); String user = request.getRemot...
throw new Exception("The topic " + topic + " is read only and cannot be saved");
throw new Exception("The topic " + topicName + " is read only and cannot be saved");
private void save(HttpServletRequest request, ModelAndView next) throws Exception { // a save request has been made WikiBase.removeCachedContents(); String topic = request.getParameter(JAMController.PARAMETER_TOPIC); String virtualWiki = JAMController.getVirtualWikiFromURI(request); String user = request.getRemot...
if (!WikiBase.getInstance().holdsLock(virtualWiki, topic, key)) { logger.warn("The lock on " + topic + " has timed out");
if (!WikiBase.getInstance().holdsLock(virtualWiki, topicName, key)) { logger.warn("The lock on " + topicName + " has timed out");
private void save(HttpServletRequest request, ModelAndView next) throws Exception { // a save request has been made WikiBase.removeCachedContents(); String topic = request.getParameter(JAMController.PARAMETER_TOPIC); String virtualWiki = JAMController.getVirtualWikiFromURI(request); String user = request.getRemot...
throw new Exception("The lock on " + topic + " has timed out");
throw new Exception("The lock on " + topicName + " has timed out");
private void save(HttpServletRequest request, ModelAndView next) throws Exception { // a save request has been made WikiBase.removeCachedContents(); String topic = request.getParameter(JAMController.PARAMETER_TOPIC); String virtualWiki = JAMController.getVirtualWikiFromURI(request); String user = request.getRemot...
logger.warn("The topic " + topic + " has no content");
logger.warn("The topic " + topicName + " has no content");
private void save(HttpServletRequest request, ModelAndView next) throws Exception { // a save request has been made WikiBase.removeCachedContents(); String topic = request.getParameter(JAMController.PARAMETER_TOPIC); String virtualWiki = JAMController.getVirtualWikiFromURI(request); String user = request.getRemot...
throw new Exception("The topic " + topic + " has no content");
throw new Exception("The topic " + topicName + " has no content");
private void save(HttpServletRequest request, ModelAndView next) throws Exception { // a save request has been made WikiBase.removeCachedContents(); String topic = request.getParameter(JAMController.PARAMETER_TOPIC); String virtualWiki = JAMController.getVirtualWikiFromURI(request); String user = request.getRemot...
WikiBase.getInstance().write(virtualWiki, contents, topic, user, request.getRemoteAddr());
WikiBase.getInstance().write(virtualWiki, contents, topicName, user, request.getRemoteAddr());
private void save(HttpServletRequest request, ModelAndView next) throws Exception { // a save request has been made WikiBase.removeCachedContents(); String topic = request.getParameter(JAMController.PARAMETER_TOPIC); String virtualWiki = JAMController.getVirtualWikiFromURI(request); String user = request.getRemot...
change.setTopic(topic);
change.setTopic(topicName);
private void save(HttpServletRequest request, ModelAndView next) throws Exception { // a save request has been made WikiBase.removeCachedContents(); String topic = request.getParameter(JAMController.PARAMETER_TOPIC); String virtualWiki = JAMController.getVirtualWikiFromURI(request); String user = request.getRemot...
sedb.indexText(virtualWiki, topic, request.getParameter("contents")); WikiBase.getInstance().unlockTopic(virtualWiki, topic);
sedb.indexText(virtualWiki, topicName, request.getParameter("contents")); WikiBase.getInstance().unlockTopic(virtualWiki, topicName);
private void save(HttpServletRequest request, ModelAndView next) throws Exception { // a save request has been made WikiBase.removeCachedContents(); String topic = request.getParameter(JAMController.PARAMETER_TOPIC); String virtualWiki = JAMController.getVirtualWikiFromURI(request); String user = request.getRemot...
UiUtil.writeAttributes(out, attributes);
protected int doEndTag(Writer out) throws Exception { SelectControl.ViewModel viewModel = ((SelectControl.ViewModel)controlViewModel); UiUtil.writeOpenStartTag(out, "span"); UiUtil.writeAttribute(out, "class", getStyleClass()); UiUtil.writeAttribute(out, "style", getStyle()); UiUtil.writeCloseStartTag(out);...
if ((optstr = cli.getOptionValue("salt")) != null)
if ((optstr = cli.getOptionValue('S')) != null)
public void parseCommandLine(String[] args) throws org.apache.commons.cli.ParseException, ParseException, IOException { CommandLineParser cli_parser = new PosixParser(); CommandLine cli = cli_parser.parse(opts, args); String optstr = null; if (cli.hasOption('h')) usage(); i...
if ((optstr = cli.getOptionValue("random-salt")) != null)
if ((optstr = cli.getOptionValue('R')) != null)
public void parseCommandLine(String[] args) throws org.apache.commons.cli.ParseException, ParseException, IOException { CommandLineParser cli_parser = new PosixParser(); CommandLine cli = cli_parser.parse(opts, args); String optstr = null; if (cli.hasOption('h')) usage(); i...
.create());
.create('S'));
private void setupCLI() { opts = new Options(); // boolean options opts.addOption("h", "help", false, "Print this message."); opts.addOption("a", "verify", false, "verify generated signatures>"); opts.addOption("F", "fully-sign-keyset", false, "sign the zone ap...
.create());
.create('R'));
private void setupCLI() { opts = new Options(); // boolean options opts.addOption("h", "help", false, "Print this message."); opts.addOption("a", "verify", false, "verify generated signatures>"); opts.addOption("F", "fully-sign-keyset", false, "sign the zone ap...
if (request.getParameter("watchTopic") != null || watchlist.containsTopic(topicName)) {
if (request.getParameter("watchTopic") != null || (watchlist.containsTopic(topicName) && !isPreview(request))) {
private void loadEdit(HttpServletRequest request, ModelAndView next, WikiPageInfo pageInfo, String virtualWiki, String topicName, boolean useSection) throws Exception { pageInfo.setPageTitle(new WikiMessage("edit.title", topicName)); pageInfo.setTopicName(topicName); WikiLink wikiLink = LinkUtil.parseWikiLink(topic...
writeHtmlScriptsInclude(out, FileImporter.getImportString(srcFile, pageContext.getRequest(),
writeHtmlScriptsInclude(out, FileImportUtil.getImportString(srcFile, pageContext.getRequest(),
protected void writeContent(Writer out, String srcFile) throws Exception { writeHtmlScriptsInclude(out, FileImporter.getImportString(srcFile, pageContext.getRequest(), pageContext.getResponse())); out.write("\n"); }
} else if (action.equals(ACTION_SEARCH)) { dispatch = request.getRequestDispatcher("/SearchServlet"); dispatch.forward(request, response); return; } else if (action.equals(ACTION_SEARCH_RESULTS)) { dispatch = request.getRequestDispatcher("/SearchServlet"); dispatch.forward(request, response); return;
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { logger.debug("GET Topic: " + request.getQueryString()); PluginManager.setRealPath(request.getSession().getServletContext().getRealPath("/")); request.setAttribute("lastRequest", request.getRequestUR...
this.method = (String)evaluateNotNull("method", method, String.class);
this.method = ((String)evaluateNotNull("method", method, String.class)).toLowerCase();
public void setMethod(String method) throws JspException { this.method = (String)evaluateNotNull("method", method, String.class); if (!this.method.equals(GET_METHOD) && !this.method.equals(POST_METHOD)) throw new AraneaJspException("Wrong form method value '" + method + "'"); }
int d = (owner[i] - o_owner[i]);
int d = ((owner[i] & 0xFF) - (o_owner[i] & 0xFF));
public int compareTo(ProtoNSEC3 o) { if (o == null) return 1; byte[] o_owner = o.getOwner(); int len = owner.length < o_owner.length ? o_owner.length : owner.length; for (int i = 0; i < len; i++) { int d = (owner[i] - o_owner[i]); if (d != 0) return d; } return owner.length - o_owner.l...
} if (!Utilities.isAdmin(request)) { WikiMessage errorMessage = new WikiMessage("upgrade.caption.login"); return viewLogin(request, "Special:Admin", errorMessage);
public ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) { ModelAndView next = new ModelAndView("upgrade"); WikiPageInfo pageInfo = new WikiPageInfo(); try { if (!Utilities.isUpgrade()) { throw new WikiException(new WikiMessage("upgrade.error.notrequired")); } if ...
boolean success = true;
private void upgrade(HttpServletRequest request, ModelAndView next, WikiPageInfo pageInfo) throws Exception { Vector messages = new Vector(); WikiVersion oldVersion = new WikiVersion(Environment.getValue(Environment.PROP_BASE_WIKI_VERSION)); boolean success = true; if (oldVersion.before(0, 2, 0)) { messages.add(...
if (WikiBase.getHandler() instanceof DatabaseHandler) {
if (!Environment.getValue(Environment.PROP_BASE_PERSISTENCE_TYPE).equals("FILE")) {
private void upgrade(HttpServletRequest request, ModelAndView next, WikiPageInfo pageInfo) throws Exception { Vector messages = new Vector(); WikiVersion oldVersion = new WikiVersion(Environment.getValue(Environment.PROP_BASE_WIKI_VERSION)); boolean success = true; if (oldVersion.before(0, 2, 0)) { messages.add(...
} if (oldVersion.before(0, 4, 0)) { if (!upgrade040(request, messages)) success = false;
private void upgrade(HttpServletRequest request, ModelAndView next, WikiPageInfo pageInfo) throws Exception { Vector messages = new Vector(); WikiVersion oldVersion = new WikiVersion(Environment.getValue(Environment.PROP_BASE_WIKI_VERSION)); boolean success = true; if (oldVersion.before(0, 2, 0)) { messages.add(...
next.addObject("failure", "true");
private void upgrade(HttpServletRequest request, ModelAndView next, WikiPageInfo pageInfo) throws Exception { Vector messages = new Vector(); WikiVersion oldVersion = new WikiVersion(Environment.getValue(Environment.PROP_BASE_WIKI_VERSION)); boolean success = true; if (oldVersion.before(0, 2, 0)) { messages.add(...
url.append(FileImporter.getImportString("gfx/ico_sortup.gif")));
url.append(FileImportUtil.getImportString("gfx/ico_sortup.gif")));
public int doStartTag(Writer out) throws Exception { super.doStartTag(out); // Get system form id String systemFormId = (String)requireContextEntry(UiSystemFormTag.ID_KEY); // Get list data String listId = (String)requireContextEntry(UiListTag.LIST_FULL_ID_KEY); ListWidget.ViewModel viewModel = (ListWidg...
url.append(FileImporter.getImportString("gfx/ico_sortdown.gif")));
url.append(FileImportUtil.getImportString("gfx/ico_sortdown.gif")));
public int doStartTag(Writer out) throws Exception { super.doStartTag(out); // Get system form id String systemFormId = (String)requireContextEntry(UiSystemFormTag.ID_KEY); // Get list data String listId = (String)requireContextEntry(UiListTag.LIST_FULL_ID_KEY); ListWidget.ViewModel viewModel = (ListWidg...
this.verifyParams(parameterIndex, new Character(x));
this.verifyParams(parameterIndex);
public void setChar(int parameterIndex, char x) throws Exception { this.verifyParams(parameterIndex, new Character(x)); this.paramTypes[parameterIndex - 1] = Types.CHAR; this.params[parameterIndex - 1] = new Character(x); }
private void verifyParams(int pos, Object value) throws Exception {
private void verifyParams(int pos) throws Exception {
private void verifyParams(int pos, Object value) throws Exception { if (pos <= 0) { throw new Exception("Invalid PreparedStatement index " + pos); } }
next.addObject("categoryName", topicName); Collection subtopics = WikiBase.getHandler().lookupCategoryTopics(virtualWiki, topicName, Topic.TYPE_ARTICLE); next.addObject("subtopics", subtopics); Collection subcategories = WikiBase.getHandler().lookupCategoryTopics(virtualWiki, topicName, Topic.TYPE_CATEGORY); next.addOb...
loadCategoryContent(next, virtualWiki, topicName);
private void loadEdit(HttpServletRequest request, ModelAndView next, WikiPageInfo pageInfo, String virtualWiki, String topicName) throws Exception { pageInfo.setPageTitle(new WikiMessage("edit.title", topicName)); pageInfo.setTopicName(topicName); if (topicName.startsWith(WikiBase.NAMESPACE_CATEGORY)) { next.addO...
String topic = request.getParameter("topic");
String topic = JMController.getTopicFromRequest(request);
private void attach(HttpServletRequest request, ModelAndView next) throws Exception { String topic = request.getParameter("topic"); String virtualWiki = JMController.getVirtualWikiFromURI(request); next.addObject("title", "Attach Files to " + topic); next.addObject("topic", topic); String user = request.getRemote...
defaults.setProperty(PROP_BASE_FORCE_ENCODING, "ISO-8859-1");
private static void initDefaultProperties() { defaults = new Properties(); defaults.setProperty(PROP_BASE_COOKIE_EXPIRE, "31104000"); defaults.setProperty(PROP_BASE_DEFAULT_TOPIC, "StartingPoints"); defaults.setProperty(PROP_BASE_FILE_DIR, ""); // Tomcat assumes ISO-8859-1 in URI's. That's the reason why all Lati...
defaults.setProperty(PROP_FILE_ENCODING, "utf-8");
private static void initDefaultProperties() { defaults = new Properties(); defaults.setProperty(PROP_BASE_COOKIE_EXPIRE, "31104000"); defaults.setProperty(PROP_BASE_DEFAULT_TOPIC, "StartingPoints"); defaults.setProperty(PROP_BASE_FILE_DIR, ""); // Tomcat assumes ISO-8859-1 in URI's. That's the reason why all Lati...
conn.setAutoCommit(false);
public static Vector upgrade010(Vector messages) throws Exception { Connection conn = null; try { conn = DatabaseConnection.getConnection(); String sql = "alter table jam_virtual_wiki add column default_topic_name VARCHAR(200)"; DatabaseConnection.executeUpdate(sql, conn); sql = "update jam_virtual_wiki set ...
conn.setAutoCommit(false);
public static Vector upgrade030(Vector messages) throws Exception { Connection conn = null; try { conn = DatabaseConnection.getConnection(); String sql = "drop table jam_image"; DatabaseConnection.executeUpdate(sql, conn); // FIXME - hard coding messages.add("Dropped jam_image table"); DatabaseConnection...