r198 - in trunk/src/main: java/org/nuiton/scmwebeditor/urlResolver/impl webapp/WEB-INF/content webapp/js
Author: kcardineaud Date: 2011-08-03 12:23:29 +0200 (Wed, 03 Aug 2011) New Revision: 198 Url: http://nuiton.org/repositories/revision/scmwebeditor/198 Log: Fix an issue with redirection and change some constantes names Modified: trunk/src/main/java/org/nuiton/scmwebeditor/urlResolver/impl/ScmUrlResolverMavenDocImpl.java trunk/src/main/java/org/nuiton/scmwebeditor/urlResolver/impl/ScmUrlResolverMavenSiteXmlImpl.java trunk/src/main/webapp/WEB-INF/content/badFileRedirect.jsp trunk/src/main/webapp/WEB-INF/content/badUseRedirect.jsp trunk/src/main/webapp/WEB-INF/content/error.jsp trunk/src/main/webapp/WEB-INF/content/modificationViewer.jsp trunk/src/main/webapp/WEB-INF/content/privateSvnRedirect.jsp trunk/src/main/webapp/WEB-INF/content/recall.jsp trunk/src/main/webapp/WEB-INF/content/redirect.jsp trunk/src/main/webapp/js/cancelRedirect.js Modified: trunk/src/main/java/org/nuiton/scmwebeditor/urlResolver/impl/ScmUrlResolverMavenDocImpl.java =================================================================== --- trunk/src/main/java/org/nuiton/scmwebeditor/urlResolver/impl/ScmUrlResolverMavenDocImpl.java 2011-08-03 09:17:20 UTC (rev 197) +++ trunk/src/main/java/org/nuiton/scmwebeditor/urlResolver/impl/ScmUrlResolverMavenDocImpl.java 2011-08-03 10:23:29 UTC (rev 198) @@ -11,8 +11,8 @@ public static final String MAVEN_SITE_DOCUMENT_NAME = "maven-site-document"; - public static final String PARAMETER_DEFAULT_LOCAL = "svndefaultLocale"; - public static final String PARAMETER_LOCAL = "svnlocale"; + public static final String PARAMETER_DEFAULT_LOCALE = "svndefaultLocale"; + public static final String PARAMETER_LOCALE = "svnlocale"; public static final String PARAMETER_SVN_ROOT = "svnroot"; public static final String PARAMETER_SVN_FILE = "svnfile"; public static final String PARAMETER_FILE_FORMAT = "svnformat"; @@ -26,8 +26,8 @@ @Override public URL resolv(Map<String, String> parameters) throws IOException, IllegalArgumentException { - String defaultLocale = parameters.get(PARAMETER_DEFAULT_LOCAL); - String locale = parameters.get(PARAMETER_LOCAL); + String defaultLocale = parameters.get(PARAMETER_DEFAULT_LOCALE); + String locale = parameters.get(PARAMETER_LOCALE); String svnRoot = parameters.get(PARAMETER_SVN_ROOT); String svnFile = parameters.get(PARAMETER_SVN_FILE); String svnFormat = parameters.get(PARAMETER_FILE_FORMAT); @@ -36,7 +36,7 @@ || StringUtils.isEmpty(svnFile) || StringUtils.isEmpty(svnFormat) ) { throw new IllegalArgumentException( "Layout " + MAVEN_SITE_DOCUMENT_NAME + " requires five parameters '" + - PARAMETER_DEFAULT_LOCAL + "', '"+PARAMETER_LOCAL+"' , '"+PARAMETER_SVN_ROOT+"' , '"+PARAMETER_SVN_FILE+"' , '"+PARAMETER_FILE_FORMAT+"'"); + PARAMETER_DEFAULT_LOCALE + "', '"+PARAMETER_LOCALE+"' , '"+PARAMETER_SVN_ROOT+"' , '"+PARAMETER_SVN_FILE+"' , '"+PARAMETER_FILE_FORMAT+"'"); } String result = ""; Modified: trunk/src/main/java/org/nuiton/scmwebeditor/urlResolver/impl/ScmUrlResolverMavenSiteXmlImpl.java =================================================================== --- trunk/src/main/java/org/nuiton/scmwebeditor/urlResolver/impl/ScmUrlResolverMavenSiteXmlImpl.java 2011-08-03 09:17:20 UTC (rev 197) +++ trunk/src/main/java/org/nuiton/scmwebeditor/urlResolver/impl/ScmUrlResolverMavenSiteXmlImpl.java 2011-08-03 10:23:29 UTC (rev 198) @@ -11,7 +11,7 @@ public static final String MAVEN_SITE_XML_NAME = "maven-site.xml"; - public static final String PARAMETER_LOCAL = "svnlocale"; + public static final String PARAMETER_LOCALE = "svnlocale"; public static final String PARAMETER_SVN_ROOT = "svnroot"; @@ -23,13 +23,13 @@ @Override public URL resolv(Map<String, String> parameters) throws IOException, IllegalArgumentException { - String local = parameters.get(PARAMETER_LOCAL); + String local = parameters.get(PARAMETER_LOCALE); String svnRoot = parameters.get(PARAMETER_SVN_ROOT); if (StringUtils.isEmpty(svnRoot) || StringUtils.isEmpty(local) ) { throw new IllegalArgumentException( "Layout " + MAVEN_SITE_XML_NAME + " requires three parameters '" + - PARAMETER_LOCAL + "', '"+PARAMETER_SVN_ROOT+"'"); + PARAMETER_LOCALE + "', '"+PARAMETER_SVN_ROOT+"'"); } String result = ""; Modified: trunk/src/main/webapp/WEB-INF/content/badFileRedirect.jsp =================================================================== --- trunk/src/main/webapp/WEB-INF/content/badFileRedirect.jsp 2011-08-03 09:17:20 UTC (rev 197) +++ trunk/src/main/webapp/WEB-INF/content/badFileRedirect.jsp 2011-08-03 10:23:29 UTC (rev 198) @@ -11,12 +11,22 @@ <title>Error...</title> <link rel="icon" href="img/ScmWebEditor_little.png" type="image/png"> <link rel="stylesheet" type="text/css" href="css/main.css"> +<% if(request.getAttribute("projectUrl")!=null) { %> <meta http-equiv="Refresh" content="3; url=<%=request.getAttribute("projectUrl")%>"> +<% } else { %> +<meta http-equiv="Refresh" content="3;URL=checkout.action"> +<% } %> + </head> <body> <a target="_blank" href="http://maven-site.nuiton.org/scmwebeditor/"><img src="img/ScmWebEditor_main.png" alt="$alt" /></a> <p><s:text name="scm.badPathOrFileName" /></p> -<p><s:text name="scm.formTransferred" /> <a href="<%=request.getAttribute("projectUrl")%>"> +<p><s:text name="scm.formTransferred" /> +<% if(request.getAttribute("projectUrl")!=null) { %> + <a href="<%=request.getAttribute("projectUrl")%>"> +<% } else { %> + <a href="checkout.action"> +<% } %> <s:text name="scm.clickHere" /></a>.</p> <p>©2004-2009 CodeLutin</p> </body> Modified: trunk/src/main/webapp/WEB-INF/content/badUseRedirect.jsp =================================================================== --- trunk/src/main/webapp/WEB-INF/content/badUseRedirect.jsp 2011-08-03 09:17:20 UTC (rev 197) +++ trunk/src/main/webapp/WEB-INF/content/badUseRedirect.jsp 2011-08-03 10:23:29 UTC (rev 198) @@ -10,15 +10,23 @@ <title>Error...</title> <link rel="icon" href="img/ScmWebEditor_little.png" type="image/png"> <link rel="stylesheet" type="text/css" href="css/main.css"> -<meta http-equiv="Refresh" content="3; url= -<%=request.getAttribute("scmEditorUrl")%>"> +<% if(request.getAttribute("projectUrl")!=null) { %> +<meta http-equiv="Refresh" content="3; url=<%=request.getAttribute("projectUrl")%>"> +<% } else { %> +<meta http-equiv="Refresh" content="3;URL=checkout.action"> +<% } %> </head> <body> <a target="_blank" href="http://maven-site.nuiton.org/scmwebeditor/"><img src="img/ScmWebEditor_main.png" alt="$alt" /></a> <p>Bad Use of ScmWebEditor! Please try again.</p> <p>You should be transferred automatically to the previous page. If not -please <a href="<%=request.getAttribute("scmEditorUrl")%>">click -this link</a>.</p> +please +<% if(request.getAttribute("projectUrl")!=null) { %> + <a href="<%=request.getAttribute("projectUrl")%>"> +<% } else { %> + <a href="checkout.action"> +<% } %> +click this link</a>.</p> <p>©2004-2009 CodeLutin</p> </body> </html> Modified: trunk/src/main/webapp/WEB-INF/content/error.jsp =================================================================== --- trunk/src/main/webapp/WEB-INF/content/error.jsp 2011-08-03 09:17:20 UTC (rev 197) +++ trunk/src/main/webapp/WEB-INF/content/error.jsp 2011-08-03 10:23:29 UTC (rev 198) @@ -10,9 +10,11 @@ <title>Error</title> <link rel="icon" href="img/ScmWebEditor_little.png" type="image/png"> <link rel="stylesheet" type="text/css" href="css/main.css"> -<meta http-equiv="Refresh" content="2; - url=" -<%=request.getAttribute("Redirect_url")%>"> +<% if(request.getAttribute("projectUrl")!=null) { %> +<meta http-equiv="Refresh" content="3; url=<%=request.getAttribute("projectUrl")%>"> +<% } else { %> +<meta http-equiv="Refresh" content="3;URL=checkout.action"> +<% } %> <%--%=request.getAttribute("scmEditorUrl")%>?adresse=<%=request.getAttribute("Svnpath_url")%>&file_name=<%=request.getAttribute("Filename_url")%>&project_url=<%=request.getAttribute("Redirection_url")%>&lang=<%=request.getAttribute("Lang")%>&format=<%=request.getAttribute("Format")%>"--%> </head> <body> Modified: trunk/src/main/webapp/WEB-INF/content/modificationViewer.jsp =================================================================== --- trunk/src/main/webapp/WEB-INF/content/modificationViewer.jsp 2011-08-03 09:17:20 UTC (rev 197) +++ trunk/src/main/webapp/WEB-INF/content/modificationViewer.jsp 2011-08-03 10:23:29 UTC (rev 198) @@ -57,7 +57,7 @@ String typeEditor="null"; if (request.getAttribute("format")!=null && request.getAttribute("format").equals("rst")) { %> - <h4><s:text name="scm.info.ProblemWithRst"/> <a href="http://docutils.sourceforge.net/docs/user/rst/quickref.html"><s:text name="scm.info.rstWebsite"/></a>.</h4> + <h4><s:text name="scm.info.ProblemWithRst"/> <a href="http://docutils.sourceforge.net/docs/user/rst/quickref.html"><s:text name="scm.info.rstWebsite"/></a>.</h4> <% } %> </center> @@ -160,21 +160,21 @@ <p> - <s:set id="scm.username"> - <s:text name="scm.username"/> - </s:set> - <s:set id="scm.usernameTitle"> + <s:set id="scm.username"> + <s:text name="scm.username"/> + </s:set> + <s:set id="scm.usernameTitle"> <s:text name="scm.usernameTitle"/> </s:set> - <s:set id="scm.password"> - <s:text name="scm.password"/> - </s:set> - <s:set id="scm.passwordTitle"> + <s:set id="scm.password"> + <s:text name="scm.password"/> + </s:set> + <s:set id="scm.passwordTitle"> <s:text name="scm.passwordTitle"/> </s:set> <div id="loginDiv"> - <s:textfield accesskey="U" size="12" label="%{scm.username}" name="username" title="%{scm.usernameTitle}" /> - <s:password accesskey="P" size="12" label="%{scm.password}" name="pw" title="%{scm.passwordTitle}" /> + <s:textfield accesskey="U" size="12" label="%{scm.username}" name="username" title="%{scm.usernameTitle}" /> + <s:password accesskey="P" size="12" label="%{scm.password}" name="pw" title="%{scm.passwordTitle}" /> </div> <% @@ -259,7 +259,11 @@ <div id="resetResult"></div> - <input type="hidden" value="<%=request.getAttribute("ProjectUrl")%>" name="ProjectUrl"> + <% if(request.getAttribute("projectUrl")!=null) { %> + <input type="hidden" name="ProjectUrl" value="<%=request.getAttribute("projectUrl")%>" /> + <% } else { %> + <input type="hidden" name="ProjectUrl" value="checkout.action" /> + <% } %> <s:set id="scm.exit"> <s:text name="scm.exit"/> @@ -299,14 +303,14 @@ <!-- <div id="uploadFormId" > - <s:form method="POST" id="uploadForm" action="uploadFile" enctype="multipart/form-data"> + <s:form method="POST" id="uploadForm" action="uploadFile" enctype="multipart/form-data"> - - <label>Upload a picture : <input type="file" name="upload"/></label><br/> - <label>Path on svn : <input type="text" name="svnPath" /></label><br/> + + <label>Upload a picture : <input type="file" name="upload"/></label><br/> + <label>Path on svn : <input type="text" name="svnPath" /></label><br/> <label>username : <input type="text" name="username" /></label><br/> <label>password : <input type="password" name="pw" /></label><br/> - + <sj:submit id="ajaxUploadButton" targets="targetContentUpload" @@ -315,7 +319,7 @@ > </sj:submit> - </s:form> + </s:form> </div> --> Modified: trunk/src/main/webapp/WEB-INF/content/privateSvnRedirect.jsp =================================================================== --- trunk/src/main/webapp/WEB-INF/content/privateSvnRedirect.jsp 2011-08-03 09:17:20 UTC (rev 197) +++ trunk/src/main/webapp/WEB-INF/content/privateSvnRedirect.jsp 2011-08-03 10:23:29 UTC (rev 198) @@ -16,7 +16,13 @@ <a target="_blank" href="http://maven-site.nuiton.org/scmwebeditor/"><img src="img/ScmWebEditor_main.png" alt="$alt" /></a> <form method="post" action="checkout.action" > <input type="hidden" name="address" value="<%=request.getAttribute("address")%>"/> -<input type="hidden" name="projectUrl" value="<%=request.getAttribute("projectUrl")%>"/> + +<% if(request.getAttribute("projectUrl")!=null) { %> +<input type="hidden" name="ProjectUrl" value="<%=request.getAttribute("projectUrl")%>"/> +<% } else { %> +<input type="hidden" name="ProjectUrl" value="checkout.action"/> +<% } %> + <script src="cancelRedirect.js"></script> <p><s:text name="scm.privateScmAccess" /></p> <p><label ACCESSKEY=U><s:text name="scm.username" /> : <input TYPE=text Modified: trunk/src/main/webapp/WEB-INF/content/recall.jsp =================================================================== --- trunk/src/main/webapp/WEB-INF/content/recall.jsp 2011-08-03 09:17:20 UTC (rev 197) +++ trunk/src/main/webapp/WEB-INF/content/recall.jsp 2011-08-03 10:23:29 UTC (rev 198) @@ -8,7 +8,11 @@ <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title><s:text name="scm.redirection" /></title> -<meta http-equiv="Refresh" content="0; url= -<%=request.getAttribute("Redirect_url")%>"> +<% if(request.getAttribute("projectUrl")!=null) { %> +<meta http-equiv="Refresh" content="3; url=<%=request.getAttribute("projectUrl")%>"> +<% } else { %> +<meta http-equiv="Refresh" content="3;URL=checkout.action"> +<% } %> + </head> </html> Modified: trunk/src/main/webapp/WEB-INF/content/redirect.jsp =================================================================== --- trunk/src/main/webapp/WEB-INF/content/redirect.jsp 2011-08-03 09:17:20 UTC (rev 197) +++ trunk/src/main/webapp/WEB-INF/content/redirect.jsp 2011-08-03 10:23:29 UTC (rev 198) @@ -10,13 +10,22 @@ <title><s:text name="scm.redirection" /></title> <link rel="icon" href="img/ScmWebEditor_little.png" type="image/png"> <link rel="stylesheet" type="text/css" href="css/main.css"> -<meta http-equiv="Refresh" content="2; url= -<%=request.getAttribute("Redirection_url")%>"> +<% if(request.getAttribute("projectUrl")!=null) { %> +<meta http-equiv="Refresh" content="3; url=<%=request.getAttribute("projectUrl")%>"> +<% } else { %> +<meta http-equiv="Refresh" content="3;URL=checkout.action"> +<% } %> </head> <body> <a target="_blank" href="http://maven-site.nuiton.org/scmwebeditor/"><img src="img/ScmWebEditor_main.png" alt="$alt" /></a> <p><s:text name="scm.thankUsing" /></p> -<p><s:text name="scm.beTransferred" /> <a href="<%=request.getAttribute("Redirection_url")%>"><s:text name="scm.clickHere" /></a>.</p> +<p><s:text name="scm.beTransferred" /> +<% if(request.getAttribute("projectUrl")!=null) { %> + <a href="<%=request.getAttribute("projectUrl")%>"> +<% } else { %> + <a href="checkout.action"> +<% } %> +<s:text name="scm.clickHere" /></a>.</p> <p>©2004-2009 CodeLutin</p> </body> </html> Modified: trunk/src/main/webapp/js/cancelRedirect.js =================================================================== --- trunk/src/main/webapp/js/cancelRedirect.js 2011-08-03 09:17:20 UTC (rev 197) +++ trunk/src/main/webapp/js/cancelRedirect.js 2011-08-03 10:23:29 UTC (rev 198) @@ -6,7 +6,7 @@ function cancelRedirect(text, url) { if (confirm(text)){ - window.location.replace(url.value); + document.location.href(url.value); return false; } else {return false};
participants (1)
-
kcardineaud@users.nuiton.org