Skip to content

Commit

Permalink
Changed parameter name from source to __bf:source see eXist-db/exist#228
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobi Krebs committed Apr 11, 2015
1 parent d7f21b1 commit 4177d58
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 26 deletions.
2 changes: 1 addition & 1 deletion XRX/src/main/db/utils/FileListing.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ declare function fileListing:handleFile($uri as xs:string, $contextPath as xs:st
<img src="{fn:concat($contextPath, '/bfResources/images/', $icon)}" border="0" />
</a>
<a class="textLink" title="{$fileName}" href="{fn:concat($filePath, 'db/', $path, '/', $fileLink)}" target="_blank">{$shortendFileName}</a>
<a class="sourceLink" title="view" href="{fn:concat($filePath, 'db/', $path, '/', $fileLink, '?source=true')}" target="_blank">source</a>
<a class="sourceLink" title="view" href="{fn:concat($filePath, 'db/', $path, '/', $fileLink, '?__bf:source=true')}" target="_blank">source</a>
</div>
) else (
<div class="file">
Expand Down
2 changes: 1 addition & 1 deletion build.properties.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<name>betterFORM</name>
<version>
<name>springBud</name>
<number>5.0rc10</number>
<number>5.1-Snapshot</number>
</version>
</app>
<properties>
Expand Down
4 changes: 2 additions & 2 deletions core/build.number
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit!
#Thu Sep 18 12:06:44 CEST 2014
build.number=12244
#Sat Apr 11 15:22:32 CEST 2015
build.number=12253
2 changes: 1 addition & 1 deletion core/src/main/resources/META-INF/version.info
Original file line number Diff line number Diff line change
@@ -1 +1 @@
betterFORM 5.0rc10 - buildNumber:12243 - Timestamp:2014-09-18 12:06:44
betterFORM 5.1-Snapshot - buildNumber:12252 - Timestamp:2015-04-11 15:22:32
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.betterform</groupId>
<artifactId>betterform-project</artifactId>
<version>5.0rc6</version>
<version>5.1</version>
<packaging>pom</packaging>

<name>betterForm Project</name>
Expand Down
11 changes: 3 additions & 8 deletions web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<parent>
<groupId>de.betterform</groupId>
<artifactId>betterform-project</artifactId>
<version>5.0rc6</version>
<version>5.1-Snapshot</version>
</parent>

<modelVersion>4.0.0</modelVersion>
<groupId>de.betterform</groupId>
<artifactId>betterform</artifactId>
<version>5.0rc6</version>
<version>5.1-Snapshot</version>



Expand Down Expand Up @@ -97,7 +97,7 @@
<dependency>
<groupId>de.betterform</groupId>
<artifactId>betterform-core</artifactId>
<version>5.0rc6</version>
<version>5.1-Snapshot</version>
</dependency>
<dependency>
<groupId>org.directwebremoting.dwr</groupId>
Expand Down Expand Up @@ -146,11 +146,6 @@
<version>3.1.2.GA</version>
</dependency>
<dependency>
<groupId>org.atmosphere</groupId>
<artifactId>atmosphere-runtime</artifactId>
<version>2.1.6-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.5</version>
Expand Down
27 changes: 17 additions & 10 deletions web/src/main/java/de/betterform/agent/web/filter/XFormsFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ public class XFormsFilter implements Filter {
protected String defaultRequestEncoding = "UTF-8";
private FilterConfig filterConfig;

private static final String SRCPARAMETER = "__bf:source";

/**
* Filter initialisation
*
Expand Down Expand Up @@ -137,18 +139,23 @@ public void doFilter(ServletRequest srvRequest, ServletResponse srvResponse, Fil
return;
}

if(request.getParameter("source") != null ){
srvResponse.setContentType("text/plain");
// override setContentType to keep "text/plain" as content type.
HttpServletResponseWrapper resp = new HttpServletResponseWrapper((HttpServletResponse) srvResponse) {
public void setContentType(String s) {
return;
}
};
filterChain.doFilter(srvRequest, resp);
return;
try {
if(Config.getInstance().getProperty("betterform.debug-allowed").equals("true") && request.getParameter(XFormsFilter.SRCPARAMETER) != null ) {
srvResponse.setContentType("text/plain");
// override setContentType to keep "text/plain" as content type.
HttpServletResponseWrapper resp = new HttpServletResponseWrapper((HttpServletResponse) srvResponse) {
public void setContentType(String s) {
return;
}
};
filterChain.doFilter(srvRequest, resp);
return;
}
} catch (XFormsConfigException xfce) {
//Ignore Configuration Exception
}


if(request.getParameter("isUpload") != null){
//Got an upload...
handleUpload(request,response,session);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ private void handleFile(StringBuffer html, HttpServletRequest request, String ur
" <img src=\"" + request.getContextPath() + RESOURCE_PATH + "/images/"+iconFile+"\" border=\"0\">\n" +
" </a>\n" +
" <a class=\"textLink\" title=\""+ fileName+"\" href=\"" + request.getContextPath() + "/" + uri + "/" + fileName + "\" target=\"_blank\">" + getFileName(aFile,shortenNames) + "</a>\n" +
" <a class=\"sourceLink\" title=\""+ "view source" +"\" href=\"" + request.getContextPath() + "/" + uri + "/" + fileName + "?source=true \" target=\"_blank\">" + "<&nbsp;/&nbsp;>" + "</a>\n" +
" <a class=\"sourceLink\" title=\""+ "view source" +"\" href=\"" + request.getContextPath() + "/" + uri + "/" + fileName + "?__bf:source=true \" target=\"_blank\">" + "<&nbsp;/&nbsp;>" + "</a>\n" +
/*
" <div>\n" +
" <a href=\"" + request.getContextPath() + "/" + uri + "/" + fileName + "?source=true\" target=\"_blank\">source</a>\n" +
Expand Down
2 changes: 1 addition & 1 deletion zaphod/src/main/webapp/jsp/forms.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@
--%>
</td>
<td width="25%">
<a href="<%=request.getContextPath()%>/<%=uri%>/<%=aFile.getName()%>?source=true">source</a>
<a href="<%=request.getContextPath()%>/<%=uri%>/<%=aFile.getName()%>?__bf:source=true">source</a>
</td>

<!-- ################## column showing unscripted link - currently disabled ######### -->
Expand Down

0 comments on commit 4177d58

Please sign in to comment.