Scmwebeditor-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
August 2011
- 5 participants
- 60 discussions
r244 - in trunk/src/main: java/org/nuiton/scmwebeditor/actions webapp/WEB-INF/content
by kcardineaud@users.nuiton.org 25 Aug '11
by kcardineaud@users.nuiton.org 25 Aug '11
25 Aug '11
Author: kcardineaud
Date: 2011-08-25 15:46:34 +0200 (Thu, 25 Aug 2011)
New Revision: 244
Url: http://nuiton.org/repositories/revision/scmwebeditor/244
Log:
Fix an issue with logout
Modified:
trunk/src/main/java/org/nuiton/scmwebeditor/actions/LogoutAction.java
trunk/src/main/java/org/nuiton/scmwebeditor/actions/ScmWebEditorMainAction.java
trunk/src/main/webapp/WEB-INF/content/logout.jsp
trunk/src/main/webapp/WEB-INF/content/modificationViewer.jsp
Modified: trunk/src/main/java/org/nuiton/scmwebeditor/actions/LogoutAction.java
===================================================================
--- trunk/src/main/java/org/nuiton/scmwebeditor/actions/LogoutAction.java 2011-08-25 13:46:02 UTC (rev 243)
+++ trunk/src/main/java/org/nuiton/scmwebeditor/actions/LogoutAction.java 2011-08-25 13:46:34 UTC (rev 244)
@@ -44,6 +44,7 @@
private static final Log log = LogFactory.getLog(LogoutAction.class);
protected String address;
+ protected String projectUrl;
protected HttpServletRequest request;
protected HttpServletResponse response;
@@ -57,9 +58,16 @@
return address;
}
+ public String getProjectUrl() {
+ return projectUrl;
+ }
+ public void setProjectUrl(String projectUrl) {
+ this.projectUrl = projectUrl;
+ }
+
public String execute() {
-
+
SvnConnection svnConn = new SvnConnection(address);
//Si le repo n'est pas protege en ecriture on recupere sont UUID
Modified: trunk/src/main/java/org/nuiton/scmwebeditor/actions/ScmWebEditorMainAction.java
===================================================================
--- trunk/src/main/java/org/nuiton/scmwebeditor/actions/ScmWebEditorMainAction.java 2011-08-25 13:46:02 UTC (rev 243)
+++ trunk/src/main/java/org/nuiton/scmwebeditor/actions/ScmWebEditorMainAction.java 2011-08-25 13:46:34 UTC (rev 244)
@@ -207,7 +207,7 @@
// }
- if(!this.fromLoginPage) {
+ if(!this.fromLoginPage && projectUrl==null) {
projectUrl=request.getHeader("referer");
}
Modified: trunk/src/main/webapp/WEB-INF/content/logout.jsp
===================================================================
--- trunk/src/main/webapp/WEB-INF/content/logout.jsp 2011-08-25 13:46:02 UTC (rev 243)
+++ trunk/src/main/webapp/WEB-INF/content/logout.jsp 2011-08-25 13:46:34 UTC (rev 244)
@@ -34,12 +34,20 @@
<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="0;URL=checkout.action?address=<%=request.getAttribute("address")%>&projectUrl=<%=request.getAttribute("projectUrl")%>">
+<% } else { %>
<meta http-equiv="Refresh" content="0;URL=checkout.action?address=<%=request.getAttribute("address")%>">
+<% } %>
+
</head>
<body>
<a target="_blank" href="http://maven-site.nuiton.org/scmwebeditor/"><img src="img/ScmWebEditor_main.png" alt="$alt" /></a>
+
+
<p>Logout... <a href="checkout.action?address=<%=request.getAttribute("address")%>"> <s:text name="scm.clickHere" /> </a>.</p>
<p>©2004-2009 CodeLutin</p>
</body>
Modified: trunk/src/main/webapp/WEB-INF/content/modificationViewer.jsp
===================================================================
--- trunk/src/main/webapp/WEB-INF/content/modificationViewer.jsp 2011-08-25 13:46:02 UTC (rev 243)
+++ trunk/src/main/webapp/WEB-INF/content/modificationViewer.jsp 2011-08-25 13:46:34 UTC (rev 244)
@@ -114,10 +114,13 @@
<s:set id="addressDeco">
<s:property value="address"/>
+ </s:set>
+ <s:set id="projectUrlDeco">
+ <s:property value="projectUrl"/>
</s:set>
<s:a
id="logout"
- href="logout.action?address=%{addressDeco}"
+ href="logout.action?address=%{addressDeco}&projectUrl=%{projectUrlDeco}"
title="Logout"
>
<div id="logoutButton" ></div>
@@ -231,6 +234,13 @@
<!-- BEGIN exit -->
+ <% if(request.getAttribute("projectUrl")!=null) { %>
+ <input type="hidden" id="projectUrl" value="<%=request.getAttribute("projectUrl")%>" />
+ <% } else { %>
+ <input type="hidden" id="projectUrl" value="checkout.action" />
+ <% } %>
+
+
<s:set id="scm.exitTitle">
<s:text name="scm.exitTitle"/>
</s:set>
@@ -243,7 +253,7 @@
title="%{scm.exitTitle}"
value="%{scm.exit}"
name="Cancel"
- onclick="return cancelRedirect('%{scm.exitJavascript}',document.getElementById('ProjectUrl'));">
+ onclick="return cancelRedirect('%{scm.exitJavascript}',document.getElementById('projectUrl'));">
<div id="exitButton" ></div>
</s:a>
@@ -365,14 +375,6 @@
-
-
- <% if(request.getAttribute("projectUrl")!=null) { %>
- <input type="hidden" id="ProjectUrl" value="<%=request.getAttribute("projectUrl")%>" />
- <% } else { %>
- <input type="hidden" id="ProjectUrl" value="checkout.action" />
- <% } %>
-
</div>
1
0
r243 - in trunk/src/main: java/org/nuiton/scmwebeditor resources
by kcardineaud@users.nuiton.org 25 Aug '11
by kcardineaud@users.nuiton.org 25 Aug '11
25 Aug '11
Author: kcardineaud
Date: 2011-08-25 15:46:02 +0200 (Thu, 25 Aug 2011)
New Revision: 243
Url: http://nuiton.org/repositories/revision/scmwebeditor/243
Log:
Change ScmWebEditorConfigOption to be an enum that implements OptionDef
Modified:
trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorConfig.java
trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorConfigOption.java
trunk/src/main/resources/scmwebeditor.properties
Modified: trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorConfig.java
===================================================================
--- trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorConfig.java 2011-08-25 09:42:26 UTC (rev 242)
+++ trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorConfig.java 2011-08-25 13:46:02 UTC (rev 243)
@@ -31,7 +31,7 @@
import org.nuiton.util.ApplicationConfig;
import org.nuiton.util.ArgumentsParserException;
-public class ScmWebEditorConfig extends ScmWebEditorConfigOption {
+public class ScmWebEditorConfig {
private static final Log log = LogFactory.getLog(ScmWebEditorConfig.class);
@@ -39,13 +39,13 @@
protected static ApplicationConfig config;
- public static ApplicationConfig getConfig() {
+ public static ApplicationConfig getConfig(String... args) {
if(config==null) {
synchronized (ScmWebEditorConfig.class) {
if(config==null) {
- config = new ApplicationConfig(PROPERTIESFILES);
+ config = new ApplicationConfig(ScmWebEditorConfigOption.CONFIG_FILE.getDefaultValue());
try {
- config.parse();
+ config.parse(args);
} catch (ArgumentsParserException e) {
if(log.isErrorEnabled()) {
log.error("Error when parsing ApplicationConfig",e);
@@ -58,14 +58,20 @@
}
public static List<String> getEditableFiles() {
- getConfig();
- return config.getOptionAsList(EDITABLESFILES).getOption();
+ return getEditableFiles(getConfig());
}
+ public static List<String> getEditableFiles(ApplicationConfig config) {
+ return config.getOptionAsList(ScmWebEditorConfigOption.EDITABLESFILES.key).getOption();
+ }
+
public static String getKey() {
- getConfig();
- return config.getOption(KEY);
+ return getKey(getConfig());
}
+ public static String getKey(ApplicationConfig config) {
+ return config.getOption(ScmWebEditorConfigOption.COOKIES_PRIVATE_KEY.key);
+ }
+
}
Modified: trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorConfigOption.java
===================================================================
--- trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorConfigOption.java 2011-08-25 09:42:26 UTC (rev 242)
+++ trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorConfigOption.java 2011-08-25 13:46:02 UTC (rev 243)
@@ -24,22 +24,82 @@
*/
package org.nuiton.scmwebeditor;
-public class ScmWebEditorConfigOption {
+import org.nuiton.util.ApplicationConfig;
+import org.nuiton.util.ApplicationConfig.OptionDef;
- /**
- * Nom du fichier de configuration
- */
- protected static final String PROPERTIESFILES = "scmwebeditor.properties";
-
- /**
- * propriété contenant la liste des fichiers éditables
- */
- protected static final String EDITABLESFILES = "editableFiles";
+public enum ScmWebEditorConfigOption implements OptionDef {
+
+ CONFIG_FILE(ApplicationConfig.CONFIG_FILE_NAME, "The file name", "scmwebeditor.properties", String.class, false, false),
+ EDITABLESFILES("editableFiles", "description" , "Files types that are editable", String.class, true, true),
+ COOKIES_PRIVATE_KEY("cookiePrivateKey", "Private key for cookies" , null , String.class, true, true);
+
- /**
- * Propriété contenant la clé
- */
- protected static final String KEY = "key";
+ public final String key;
+ public final String description;
+ public String defaultValue;
+ public final Class<?> type;
+ public boolean _transient;
+ public boolean _final;
+
+
+ ScmWebEditorConfigOption(String key, String description, String defaultValue,
+ Class<?> type, boolean _transient, boolean _final) {
+ this.key = key;
+ this.description = description;
+ this.defaultValue = defaultValue;
+ this.type = type;
+ this._final = _final;
+ this._transient = _transient;
+ }
+
+
+
+ @Override
+ public String getKey() {
+ return key;
+ }
+
+ @Override
+ public Class<?> getType() {
+ return type;
+ }
+
+ @Override
+ public String getDescription() {
+ return description;
+ }
+
+ @Override
+ public String getDefaultValue() {
+ return defaultValue;
+ }
+
+ @Override
+ public boolean isTransient() {
+ return _transient;
+ }
+
+ @Override
+ public boolean isFinal() {
+ return _final;
+ }
+
+ @Override
+ public void setDefaultValue(String defaultValue) {
+ this.defaultValue = defaultValue ;
+ }
+
+ @Override
+ public void setTransient(boolean isTransient) {
+ this._transient=isTransient;
+ }
+
+ @Override
+ public void setFinal(boolean isFinal) {
+ this._final = isFinal;
+ }
+
+
Modified: trunk/src/main/resources/scmwebeditor.properties
===================================================================
--- trunk/src/main/resources/scmwebeditor.properties 2011-08-25 09:42:26 UTC (rev 242)
+++ trunk/src/main/resources/scmwebeditor.properties 2011-08-25 13:46:02 UTC (rev 243)
@@ -23,4 +23,4 @@
# #L%
###
editableFiles=text,xml,javascript,sh,x-tex,x-java
-key=ZvcCyhfRTVZoQz3B/IpYdw==
\ No newline at end of file
+cookiePrivateKey=ZvcCyhfRTVZoQz3B/IpYdw==
\ No newline at end of file
1
0
r242 - in trunk: . src/main/java/org/nuiton/scmwebeditor src/main/java/org/nuiton/scmwebeditor/actions src/main/resources src/main/webapp/WEB-INF/content src/main/webapp/css
by kcardineaud@users.nuiton.org 25 Aug '11
by kcardineaud@users.nuiton.org 25 Aug '11
25 Aug '11
Author: kcardineaud
Date: 2011-08-25 11:42:26 +0200 (Thu, 25 Aug 2011)
New Revision: 242
Url: http://nuiton.org/repositories/revision/scmwebeditor/242
Log:
Add cookies for authentifications
Added:
trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorConfig.java
trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorConfigOption.java
trunk/src/main/java/org/nuiton/scmwebeditor/actions/LogoutAction.java
trunk/src/main/webapp/WEB-INF/content/logout.jsp
Modified:
trunk/pom.xml
trunk/src/main/java/org/nuiton/scmwebeditor/SvnConnection.java
trunk/src/main/java/org/nuiton/scmwebeditor/actions/SaveAction.java
trunk/src/main/java/org/nuiton/scmwebeditor/actions/ScmWebEditorCommitAction.java
trunk/src/main/java/org/nuiton/scmwebeditor/actions/ScmWebEditorMainAction.java
trunk/src/main/java/org/nuiton/scmwebeditor/actions/UploadAction.java
trunk/src/main/resources/scmwebeditor.properties
trunk/src/main/resources/struts.xml
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/search.jsp
trunk/src/main/webapp/css/main.css
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-08-24 15:27:19 UTC (rev 241)
+++ trunk/pom.xml 2011-08-25 09:42:26 UTC (rev 242)
@@ -90,6 +90,13 @@
<artifactId>tika-core</artifactId>
<version>0.9</version>
</dependency>
+
+ <dependency>
+ <groupId>org.apache.shiro</groupId>
+ <artifactId>shiro-core</artifactId>
+ <version>1.1.0</version>
+ </dependency>
+
<dependency>
Added: trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorConfig.java
===================================================================
--- trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorConfig.java (rev 0)
+++ trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorConfig.java 2011-08-25 09:42:26 UTC (rev 242)
@@ -0,0 +1,71 @@
+/*
+ * #%L
+ * ScmWebEditor
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2011 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+package org.nuiton.scmwebeditor;
+
+import java.util.List;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nuiton.util.ApplicationConfig;
+import org.nuiton.util.ArgumentsParserException;
+
+public class ScmWebEditorConfig extends ScmWebEditorConfigOption {
+
+ private static final Log log = LogFactory.getLog(ScmWebEditorConfig.class);
+
+
+ protected static ApplicationConfig config;
+
+
+ public static ApplicationConfig getConfig() {
+ if(config==null) {
+ synchronized (ScmWebEditorConfig.class) {
+ if(config==null) {
+ config = new ApplicationConfig(PROPERTIESFILES);
+ try {
+ config.parse();
+ } catch (ArgumentsParserException e) {
+ if(log.isErrorEnabled()) {
+ log.error("Error when parsing ApplicationConfig",e);
+ }
+ }
+ }
+ }
+ }
+ return config;
+ }
+
+ public static List<String> getEditableFiles() {
+ getConfig();
+ return config.getOptionAsList(EDITABLESFILES).getOption();
+ }
+
+ public static String getKey() {
+ getConfig();
+ return config.getOption(KEY);
+ }
+
+
+}
Added: trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorConfigOption.java
===================================================================
--- trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorConfigOption.java (rev 0)
+++ trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorConfigOption.java 2011-08-25 09:42:26 UTC (rev 242)
@@ -0,0 +1,47 @@
+/*
+ * #%L
+ * ScmWebEditor
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2011 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+package org.nuiton.scmwebeditor;
+
+public class ScmWebEditorConfigOption {
+
+ /**
+ * Nom du fichier de configuration
+ */
+ protected static final String PROPERTIESFILES = "scmwebeditor.properties";
+
+ /**
+ * propriété contenant la liste des fichiers éditables
+ */
+ protected static final String EDITABLESFILES = "editableFiles";
+
+ /**
+ * Propriété contenant la clé
+ */
+ protected static final String KEY = "key";
+
+
+
+
+}
Modified: trunk/src/main/java/org/nuiton/scmwebeditor/SvnConnection.java
===================================================================
--- trunk/src/main/java/org/nuiton/scmwebeditor/SvnConnection.java 2011-08-24 15:27:19 UTC (rev 241)
+++ trunk/src/main/java/org/nuiton/scmwebeditor/SvnConnection.java 2011-08-25 09:42:26 UTC (rev 242)
@@ -24,7 +24,6 @@
*/
package org.nuiton.scmwebeditor;
-import org.apache.commons.io.FileUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.util.FileUtil;
@@ -178,7 +177,7 @@
SVNDiffClient diffClient = new SVNDiffClient(getManager(), getSvnOption());
- FileUtils.writeStringToFile(pathToFile, text);
+ FileUtil.writeString(pathToFile, text, "UTF-8");
ByteArrayOutputStream diff = new ByteArrayOutputStream();
@@ -204,7 +203,7 @@
SVNDiffClient diffClient = new SVNDiffClient(getManager(), getSvnOption());
- FileUtils.writeStringToFile(pathToFile, text);
+ FileUtil.writeString(pathToFile, text, "UTF-8");
ByteArrayOutputStream diff = new ByteArrayOutputStream();
Added: trunk/src/main/java/org/nuiton/scmwebeditor/actions/LogoutAction.java
===================================================================
--- trunk/src/main/java/org/nuiton/scmwebeditor/actions/LogoutAction.java (rev 0)
+++ trunk/src/main/java/org/nuiton/scmwebeditor/actions/LogoutAction.java 2011-08-25 09:42:26 UTC (rev 242)
@@ -0,0 +1,100 @@
+/*
+ * #%L
+ * ScmWebEditor
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2011 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+package org.nuiton.scmwebeditor.actions;
+
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.struts2.interceptor.ServletRequestAware;
+import org.apache.struts2.interceptor.ServletResponseAware;
+import org.nuiton.scmwebeditor.ScmWebEditorBaseAction;
+import org.nuiton.scmwebeditor.SvnConnection;
+
+import com.opensymphony.xwork2.Action;
+
+public class LogoutAction extends ScmWebEditorBaseAction implements ServletRequestAware, ServletResponseAware {
+
+ private static final long serialVersionUID = 6937086747942656369L;
+
+ private static final Log log = LogFactory.getLog(LogoutAction.class);
+
+ protected String address;
+
+ protected HttpServletRequest request;
+ protected HttpServletResponse response;
+
+
+ public void setAddress(String address) {
+ this.address = address;
+ }
+
+ public String getAddress() {
+ return address;
+ }
+
+
+ public String execute() {
+
+ SvnConnection svnConn = new SvnConnection(address);
+
+ //Si le repo n'est pas protege en ecriture on recupere sont UUID
+ String repositoryUUID = svnConn.getUUID();
+ if (repositoryUUID==null) {
+ repositoryUUID=address;
+ }
+
+ //suppression des cookies pour ce dépot
+ for (Cookie c : request.getCookies()) {
+ if(c.getName().equals(repositoryUUID)) {
+ c.setMaxAge(0);//On supprime le cookie
+ response.addCookie(c);
+ if(log.isDebugEnabled()) {
+ log.debug("Cookie supprimé");
+ }
+ }
+ }
+
+ //Suppression des identifiants stockés en session
+ getScmSession().delScmUser(repositoryUUID);
+
+
+ return Action.SUCCESS;
+ }
+
+
+ @Override
+ public void setServletRequest(HttpServletRequest request) {
+ this.request=request;
+ }
+
+ @Override
+ public void setServletResponse(HttpServletResponse response) {
+ this.response=response;
+ }
+
+}
Modified: trunk/src/main/java/org/nuiton/scmwebeditor/actions/SaveAction.java
===================================================================
--- trunk/src/main/java/org/nuiton/scmwebeditor/actions/SaveAction.java 2011-08-24 15:27:19 UTC (rev 241)
+++ trunk/src/main/java/org/nuiton/scmwebeditor/actions/SaveAction.java 2011-08-25 09:42:26 UTC (rev 242)
@@ -57,9 +57,6 @@
}
- /**
- *
- */
private static final long serialVersionUID = -115627369699637253L;
Modified: trunk/src/main/java/org/nuiton/scmwebeditor/actions/ScmWebEditorCommitAction.java
===================================================================
--- trunk/src/main/java/org/nuiton/scmwebeditor/actions/ScmWebEditorCommitAction.java 2011-08-24 15:27:19 UTC (rev 241)
+++ trunk/src/main/java/org/nuiton/scmwebeditor/actions/ScmWebEditorCommitAction.java 2011-08-25 09:42:26 UTC (rev 242)
@@ -29,28 +29,33 @@
import java.io.FileNotFoundException;
import java.io.IOException;
+import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.shiro.codec.Base64;
+import org.apache.shiro.crypto.BlowfishCipherService;
import org.apache.struts2.interceptor.ServletRequestAware;
+import org.apache.struts2.interceptor.ServletResponseAware;
import org.nuiton.jrst.JRST;
import org.nuiton.scmwebeditor.ScmWebEditorBaseAction;
+import org.nuiton.scmwebeditor.ScmWebEditorConfig;
import org.nuiton.scmwebeditor.SvnConnection;
+import org.nuiton.util.FileUtil;
import org.tmatesoft.svn.core.SVNAuthenticationException;
import org.tmatesoft.svn.core.SVNDepth;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.wc.SVNCommitClient;
-
-
import com.opensymphony.xwork2.Action;
-public class ScmWebEditorCommitAction extends ScmWebEditorBaseAction implements ServletRequestAware {
+public class ScmWebEditorCommitAction extends ScmWebEditorBaseAction implements ServletRequestAware, ServletResponseAware {
/**
*
*/
@@ -71,15 +76,12 @@
protected String headCommiter;
protected boolean force;
+ protected boolean saveCookie;
protected String numRevision;
-
-
-
-
-
protected HttpServletRequest request;
+ protected HttpServletResponse response;
public String getCommitMessage() {
return commitMessage;
@@ -174,7 +176,15 @@
public String getHeadCommiter() {
return headCommiter;
}
+
+ public boolean isSaveCookie() {
+ return saveCookie;
+ }
+ public void setSaveCookie(boolean saveCookie) {
+ this.saveCookie = saveCookie;
+ }
+
protected boolean isRstValid(String newText) {
try {
JRST.generate(JRST.TYPE_HTML, newText);
@@ -196,6 +206,8 @@
public String execute() {
+ System.setProperty("file.encoding", "UTF-8");
+
if(!force) {
if(format.equals("rst")) {
if(!isRstValid(newText)) {
@@ -227,6 +239,47 @@
repositoryUUID=address;
}
+
+ /*
+ * Lecture du cookie
+ */
+ String usernamepwCookie = null;
+ // lire cookies
+
+ BlowfishCipherService bf = new BlowfishCipherService();
+
+ byte[] privateKey = Base64.decode(ScmWebEditorConfig.getKey());
+
+ for(Cookie c : request.getCookies()) {
+ if (c.getName().equals(repositoryUUID))
+ usernamepwCookie= c.getValue();
+ }
+
+
+
+ if(usernamepwCookie!=null) {
+
+ String usernameDecode = new String( bf.decrypt(Base64.decode(usernamepwCookie), privateKey).getBytes() );
+ String[] resCookie = usernameDecode.split(",");
+ if (resCookie.length==2) {
+ username=resCookie[0];
+ pw=resCookie[1];
+ }
+ }
+
+ if(saveCookie) {
+ if(username!=null && pw!=null) {
+ Cookie authCookie = new Cookie( repositoryUUID , bf.encrypt( (username+","+pw).getBytes() , privateKey ).toBase64() );
+ authCookie.setMaxAge(60*60*24*365);
+ response.addCookie(authCookie);
+ }
+
+ }
+
+
+ /*
+ * Recuperation des informations d'authentification dans la session
+ */
if( ( login==null || login.equals("") ) && ( password==null || password.equals("") ) ) {
if(getScmSession().getUsername(repositoryUUID)!=null && getScmSession().getPassword(repositoryUUID)!=null) {
//On recupère les identifiants en session
@@ -353,30 +406,31 @@
File pathToFile = new File(checkoutdir, svnConn.getFileName());
+
try {
- FileUtils.writeStringToFile(pathToFile, newText);
+ FileUtil.writeString(pathToFile, newText, "UTF-8");
} catch (IOException e1) {
delTempDirectory(checkoutdir);
return "error";
}
+
File[] tabFile = new File[1];
tabFile[0] = pathToFile;
-
-
+
try {
if(log.isDebugEnabled()) {
log.debug("Try to commit");
}
- commitClient.doCommit(tabFile, false, "From scmwebeditor -- "+commitMessage, null, null, false, true, SVNDepth.FILES);
+ commitClient.doCommit(tabFile, false, "From scmwebeditor -- "+commitMessage, null, null, false, false, SVNDepth.FILES);
} catch (SVNAuthenticationException authexep) {
if(log.isErrorEnabled()) {
log.error("AUTH FAIL");
}
// if authentication failed edition page is reload form user's relogin
- request.setAttribute("address", address);
+ request.setAttribute(PARAMETER_ADDRESS, address);
request.setAttribute(ATTRIBUTE_ORIG_TEXT, StringEscapeUtils.escapeHtml(newText));
@@ -430,4 +484,9 @@
this.request = request;
}
+ @Override
+ public void setServletResponse(HttpServletResponse response) {
+ this.response = response;
+ }
+
}
Modified: trunk/src/main/java/org/nuiton/scmwebeditor/actions/ScmWebEditorMainAction.java
===================================================================
--- trunk/src/main/java/org/nuiton/scmwebeditor/actions/ScmWebEditorMainAction.java 2011-08-24 15:27:19 UTC (rev 241)
+++ trunk/src/main/java/org/nuiton/scmwebeditor/actions/ScmWebEditorMainAction.java 2011-08-25 09:42:26 UTC (rev 242)
@@ -32,25 +32,28 @@
import java.util.Map;
import java.util.Map.Entry;
+import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.shiro.codec.Base64;
+import org.apache.shiro.crypto.BlowfishCipherService;
import org.apache.struts2.interceptor.ServletRequestAware;
+import org.apache.struts2.interceptor.ServletResponseAware;
import org.nuiton.scmwebeditor.ScmWebEditorBaseAction;
+import org.nuiton.scmwebeditor.ScmWebEditorConfig;
import org.nuiton.scmwebeditor.SvnConnection;
import org.nuiton.scmwebeditor.urlResolver.ScmUrlResolverEngine;
-import org.nuiton.util.ApplicationConfig;
-import org.nuiton.util.ArgumentsParserException;
import org.tmatesoft.svn.core.SVNAuthenticationException;
import org.tmatesoft.svn.core.SVNException;
import com.opensymphony.xwork2.Action;
-public class ScmWebEditorMainAction extends ScmWebEditorBaseAction implements ServletRequestAware {
+public class ScmWebEditorMainAction extends ScmWebEditorBaseAction implements ServletRequestAware, ServletResponseAware {
private static final long serialVersionUID = 8361035067228171624L;
@@ -189,8 +192,7 @@
* @return
*/
public String execute() {
-
-
+
if(log.isDebugEnabled()) {
log.debug("Connection to SCMWebEditor\n");
}
@@ -285,7 +287,45 @@
}
+ /*
+ * Lecture du cookie
+ */
+
+
+ String usernamepwCookie = null;
+ // lire cookies
+
+ BlowfishCipherService bf = new BlowfishCipherService();
+
+ byte[] privateKey = Base64.decode(ScmWebEditorConfig.getKey());
+
+ for(Cookie c : request.getCookies()) {
+ if (c.getName().equals(repositoryUUID))
+ usernamepwCookie= c.getValue();
+ }
+ if(usernamepwCookie!=null) {
+
+ String usernameDecode = new String( bf.decrypt(Base64.decode(usernamepwCookie), privateKey).getBytes() );
+
+ String[] resCookie = usernameDecode.split(",");
+ if (resCookie.length==2) {
+ username=resCookie[0];
+ pw=resCookie[1];
+ }
+ }
+
+ if(saveCookie) {
+ if(username!=null && pw!=null) {
+
+ Cookie authCookie = new Cookie( repositoryUUID , bf.encrypt( (username+","+pw).getBytes() , privateKey ).toBase64() );
+ authCookie.setMaxAge(60*60*24*365);
+ response.addCookie(authCookie);
+ }
+
+ }
+
+
/*
* Récuperation des informations en session
*/
@@ -325,6 +365,17 @@
log.debug("Auth Fail " ,authexep);
}
+ //suppression des cookies pour ce dépot
+ for (Cookie c : request.getCookies()) {
+ if(c.getName().equals(repositoryUUID)) {
+ c.setMaxAge(0);//On supprime le cookie
+ response.addCookie(c);
+ if(log.isDebugEnabled()) {
+ log.debug("Cookie supprimé");
+ }
+ }
+ }
+
getScmSession().delScmUser(repositoryUUID);
//redirect to a login page
return Action.LOGIN;
@@ -361,22 +412,14 @@
- ApplicationConfig config = new ApplicationConfig(PROPERTIESFILES);
-
LinkedList<String> editableFiles = new LinkedList<String>();
editableFiles.add("text");
editableFiles.add("xml");
editableFiles.add("x-java");
- try {
- config.parse();
- editableFiles.addAll(config.getOptionAsList(EDITABLESFILES).getOption());
- } catch (ArgumentsParserException eee) {
- if(log.isErrorEnabled()) {
- log.error("Can't read properties file", eee );
- }
- }
+ editableFiles.addAll(ScmWebEditorConfig.getEditableFiles());
+
boolean editable =false;
@@ -427,8 +470,11 @@
}
+ @Override
+ public void setServletResponse(HttpServletResponse response) {
+ this.response = response;
+ }
-
}
Modified: trunk/src/main/java/org/nuiton/scmwebeditor/actions/UploadAction.java
===================================================================
--- trunk/src/main/java/org/nuiton/scmwebeditor/actions/UploadAction.java 2011-08-24 15:27:19 UTC (rev 241)
+++ trunk/src/main/java/org/nuiton/scmwebeditor/actions/UploadAction.java 2011-08-25 09:42:26 UTC (rev 242)
@@ -268,10 +268,7 @@
-// //On test si le chemin commence par un / si non, on l'ajoute
-// if(!svnPath.startsWith("/")) {
-// svnPath="/"+svnPath;
-// }
+
//On test si le chemin se termine par un / si non, on l'ajoute
if(!svnPath.endsWith("/")) {
svnPath+=("/");
Modified: trunk/src/main/resources/scmwebeditor.properties
===================================================================
--- trunk/src/main/resources/scmwebeditor.properties 2011-08-24 15:27:19 UTC (rev 241)
+++ trunk/src/main/resources/scmwebeditor.properties 2011-08-25 09:42:26 UTC (rev 242)
@@ -22,4 +22,5 @@
# <http://www.gnu.org/licenses/lgpl-3.0.html>.
# #L%
###
-editableFiles=text,xml,javascript,sh,x-tex,x-java
\ No newline at end of file
+editableFiles=text,xml,javascript,sh,x-tex,x-java
+key=ZvcCyhfRTVZoQz3B/IpYdw==
\ No newline at end of file
Modified: trunk/src/main/resources/struts.xml
===================================================================
--- trunk/src/main/resources/struts.xml 2011-08-24 15:27:19 UTC (rev 241)
+++ trunk/src/main/resources/struts.xml 2011-08-25 09:42:26 UTC (rev 242)
@@ -66,6 +66,10 @@
<result name="errorPath">/WEB-INF/content/reset.jsp</result>
</action>
+ <action name="logout" class="org.nuiton.scmwebeditor.actions.LogoutAction" >
+ <result>/WEB-INF/content/logout.jsp</result>
+ </action>
+
<action name="doUpload" class="org.nuiton.scmwebeditor.actions.UploadAction" >
<result>/WEB-INF/content/uploadSuccess.jsp</result>
<result name="redirect" >/WEB-INF/content/uploadForm.jsp</result>
Added: trunk/src/main/webapp/WEB-INF/content/logout.jsp
===================================================================
--- trunk/src/main/webapp/WEB-INF/content/logout.jsp (rev 0)
+++ trunk/src/main/webapp/WEB-INF/content/logout.jsp 2011-08-25 09:42:26 UTC (rev 242)
@@ -0,0 +1,46 @@
+<%--
+ #%L
+ ScmWebEditor
+
+ $Id$
+ $HeadURL$
+ %%
+ Copyright (C) 2009 - 2011 CodeLutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation, either version 3 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Lesser Public License for more details.
+
+ You should have received a copy of the GNU General Lesser Public
+ License along with this program. If not, see
+ <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ #L%
+ --%>
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+ pageEncoding="UTF-8"%>
+ <%@ taglib prefix="s" uri="/struts-tags"%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>Logout...</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="0;URL=checkout.action?address=<%=request.getAttribute("address")%>">
+
+</head>
+<body>
+<a target="_blank" href="http://maven-site.nuiton.org/scmwebeditor/"><img src="img/ScmWebEditor_main.png" alt="$alt" /></a>
+
+<p>Logout... <a href="checkout.action?address=<%=request.getAttribute("address")%>"> <s:text name="scm.clickHere" /> </a>.</p>
+<p>©2004-2009 CodeLutin</p>
+</body>
+</html>
\ No newline at end of file
Modified: trunk/src/main/webapp/WEB-INF/content/modificationViewer.jsp
===================================================================
--- trunk/src/main/webapp/WEB-INF/content/modificationViewer.jsp 2011-08-24 15:27:19 UTC (rev 241)
+++ trunk/src/main/webapp/WEB-INF/content/modificationViewer.jsp 2011-08-25 09:42:26 UTC (rev 242)
@@ -108,10 +108,26 @@
<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}" />
-
+ <input type="checkbox" name="saveCookie" value="true" >Rester connecté
</s:if>
<s:else >
- <s:text name="scm.logAs" /> <s:property value="username" /> <br/>
+
+ <s:set id="addressDeco">
+ <s:property value="address"/>
+ </s:set>
+ <s:a
+ id="logout"
+ href="logout.action?address=%{addressDeco}"
+ title="Logout"
+ >
+ <div id="logoutButton" ></div>
+ </s:a>
+
+ <s:text name="scm.logAs" /> <s:property value="username" />
+
+
+
+ <br/>
</s:else>
<div id="htmlcontentCommit">
@@ -134,7 +150,7 @@
</s:set>
<s:submit
value="commit"
- title="%{scm.saveAndQuitTitle}"
+ title="Deconnexion"
name="Save"
/>
</noscript>
@@ -274,7 +290,7 @@
<s:text name="scm.FileInEditor"/><a href="<%=request.getAttribute("address")%>" ><%=request.getAttribute("address")%></a>
<s:text name="scm.atRevision"/> <span id="numrevisionDiv"><s:property value="numRevision" /></span>
</p>
- <textarea id="newTextId" rows="50" cols="80" name="newText"><%=valueTextarea%></textarea>
+ <textarea id="newTextId" rows="50" cols="80" name="newText" ><%=valueTextarea%></textarea>
Modified: trunk/src/main/webapp/WEB-INF/content/privateSvnRedirect.jsp
===================================================================
--- trunk/src/main/webapp/WEB-INF/content/privateSvnRedirect.jsp 2011-08-24 15:27:19 UTC (rev 241)
+++ trunk/src/main/webapp/WEB-INF/content/privateSvnRedirect.jsp 2011-08-25 09:42:26 UTC (rev 242)
@@ -53,9 +53,12 @@
<p><label ACCESSKEY=U><s:text name="scm.username" /> : <input TYPE=text
NAME=username SIZE=12></label>
<label ACCESSKEY=P><s:text name="scm.password" /> : <input
- TYPE=password NAME=pw SIZE=12></label></p>
+ TYPE=password NAME=pw SIZE=12></label>
+ <input type="checkbox" name="saveCookie" value="true" >Rester connecté
+ </p>
+
<input type="submit" name="Save" />
Modified: trunk/src/main/webapp/WEB-INF/content/search.jsp
===================================================================
--- trunk/src/main/webapp/WEB-INF/content/search.jsp 2011-08-24 15:27:19 UTC (rev 241)
+++ trunk/src/main/webapp/WEB-INF/content/search.jsp 2011-08-25 09:42:26 UTC (rev 242)
@@ -61,7 +61,7 @@
jstreetheme="classic"
href="%{searchTreeUrl}"
onClickTopics="treeClicked"
- />
+ />
</div>
Modified: trunk/src/main/webapp/css/main.css
===================================================================
--- trunk/src/main/webapp/css/main.css 2011-08-24 15:27:19 UTC (rev 241)
+++ trunk/src/main/webapp/css/main.css 2011-08-25 09:42:26 UTC (rev 242)
@@ -136,7 +136,7 @@
margin:0;
background-image:url("../img/editor/post-it.png");
background-repeat:no-repeat;
- width:460px;
+ width:468px;
height:190px;
}
@@ -145,7 +145,7 @@
float:right;
margin-right:30px;
text-align:center;
- width:261px;
+ width:270px;
}
#htmlcontentCommit {
@@ -219,6 +219,16 @@
background-image:url("../img/editor/shut-down-hover.png");
}
+#logoutButton {
+ float:right;
+ background-image:url("../img/editor/shut-down-hover.png");
+ background-repeat:no-repeat;
+ height:33px;
+ width:33px;
+ background-position: 0px -4px;
+}
+
+
/* END Button */
#editorTitle {
1
0
Author: tchemit
Date: 2011-08-24 17:27:19 +0200 (Wed, 24 Aug 2011)
New Revision: 241
Url: http://nuiton.org/repositories/revision/scmwebeditor/241
Log:
remove unused import in jsp
Modified:
trunk/src/main/webapp/WEB-INF/content/modificationViewer.jsp
trunk/src/main/webapp/WEB-INF/content/search.jsp
trunk/src/main/webapp/WEB-INF/content/uploadForm.jsp
Modified: trunk/src/main/webapp/WEB-INF/content/modificationViewer.jsp
===================================================================
--- trunk/src/main/webapp/WEB-INF/content/modificationViewer.jsp 2011-08-24 15:21:15 UTC (rev 240)
+++ trunk/src/main/webapp/WEB-INF/content/modificationViewer.jsp 2011-08-24 15:27:19 UTC (rev 241)
@@ -22,12 +22,9 @@
<http://www.gnu.org/licenses/lgpl-3.0.html>.
#L%
--%>
- <%-- Document : ModificationViewer Created on : 10 sept. 2009, 13:43:11 Author : glorieux --%>
- <%@page import="org.apache.commons.lang.StringEscapeUtils"%>
- <%@page import="java.util.Map"%>
- <%@page import="org.nuiton.scmwebeditor.ScmSession"%>
-
- <%@page contentType="text/html" pageEncoding="UTF-8"%>
+ <%-- Document : ModificationViewer Created on : 10 sept. 2009, 13:43:11 Author : glorieux --%>
+
+<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<sj:head jquerytheme="default"/>
Modified: trunk/src/main/webapp/WEB-INF/content/search.jsp
===================================================================
--- trunk/src/main/webapp/WEB-INF/content/search.jsp 2011-08-24 15:21:15 UTC (rev 240)
+++ trunk/src/main/webapp/WEB-INF/content/search.jsp 2011-08-24 15:27:19 UTC (rev 241)
@@ -24,12 +24,8 @@
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
-<%@page import="org.nuiton.scmwebeditor.actions.SearchAction"%>
-<%@page import="java.util.LinkedList" %>
-<%@page import="java.util.Iterator" %>
-
-
- <%@ taglib prefix="s" uri="/struts-tags"%>
+
+<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<%@ taglib prefix="sjt" uri="/struts-jquery-tree-tags" %>
Modified: trunk/src/main/webapp/WEB-INF/content/uploadForm.jsp
===================================================================
--- trunk/src/main/webapp/WEB-INF/content/uploadForm.jsp 2011-08-24 15:21:15 UTC (rev 240)
+++ trunk/src/main/webapp/WEB-INF/content/uploadForm.jsp 2011-08-24 15:27:19 UTC (rev 241)
@@ -24,10 +24,8 @@
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
- <%@page import="org.nuiton.scmwebeditor.ScmSession"%>
- <%@page import="org.nuiton.scmwebeditor.SvnConnection"%>
-
- <%@ taglib prefix="s" uri="/struts-tags"%>
+
+<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<%@ taglib prefix="sjt" uri="/struts-jquery-tree-tags" %>
1
0
r240 - in trunk: . src/main/java/org/nuiton/scmwebeditor src/main/resources src/main/resources/i18n
by tchemit@users.nuiton.org 24 Aug '11
by tchemit@users.nuiton.org 24 Aug '11
24 Aug '11
Author: tchemit
Date: 2011-08-24 17:21:15 +0200 (Wed, 24 Aug 2011)
New Revision: 240
Url: http://nuiton.org/repositories/revision/scmwebeditor/240
Log:
Anomalie #1710: Bad internalisation translations
Modified:
trunk/pom.xml
trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorApplicationListener.java
trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorBaseAction.java
trunk/src/main/resources/i18n/scmwebeditor_fr_FR.properties
trunk/src/main/resources/struts.properties
trunk/src/main/resources/struts.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-08-24 12:36:33 UTC (rev 239)
+++ trunk/pom.xml 2011-08-24 15:21:15 UTC (rev 240)
@@ -96,9 +96,15 @@
<groupId>org.nuiton.i18n</groupId>
<artifactId>nuiton-i18n</artifactId>
<version>${nuitonI18nVersion}</version>
- <scope>runtime</scope>
+ <scope>compile</scope>
</dependency>
+ <dependency>
+ <groupId>org.nuiton.web</groupId>
+ <artifactId>nuiton-struts2</artifactId>
+ <version>${nuitonWebVersion}</version>
+ </dependency>
+
<!-- Struts -->
<dependency>
@@ -216,8 +222,9 @@
<struts2Version>2.2.3</struts2Version>
<struts2jqueryVersion>3.1.0</struts2jqueryVersion>
- <nuitonI18nVersion>2.4</nuitonI18nVersion>
+ <nuitonI18nVersion>2.4.1</nuitonI18nVersion>
<nuitonUtilsVersion>2.2</nuitonUtilsVersion>
+ <nuitonWebVersion>1.3</nuitonWebVersion>
<jrstPluginVersion>1.4</jrstPluginVersion>
<!-- <scmwebeditorUrl>http://localhost:8080/scmwebeditor/checkout.action</scmwebeditorUrl> -->
@@ -227,7 +234,6 @@
<i18n.bundleOutputName>scmwebeditor-i18n</i18n.bundleOutputName>
- <i18n.bundleOutputPackage/>
<!-- extra files to include in release -->
<redmine.releaseFiles>
Modified: trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorApplicationListener.java
===================================================================
--- trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorApplicationListener.java 2011-08-24 12:36:33 UTC (rev 239)
+++ trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorApplicationListener.java 2011-08-24 15:21:15 UTC (rev 240)
@@ -24,19 +24,28 @@
*/
package org.nuiton.scmwebeditor;
+import org.nuiton.i18n.I18n;
+import org.nuiton.i18n.init.DefaultI18nInitializer;
+import org.nuiton.i18n.init.I18nInitializer;
+import org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory;
+import org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryFactoryImpl;
+
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
+import java.util.Locale;
-import org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory;
-import org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryFactoryImpl;
-
public class ScmWebEditorApplicationListener implements ServletContextListener {
@Override
public void contextInitialized(ServletContextEvent sce) {
SVNRepositoryFactoryImpl.setup();
DAVRepositoryFactory.setup();
-
+
+ // init I18n
+ I18nInitializer i18nInitializer =
+ new DefaultI18nInitializer("scmwebeditor-i18n");
+ i18nInitializer.setMissingKeyReturnNull(true);
+ I18n.init(i18nInitializer, Locale.getDefault());
}
@Override
Modified: trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorBaseAction.java
===================================================================
--- trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorBaseAction.java 2011-08-24 12:36:33 UTC (rev 239)
+++ trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorBaseAction.java 2011-08-24 15:21:15 UTC (rev 240)
@@ -24,8 +24,12 @@
*/
package org.nuiton.scmwebeditor;
-import info.monitorenter.cpdetector.io.*;
-
+import com.opensymphony.xwork2.ActionContext;
+import info.monitorenter.cpdetector.io.ASCIIDetector;
+import info.monitorenter.cpdetector.io.ByteOrderMarkDetector;
+import info.monitorenter.cpdetector.io.CodepageDetectorProxy;
+import info.monitorenter.cpdetector.io.JChardetFacade;
+import info.monitorenter.cpdetector.io.ParsingDetector;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.logging.Log;
@@ -34,6 +38,7 @@
import org.apache.tika.metadata.Metadata;
import org.apache.tika.parser.AutoDetectParser;
import org.apache.tika.sax.BodyContentHandler;
+import org.nuiton.web.struts2.BaseAction;
import org.tmatesoft.svn.core.SVNDepth;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNNodeKind;
@@ -51,11 +56,19 @@
import org.tmatesoft.svn.core.wc.SVNWCUtil;
import org.xml.sax.SAXException;
-import com.opensymphony.xwork2.ActionContext;
-import com.opensymphony.xwork2.ActionSupport;
-
import javax.servlet.http.HttpSession;
-import java.io.*;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.Reader;
+import java.io.Writer;
import java.net.MalformedURLException;
import java.nio.charset.Charset;
import java.util.Map;
@@ -66,7 +79,7 @@
* Date: 24 nov. 2009
* Time: 21:24:39
*/
-public class ScmWebEditorBaseAction extends ActionSupport {
+public class ScmWebEditorBaseAction extends BaseAction {
protected Map<String, Object> session;
Modified: trunk/src/main/resources/i18n/scmwebeditor_fr_FR.properties
===================================================================
--- trunk/src/main/resources/i18n/scmwebeditor_fr_FR.properties 2011-08-24 12:36:33 UTC (rev 239)
+++ trunk/src/main/resources/i18n/scmwebeditor_fr_FR.properties 2011-08-24 15:21:15 UTC (rev 240)
@@ -1,57 +1,57 @@
-scm.FileInEditor=Fichier dans l''editeur \:
-scm.atRevision=a la revision
-scm.badPathOrFileName=L''adresse du depot ou le nom du fichier est incorrect, ou le fichier n''est pas editable \!
+scm.FileInEditor=Fichier dans l'éditeur \:
+scm.atRevision=à la revision
+scm.badPathOrFileName=L'adresse du dépôt ou le nom du fichier est incorrect, ou le fichier n'est pas éditable \!
scm.badUsernameOrPassword=Identifiant ou mot de passe incorrect
-scm.beTransferred=Vous devriez etre redirige sur une nouvelle page. si non
+scm.beTransferred=Vous devriez être redirigé sur une nouvelle page. si non
scm.by=Par
scm.cannotSave=Modification impossible
scm.clickHere=cliquez ici
-scm.commitMessage=Message associe au commit
+scm.commitMessage=Message associé au commit
scm.commitMessageTitle=laisser un message pour le commit
-scm.erreurRepo=Erreur sur le depot
+scm.erreurRepo=Erreur sur le dépôt
scm.exit=Quitter
-scm.exitJavascript=Quitter ScmWebEditor sans sauvegarder ? Toutes les modifications serons perdues.
+scm.exitJavascript=Quitter ScmWebEditor sans sauvegarder ? Toutes les modifications seront perdues.
scm.exitTitle=Quitter ScmWebEditor sans sauvegarder.
-scm.fileModify=Fichier modifie pendant l'edition.
+scm.fileModify=Fichier modifié pendant l'édition.
scm.forceSave=Forcer la sauvegarde
-scm.formTransferred=Vous devriez etre redirige vers la page du formulaire. si non
+scm.formTransferred=Vous devriez être redirigé vers la page du formulaire. si non
scm.info.ProblemWithRst=Si vous rencontrez des problemes avec RestruturedText, visitez le
scm.info.rstWebsite=site de la documentation RST
scm.language=Langage
-scm.lastChangeSave=Derniere sauvegarde effectuee
+scm.lastChangeSave=Dernière sauvegarde effectuée
scm.logAs=Connecte en tant que \:
scm.loginButton=Connexion
-scm.modificationViewer.betterUseJavascript=Activer Javascript pour acceder a toute les fonctionnalitees.
-scm.modificationViewer.noJavascript=Javascript est desactive. Vous pouvais seulement utiliser les boutons sauvegarder et quitter, quitter ou upload.
-scm.mustBeLog=Vous devez vous identifier pour parcourir ce depot.
+scm.modificationViewer.betterUseJavascript=Activer Javascript pour accéder à toute les fonctionnalités.
+scm.modificationViewer.noJavascript=Javascript est désactivé. Vous pouvez seulement utiliser les boutons sauvegarder et quitter, quitter ou upload.
+scm.mustBeLog=Vous devez vous identifier pour parcourir ce dépôt.
scm.no=Non
-scm.outConnection.enterRepo=Entrez l''adresse de votre depot.
-scm.outConnection.noJavascript=Javascript n''est pas active. Certaines fonctions ne serons pas accessible.
-scm.outConnection.scmPath=Repertoire SCM \:
+scm.outConnection.enterRepo=Entrez l'adresse de votre dépôt.
+scm.outConnection.noJavascript=Javascript n'est pas active. Certaines fonctions ne seront pas accessibles.
+scm.outConnection.scmPath=Répertoire SCM \:
scm.outConnection.search=Chercher
scm.password=Mot de passe
-scm.passwordTitle=Mot de passe du depot
-scm.pathError=erreur dans le chemin
+scm.passwordTitle=Mot de passe du dépôt
+scm.pathError=Erreur dans le chemin
scm.preview=Apercu
scm.privateScmAccess=Pour modifier ce fichier, veuillez vous connecter.
scm.redirection=Redirection...
-scm.reset=Reinitialiser
-scm.resetTitle=Retour a la derniere revision du fichier
-scm.rstNotValidMessage=The Rst n''est pas valide, voulez-vous continuer ?
+scm.reset=Réinitialiser
+scm.resetTitle=Retour a la dernière révision du fichier
+scm.rstNotValidMessage=The Rst n'est pas valide, voulez-vous continuer ?
scm.saveAndContinue=Sauvegarder et continuer
-scm.saveAndContinueTitle=Enregister les modifications sur le depot et continuer d''editer le fichier
+scm.saveAndContinueTitle=Enregister les modifications sur le dépôt et continuer d'editer le fichier
scm.saveAndQuit=Sauvegarder et quitter
-scm.saveAndQuitTitle=Sauvegarder le fichier sur le depot et retourner à la page precedente.
+scm.saveAndQuitTitle=Sauvegarder le fichier sur le dépôt et retourner à la page précédente.
scm.showDiff=Voir les differences
scm.text=Texte
-scm.thankUsing=merci d''avoir utilise SCMWebEditor
+scm.thankUsing=merci d'avoir utilise SCMWebEditor
scm.upload=Ajouter un fichier
scm.uploadFile=Url du fichier
-scm.uploadPath=Repertoire sur le depot
+scm.uploadPath=Repertoire sur le dépôt
scm.uploadSuccess=Fichier telecharche avec succes
-scm.uploadTitle=Ajouter un fichier sur le depot
-scm.uselessSave=Inutile de sauvegarder le fichier, aucune modification n''ont ete apporte
+scm.uploadTitle=Ajouter un fichier sur le dépôt
+scm.uselessSave=Inutile de sauvegarder le fichier, aucune modification n'ont été apporté
scm.username=Identifiant
-scm.usernameTitle=Identifiant du depot
+scm.usernameTitle=Identifiant du dépôt
scm.welcome=Bienvenue sur SCMWebEditor
scm.yes=Oui
Modified: trunk/src/main/resources/struts.properties
===================================================================
--- trunk/src/main/resources/struts.properties 2011-08-24 12:36:33 UTC (rev 239)
+++ trunk/src/main/resources/struts.properties 2011-08-24 15:21:15 UTC (rev 240)
@@ -23,47 +23,53 @@
# #L%
###
struts.locale=fr_FR
-struts.i18n.encoding=UTF-8
+#struts.i18n.encoding=UTF-8
+struts.ognl.logMissingProperties=true
+
+struts.el.throwExceptionOnFailure=true
+
+#struts.action.extension=,,
+
# struts.multipart.parser=cos
# struts.multipart.parser=pell
-struts.multipart.parser=jakarta
+#struts.multipart.parser=jakarta
# uses javax.servlet.context.tempdir by default
-struts.multipart.saveDir=
-struts.multipart.maxSize=2097152
+#struts.multipart.saveDir=
+#struts.multipart.maxSize=2097152
# struts.custom.properties=application,com/webwork/extension/custom
#struts.mapper.class=org.apache.struts2.dispatcher.mapper.DefaultActionMapper
-struts.action.extension=action
+#struts.action.extension=action
-struts.serve.static=true
+#struts.serve.static=true
-struts.serve.static.browserCache=true
+#struts.serve.static.browserCache=true
-struts.tag.altSyntax=true
+#struts.tag.altSyntax=true
-struts.devMode=false
+#struts.devMode=false
struts.i18n.reload=true
struts.ui.theme=css_xhtml
-struts.ui.templateDir=template
+#struts.ui.templateDir=template
#sets the default template type. Either ftl, vm, or jsp
-struts.ui.templateSuffix=ftl
+#struts.ui.templateSuffix=ftl
-struts.configuration.xml.reload=false
+#struts.configuration.xml.reload=false
-struts.url.http.port = 80
-struts.url.https.port = 443
+#struts.url.http.port = 80
+#struts.url.https.port = 443
-struts.custom.i18n.resources=scmwebeditor-i18n
+#struts.custom.i18n.resources=scmwebeditor-i18n
-struts.dispatcher.parametersWorkaround = false
+#struts.dispatcher.parametersWorkaround = false
#struts.freemarker.manager.classname=org.apache.struts2.views.freemarker.FreemarkerManager
-struts.freemarker.wrapper.altMap=true
+#struts.freemarker.wrapper.altMap=true
-struts.xslt.nocache=false
+#struts.xslt.nocache=false
Modified: trunk/src/main/resources/struts.xml
===================================================================
--- trunk/src/main/resources/struts.xml 2011-08-24 12:36:33 UTC (rev 239)
+++ trunk/src/main/resources/struts.xml 2011-08-24 15:21:15 UTC (rev 240)
@@ -29,6 +29,12 @@
2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
+
+ <bean class="org.nuiton.web.struts2.I18nTextProvider"
+ name="i18nTextProvider"
+ type="com.opensymphony.xwork2.TextProvider" />
+ <constant name="struts.xworkTextProvider" value="i18nTextProvider" />
+
<package name="action" extends="struts-default">
<result-types>
<result-type name="json" class="org.apache.struts2.json.JSONResult"/>
1
0
Author: kcardineaud
Date: 2011-08-24 14:36:33 +0200 (Wed, 24 Aug 2011)
New Revision: 239
Url: http://nuiton.org/repositories/revision/scmwebeditor/239
Log:
Change properties file name
Added:
trunk/src/main/resources/scmwebeditor.properties
Removed:
trunk/src/main/resources/scm.properties
Deleted: trunk/src/main/resources/scm.properties
===================================================================
--- trunk/src/main/resources/scm.properties 2011-08-24 12:35:24 UTC (rev 238)
+++ trunk/src/main/resources/scm.properties 2011-08-24 12:36:33 UTC (rev 239)
@@ -1,25 +0,0 @@
-###
-# #%L
-# ScmWebEditor
-#
-# $Id$
-# $HeadURL$
-# %%
-# Copyright (C) 2009 - 2011 CodeLutin
-# %%
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Lesser Public License for more details.
-#
-# You should have received a copy of the GNU General Lesser Public
-# License along with this program. If not, see
-# <http://www.gnu.org/licenses/lgpl-3.0.html>.
-# #L%
-###
-editableFiles=text,xml,javascript,sh,x-tex,x-java
\ No newline at end of file
Added: trunk/src/main/resources/scmwebeditor.properties
===================================================================
--- trunk/src/main/resources/scmwebeditor.properties (rev 0)
+++ trunk/src/main/resources/scmwebeditor.properties 2011-08-24 12:36:33 UTC (rev 239)
@@ -0,0 +1,25 @@
+###
+# #%L
+# ScmWebEditor
+#
+# $Id$
+# $HeadURL$
+# %%
+# Copyright (C) 2009 - 2011 CodeLutin
+# %%
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Lesser Public License for more details.
+#
+# You should have received a copy of the GNU General Lesser Public
+# License along with this program. If not, see
+# <http://www.gnu.org/licenses/lgpl-3.0.html>.
+# #L%
+###
+editableFiles=text,xml,javascript,sh,x-tex,x-java
\ No newline at end of file
1
0
r238 - in trunk/src/main/java/org/nuiton/scmwebeditor: . actions
by kcardineaud@users.nuiton.org 24 Aug '11
by kcardineaud@users.nuiton.org 24 Aug '11
24 Aug '11
Author: kcardineaud
Date: 2011-08-24 14:35:24 +0200 (Wed, 24 Aug 2011)
New Revision: 238
Url: http://nuiton.org/repositories/revision/scmwebeditor/238
Log:
Use ApplicationConfig to get properties file
Modified:
trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorBaseAction.java
trunk/src/main/java/org/nuiton/scmwebeditor/actions/ScmWebEditorMainAction.java
Modified: trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorBaseAction.java
===================================================================
--- trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorBaseAction.java 2011-08-19 16:29:53 UTC (rev 237)
+++ trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorBaseAction.java 2011-08-24 12:35:24 UTC (rev 238)
@@ -110,6 +110,10 @@
protected static final String ATTRIBUTE_FILESEARCH_SERVLET_URL = "searchServletUrl";
protected static final String ATTRIBUTE_REDIRECT_URL = "Redirect_url";
protected static final String ATTRIBUTE_PRIVATE_SERVLET_URI = "privateServletUri";
+
+ protected static final String PROPERTIESFILES = "scmwebeditor.properties";
+ protected static final String EDITABLESFILES = "editableFiles";
+
protected static CodepageDetectorProxy detector;
Modified: trunk/src/main/java/org/nuiton/scmwebeditor/actions/ScmWebEditorMainAction.java
===================================================================
--- trunk/src/main/java/org/nuiton/scmwebeditor/actions/ScmWebEditorMainAction.java 2011-08-19 16:29:53 UTC (rev 237)
+++ trunk/src/main/java/org/nuiton/scmwebeditor/actions/ScmWebEditorMainAction.java 2011-08-24 12:35:24 UTC (rev 238)
@@ -25,15 +25,15 @@
package org.nuiton.scmwebeditor.actions;
import java.io.IOException;
-import java.io.InputStream;
import java.net.URL;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.LinkedList;
import java.util.Map;
import java.util.Map.Entry;
-import java.util.Properties;
import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.logging.Log;
@@ -42,10 +42,11 @@
import org.nuiton.scmwebeditor.ScmWebEditorBaseAction;
import org.nuiton.scmwebeditor.SvnConnection;
import org.nuiton.scmwebeditor.urlResolver.ScmUrlResolverEngine;
+import org.nuiton.util.ApplicationConfig;
+import org.nuiton.util.ArgumentsParserException;
import org.tmatesoft.svn.core.SVNAuthenticationException;
import org.tmatesoft.svn.core.SVNException;
-
import com.opensymphony.xwork2.Action;
@@ -61,7 +62,9 @@
protected String format;
protected String origText;
+ protected boolean saveCookie = true;
+
protected String numRevision;
@@ -82,6 +85,9 @@
protected HttpServletRequest request;
+ protected HttpServletResponse response;
+
+
protected String repositoryId;
protected boolean fromLoginPage;
@@ -277,7 +283,12 @@
if(log.isDebugEnabled()) {
log.debug("Login : "+username);
}
-
+
+
+
+ /*
+ * Récuperation des informations en session
+ */
if(username==null && pw==null) {
if(getScmSession().getUsername(repositoryUUID)!=null && getScmSession().getPassword(repositoryUUID)!=null) {
//On recupère les identifiants en session
@@ -293,9 +304,14 @@
getScmSession().addScmUser(repositoryUUID, username , pw);
}
+
svnConn.updateAuthentication(username, pw);
+
+ /*
+ * Recuperation du fichier et de sa revision
+ */
try {
originalText = getHeadRevision(address, username, pw);
numRevision = getHeadNumberRevision(address, username, pw);
@@ -344,41 +360,25 @@
}
- Properties properties=null;
- String[] editableFiles=null;
- boolean errorReadingProperties = false;
-
- try {
- InputStream inStream = getClass().getResourceAsStream("/scm.properties");
-
- properties = loadProperties(inStream);
-
-
- if(log.isDebugEnabled()) {
- log.debug("editableFiles: "+ properties.getProperty("editableFiles", "text"));
- }
- editableFiles=properties.getProperty("editableFiles", "text").split(",");
-
- } catch (IOException e) {
- if(log.isErrorEnabled()) {
- log.error("Can't read properties file", e );
- }
- errorReadingProperties=true;
- } catch (NullPointerException e) {
- if(log.isErrorEnabled()) {
- log.error("Can't read properties file", e );
- }
- errorReadingProperties=true;
+
+ ApplicationConfig config = new ApplicationConfig(PROPERTIESFILES);
+
+ LinkedList<String> editableFiles = new LinkedList<String>();
+
+ editableFiles.add("text");
+ editableFiles.add("xml");
+ editableFiles.add("x-java");
+
+ try {
+ config.parse();
+ editableFiles.addAll(config.getOptionAsList(EDITABLESFILES).getOption());
+ } catch (ArgumentsParserException eee) {
+ if(log.isErrorEnabled()) {
+ log.error("Can't read properties file", eee );
}
-
- if(errorReadingProperties) {
- editableFiles = new String[3];
- editableFiles[0] = "text";
- editableFiles[1] = "xml";
- editableFiles[2] = "x-java";
}
-
+
boolean editable =false;
if(mimeType!=null ) {
for (String fileType : editableFiles){
@@ -427,5 +427,8 @@
}
+
+
+
}
1
0
Author: tchemit
Date: 2011-08-19 18:29:53 +0200 (Fri, 19 Aug 2011)
New Revision: 237
Url: http://nuiton.org/repositories/revision/scmwebeditor/237
Log:
Update mavenpom4redmine to 3.0.2.
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-08-19 15:43:34 UTC (rev 236)
+++ trunk/pom.xml 2011-08-19 16:29:53 UTC (rev 237)
@@ -10,7 +10,7 @@
<parent>
<groupId>org.nuiton</groupId>
<artifactId>mavenpom4redmine</artifactId>
- <version>3.0.1</version>
+ <version>3.0.2</version>
</parent>
<artifactId>scmwebeditor</artifactId>
@@ -227,7 +227,7 @@
<i18n.bundleOutputName>scmwebeditor-i18n</i18n.bundleOutputName>
- <i18n.bundleOutputPackage />
+ <i18n.bundleOutputPackage/>
<!-- extra files to include in release -->
<redmine.releaseFiles>
1
0
r236 - in trunk/src/main: java/org/nuiton/scmwebeditor/actions resources webapp/WEB-INF/content webapp/css webapp/img/editor
by kcardineaud@users.nuiton.org 19 Aug '11
by kcardineaud@users.nuiton.org 19 Aug '11
19 Aug '11
Author: kcardineaud
Date: 2011-08-19 17:43:34 +0200 (Fri, 19 Aug 2011)
New Revision: 236
Url: http://nuiton.org/repositories/revision/scmwebeditor/236
Log:
#261 Improve user interface - Add a new theme
Added:
trunk/src/main/webapp/css/uploadForm.css
trunk/src/main/webapp/img/editor/head.png
trunk/src/main/webapp/img/editor/save-quit-hover.png
trunk/src/main/webapp/img/editor/save-quit-hover2.png
trunk/src/main/webapp/img/editor/save-quit.png
Modified:
trunk/src/main/java/org/nuiton/scmwebeditor/actions/ResetAction.java
trunk/src/main/resources/log4j.properties
trunk/src/main/webapp/WEB-INF/content/modificationViewer.jsp
trunk/src/main/webapp/WEB-INF/content/save.jsp
trunk/src/main/webapp/WEB-INF/content/uploadForm.jsp
trunk/src/main/webapp/css/main.css
Modified: trunk/src/main/java/org/nuiton/scmwebeditor/actions/ResetAction.java
===================================================================
--- trunk/src/main/java/org/nuiton/scmwebeditor/actions/ResetAction.java 2011-08-19 13:23:31 UTC (rev 235)
+++ trunk/src/main/java/org/nuiton/scmwebeditor/actions/ResetAction.java 2011-08-19 15:43:34 UTC (rev 236)
@@ -73,8 +73,8 @@
this.pw = pw;
}
- public void getErreur(String error) {
- this.error = error;
+ public String getError() {
+ return error;
}
Modified: trunk/src/main/resources/log4j.properties
===================================================================
--- trunk/src/main/resources/log4j.properties 2011-08-19 13:23:31 UTC (rev 235)
+++ trunk/src/main/resources/log4j.properties 2011-08-19 15:43:34 UTC (rev 236)
@@ -49,7 +49,7 @@
#log4j.appender.rolling.layout.ConversionPattern=%d{yyyy/MM/dd hh:mm:ss} %5p (%F:%L) %m%n
# package level
-#log4j.logger.org.nuiton.scmwebeditor.actions=DEBUG
+#log4j.logger.org.nuiton.scmwebeditor.actions.SaveAction=DEBUG
#log4j.logger.org.chorem.jtimer=DEBUG
#log4j.logger.org.chorem.jtimer.ws=DEBUG
Modified: trunk/src/main/webapp/WEB-INF/content/modificationViewer.jsp
===================================================================
--- trunk/src/main/webapp/WEB-INF/content/modificationViewer.jsp 2011-08-19 13:23:31 UTC (rev 235)
+++ trunk/src/main/webapp/WEB-INF/content/modificationViewer.jsp 2011-08-19 15:43:34 UTC (rev 236)
@@ -66,9 +66,12 @@
<!-- Then the CodeMirrorUI stuff -->
<script src="codemirror-ui/js/codemirror-ui.js" type="text/javascript"></script>
<link rel="stylesheet" href="codemirror-ui/css/codemirror-ui.css" type="text/css" media="screen" />
+
+
+ <script src="js/cancelRedirect.js" type="text/javascript"></script>
+ <script src="js/pictureUpload.js" type="text/javascript"></script>
-
<link rel="icon" href="img/ScmWebEditor_little.png" type="image/png">
<link rel="stylesheet" type="text/css" href="css/main.css">
@@ -76,21 +79,183 @@
</head>
<body>
- <a title="ScmWebEditor Project Website" target="_blank" href="http://maven-site.nuiton.org/scmwebeditor/"><img width="150" height="120" src="img/editor/machine-a-ecrire.png" alt="ScmWebEditor logo"/></a>
+<div id="wrapper">
+
+ <form method="POST" action="commit.action" id="editForm">
+
+ <div id="head">
+<!-- <a title="ScmWebEditor Project Website" target="_blank" href="http://maven-site.nuiton.org/scmwebeditor/"><img width="200" height="160" src="img/editor/machine-a-ecrire.png" alt="ScmWebEditor logo"/></a> -->
- <center>
- <h2><s:text name="scm.welcome"/></h2>
+ <h2 id="editorTitle" >SCMWebEditor</h2>
+
+
+<!-- authentification -->
+ <div id="headLogin">
+
+ <div id="authDiv">
+ <h3>Connexion</h3>
+
+ <s:if test="username==null || pw==null" >
+ <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:text name="scm.passwordTitle"/>
+ </s:set>
+
+ <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:if>
+ <s:else >
+ <s:text name="scm.logAs" /> <s:property value="username" /> <br/>
+ </s:else>
+
+ <div id="htmlcontentCommit">
+ <%if (request.getAttribute("badLogin")!=null && request.getAttribute("badLogin").equals(true)) { %>
+ <p>
+ <font color="red">
+ <s:text name="scm.badUsernameOrPassword"/>
+ </font>
+ </p>
+ <%} %>
+ </div>
+
+
+ </div>
+
+
+ <noscript>
+ <s:set id="scm.saveAndQuitTitle">
+ <s:text name="scm.saveAndQuitTitle"/>
+ </s:set>
+ <s:submit
+ value="commit"
+ title="%{scm.saveAndQuitTitle}"
+ name="Save"
+ />
+ </noscript>
+
+ <div id="buttonList" >
+
+ <!--BEGIN Save and continue -->
+ <s:url id="ajaxCommit" value="save.action" />
+
+ <s:set id="scm.saveAndContinueTitle">
+ <s:text name="scm.saveAndContinueTitle"/>
+ </s:set>
+ <sj:a
+ onclick="loadChange()"
+ id="ajaxSaveButton"
+ formIds="editForm"
+ targets="htmlcontentCommit"
+ href="%{ajaxCommit}"
+ title="%{scm.saveAndContinueTitle}"
+ >
+ <div id="saveButton" ></div>
+ </sj:a>
+ <!--END Save and continue -->
+
+ <!--BEGIN preview -->
+ <%if (request.getAttribute("format")!=null && request.getAttribute("format")!=null && request.getAttribute("format").equals("rst") == true){
+ %>
+ <s:url id="ajaxPreview" value="preview.action" />
+
+ <s:set id="scm.preview">
+ <s:text name="scm.preview"/>
+ </s:set>
+ <sj:a onclick="loadChange()"
+ id="ajaxPreviewButton"
+ formIds="editForm"
+ targets="htmlcontentPreview"
+ href="%{ajaxPreview}"
+ title="%{scm.preview}"
+
+ >
+ <div id="previewButton" ></div>
+ </sj:a>
+
+ <%}%>
+ <!--END preview -->
+
+ <!--BEGIN reset -->
+
+ <s:set id="scm.resetTitle">
+ <s:text name="scm.resetTitle"/>
+ </s:set>
+ <sj:a
+ title="%{scm.resetTitle}"
+ formIds="editForm"
+ id="resetButton"
+ targets="htmlcontentCommit"
+ href="reset.action"
+ >
+ <div id="resetButton" ></div>
+ </sj:a>
+
+ <!--END reset -->
+
+ <!-- BEGIN save and exit -->
+ <s:set id="scm.saveAndQuitTitle">
+ <s:text name="scm.saveAndQuitTitle"/>
+ </s:set>
+
+ <s:a
+ href="javascript:document.getElementById('editForm').submit();"
+ title="%{scm.saveAndQuitTitle}"
+ name="Save"
+ >
+ <div id="saveAndQuitButton" ></div>
+ </s:a>
+
+ <!-- END save and exit -->
+
+ <!-- BEGIN exit -->
+
+ <s:set id="scm.exitTitle">
+ <s:text name="scm.exitTitle"/>
+ </s:set>
+ <s:set id="scm.exitJavascript">
+ <s:text name="scm.exitJavascript"/>
+ </s:set>
+
+ <s:a
+ href="#"
+ title="%{scm.exitTitle}"
+ value="%{scm.exit}"
+ name="Cancel"
+ onclick="return cancelRedirect('%{scm.exitJavascript}',document.getElementById('ProjectUrl'));">
+ <div id="exitButton" ></div>
+ </s:a>
+
+ <!-- END exit -->
+
+ </div>
+ </div>
+
+
+
+
+ </div>
+
+
<%
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>
<% } %>
- </center>
+
- <form method="POST" action="commit.action" id="editForm">
+
<%
if (request.getAttribute("format")!=null){
%>
@@ -153,22 +318,13 @@
- <script src="js/cancelRedirect.js" type="text/javascript"></script>
- <script src="js/pictureUpload.js" type="text/javascript"></script>
+
<noscript><h4><s:text name="scm.modificationViewer.noJavascript"/></h4></noscript>
<noscript><h4><s:text name="scm.modificationViewer.betterUseJavascript"/></h4></noscript>
<div id="form">
- <div id="htmlcontentCommit">
- <%if (request.getAttribute("badLogin")!=null && request.getAttribute("badLogin").equals(true)) { %>
- <p>
- <font color="red">
- <s:text name="scm.badUsernameOrPassword"/>
- </font>
- </p>
- <%} %>
- </div>
+
<s:set id="scm.commitMessage">
<s:text name="scm.commitMessage"/>
@@ -180,30 +336,8 @@
<s:textarea cols="70" required="true" label="%{scm.commitMessage} " name="commitMessage" title="%{scm.commitMessageTitle}" ></s:textarea>
<p>
- <s:if test="username==null || pw==null" >
- <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: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}" />
- </div>
- </s:if>
- <s:else >
- <s:text name="scm.logAs" /> <s:property value="username" /> <br/>
- </s:else>
+
-
-
<input type="hidden" name="address" value="<%=request.getAttribute("address")%>"/>
<input type="hidden" id="origText" name="origText" value="<%=request.getAttribute("OrigText")%>"/>
<% if(request.getAttribute("lastText")!=null) { %>
@@ -211,98 +345,22 @@
<% } %>
<input type="hidden" name="scmEditorUrl" value="<%=request.getAttribute("scmEditorUrl")%>"/>
- <s:url id="ajaxCommit" value="save.action" />
+
<div id="scmButton">
-
- <s:set id="scm.saveAndContinue">
- <s:text name="scm.saveAndContinue"/>
- </s:set>
- <s:set id="scm.saveAndContinueTitle">
- <s:text name="scm.saveAndContinueTitle"/>
- </s:set>
- <sj:submit onclick="loadChange()"
- id="ajaxSaveButton"
- formIds="editForm"
- targets="htmlcontentCommit"
- href="%{ajaxCommit}"
- indicator="indicator"
- button="true"
- buttonIcon="ui-icon-refresh"
- value="%{scm.saveAndContinue}"
- title="%{scm.saveAndContinueTitle}"
- >
- </sj:submit>
+
- <s:set id="scm.saveAndQuit">
- <s:text name="scm.saveAndQuit"/>
- </s:set>
- <s:set id="scm.saveAndQuitTitle">
- <s:text name="scm.saveAndQuitTitle"/>
- </s:set>
- <s:submit cssStyle="align:center;" title="%{scm.saveAndQuitTitle}" type="button" value="%{scm.saveAndQuit}" name="Save"/>
- <%if (request.getAttribute("format")!=null && request.getAttribute("format")!=null && request.getAttribute("format").equals("rst") == true){
- %>
- <s:url id="ajaxPreview" value="preview.action" />
- <s:set id="scm.preview">
- <s:text name="scm.preview"/>
- </s:set>
- <sj:submit onclick="loadChange()"
- id="ajaxPreviewButton"
- formIds="editForm"
- targets="htmlcontentPreview"
- href="%{ajaxPreview}"
- button="true"
- buttonIcon="ui-icon-refresh"
- value="%{scm.preview}"
- >
- </sj:submit>
-
- <%}%>
- <s:set id="scm.reset">
- <s:text name="scm.reset"/>
- </s:set>
- <s:set id="scm.resetTitle">
- <s:text name="scm.resetTitle"/>
- </s:set>
- <sj:submit
- title="%{scm.resetTitle}"
- formIds="editForm"
- id="resetButton"
- targets="resetResult"
- value="%{scm.reset}"
- button="true"
- href="reset.action"
- >
- </sj:submit>
-
- <div id="resetResult"></div>
-
<% if(request.getAttribute("projectUrl")!=null) { %>
- <input type="hidden" name="ProjectUrl" value="<%=request.getAttribute("projectUrl")%>" />
+ <input type="hidden" id="ProjectUrl" value="<%=request.getAttribute("projectUrl")%>" />
<% } else { %>
- <input type="hidden" name="ProjectUrl" value="checkout.action" />
+ <input type="hidden" id="ProjectUrl" value="checkout.action" />
<% } %>
- <s:set id="scm.exit">
- <s:text name="scm.exit"/>
- </s:set>
- <s:set id="scm.exitTitle">
- <s:text name="scm.exitTitle"/>
- </s:set>
- <s:set id="scm.exitJavascript">
- <s:text name="scm.exitJavascript"/>
- </s:set>
-
-
- <s:submit title="%{scm.exitTitle}" type="button" value="%{scm.exit}" name="Cancel" onclick="return cancelRedirect('%{scm.exitJavascript}',this.form.ProjectUrl);"/>
-
- <br/>
</div>
</div>
@@ -355,10 +413,10 @@
<div id="targetContentUpload"></div>
-
+
<div id="htmlcontentPreview"></div>
-
+</div>
<p align="right">©2004-2009 CodeLutin</p>
</body>
</html>
Modified: trunk/src/main/webapp/WEB-INF/content/save.jsp
===================================================================
--- trunk/src/main/webapp/WEB-INF/content/save.jsp 2011-08-19 13:23:31 UTC (rev 235)
+++ trunk/src/main/webapp/WEB-INF/content/save.jsp 2011-08-19 15:43:34 UTC (rev 236)
@@ -28,14 +28,14 @@
<s:if test="result=='login'" >
- <h4> <font color="red"><s:text name="scm.badUsernameOrPassword"/> <s:text name="scm.cannotSave"/></font> </h4>
+ <p> <font color="red"><s:text name="scm.badUsernameOrPassword"/><br/> <s:text name="scm.cannotSave"/></font> </p>
</s:if>
<s:elseif test="result=='error'" >
- <h4> <s:text name="scm.cannotSave" /></h4>
+ <p> <s:text name="scm.cannotSave" /></p>
</s:elseif>
<s:elseif test="result=='errorRst'" >
- <h4> <s:text name="scm.rstNotValidMessage" /> </h4>
+ <p> <s:text name="scm.rstNotValidMessage" /> </p>
<s:url id="ajaxForceSave" action="save" />
<input type="hidden" name="force" value="true"/>
@@ -58,7 +58,7 @@
</s:elseif>
<s:elseif test="result=='fileModify'" >
- <h4><s:text name="scm.fileModify" /> <s:text name="scm.by" /> <s:property value="headCommiter" /></h4>
+ <p><s:text name="scm.fileModify" /> <s:text name="scm.by" /> <s:property value="headCommiter" /></p>
<s:set id="scm.showDiff" >
<s:text name="scm.showDiff" />
@@ -91,15 +91,15 @@
</s:elseif>
<s:elseif test="result=='errorPath'" >
- <h4><s:text name="scm.cannotSave"/>, <s:text name="scm.pathError"/></h4>
+ <p><s:text name="scm.cannotSave"/>, <s:text name="scm.pathError"/></p>
</s:elseif>
<s:elseif test="result=='uselessSave'" >
- <h4><s:text name="scm.uselessSave"/></h4>
+ <p><s:text name="scm.uselessSave"/></p>
</s:elseif>
<s:else>
- <h4><s:text name="scm.lastChangeSave"/><s:property value="formatDate" /> </h4>
+ <p><s:text name="scm.lastChangeSave"/><s:property value="formatDate" /> </p>
<s:set id="lastRevSet" value="newText" />
<s:hidden id="lastRev" value="%{lastRevSet}" />
<script type="text/javascript">
Modified: trunk/src/main/webapp/WEB-INF/content/uploadForm.jsp
===================================================================
--- trunk/src/main/webapp/WEB-INF/content/uploadForm.jsp 2011-08-19 13:23:31 UTC (rev 235)
+++ trunk/src/main/webapp/WEB-INF/content/uploadForm.jsp 2011-08-19 15:43:34 UTC (rev 236)
@@ -37,9 +37,9 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>UploadFile</title>
<link rel="stylesheet" type="text/css" href="css/main.css">
+<link rel="stylesheet" type="text/css" href="css/uploadForm.css">
-
</head>
<body>
@@ -59,10 +59,13 @@
<s:set id="scm.upload">
<s:text name="scm.upload"/>
</s:set>
- <center><h1><s:text name="%{scm.upload}" ></s:text></h1></center>
+
<form method="POST" id="uploadForm" action="doUpload.action" enctype="multipart/form-data">
+
+ <center><h1><s:text name="%{scm.upload}" ></s:text></h1></center>
+
<label><s:text name="scm.uploadFile" /> : <input type="file" name="upload"/></label><br/>
<label><s:text name="scm.uploadPath" /> : <s:textfield size="50px" type="text" name="svnPath" id="svnPath" value="%{fileRoot}" /></label><br/>
Modified: trunk/src/main/webapp/css/main.css
===================================================================
--- trunk/src/main/webapp/css/main.css 2011-08-19 13:23:31 UTC (rev 235)
+++ trunk/src/main/webapp/css/main.css 2011-08-19 15:43:34 UTC (rev 236)
@@ -35,6 +35,10 @@
border:none;
}
+h3, p {
+ margin:0;
+}
+
.wwlbl , .wwctrl {
display:inline;
}
@@ -111,6 +115,119 @@
}
+#wrapper {
+ background-image:url("../img/editor/head.png");
+ background-repeat:no-repeat;
+}
+
+
+#head {
+ margin:auto;
+ height:190px;
+ background-image:url("../img/editor/machine-a-ecrire.png");
+ background-repeat:no-repeat;
+ background-position:20px top;
+}
+
+#headLogin {
+ position: relative;
+ bottom:31px;
+ left:556px;
+ margin:0;
+ background-image:url("../img/editor/post-it.png");
+ background-repeat:no-repeat;
+ width:460px;
+ height:190px;
+}
+
+#authDiv {
+ color:white;
+ float:right;
+ margin-right:30px;
+ text-align:center;
+ width:261px;
+}
+
+#htmlcontentCommit {
+ height:77px
+}
+
+
+#buttonList {
+ width:170px;
+ height:32px;
+ position:relative;
+ left:169px;
+ top:147px;
+}
+
+
+/* Button */
+
+#saveButton {
+ float:left;
+ background-image:url("../img/editor/save.png");
+ height:33px;
+ width:33px;
+}
+
+#saveButton:hover {
+ background-image:url("../img/editor/save-hover.png");
+}
+
+#previewButton {
+ float:left;
+ background-image:url("../img/editor/screen.png");
+ height:33px;
+ width:33px;
+}
+
+#previewButton:hover {
+ background-image:url("../img/editor/screen-hover.png");
+}
+
+#resetButton {
+ float:left;
+ background-image:url("../img/editor/recycle.png");
+ height:33px;
+ width:33px;
+}
+
+#resetButton:hover {
+ background-image:url("../img/editor/recycle-hover.png");
+}
+
+#saveAndQuitButton {
+ float:left;
+ background-image:url("../img/editor/save-quit.png");
+ height:33px;
+ width:33px;
+}
+
+#saveAndQuitButton:hover {
+ background-image:url("../img/editor/save-quit-hover.png");
+}
+
+#exitButton {
+ float:left;
+ background-image:url("../img/editor/shut-down.png");
+ height:33px;
+ width:33px;
+}
+
+#exitButton:hover {
+ background-image:url("../img/editor/shut-down-hover.png");
+}
+
+/* END Button */
+
+#editorTitle {
+ margin:auto;
+ width:198px;
+ position:relative;
+ top:70px;
+}
+
#uploadFormId {
width:70%;
margin:auto;
@@ -119,6 +236,7 @@
text-align:left;
}
+
.CodeMirror-scroll {
height:500px;
}
Added: trunk/src/main/webapp/css/uploadForm.css
===================================================================
--- trunk/src/main/webapp/css/uploadForm.css (rev 0)
+++ trunk/src/main/webapp/css/uploadForm.css 2011-08-19 15:43:34 UTC (rev 236)
@@ -0,0 +1,39 @@
+/*
+ * #%L
+ * ScmWebEditor
+ *
+ * $Id$
+ * $HeadURL$
+ * %%
+ * Copyright (C) 2009 - 2011 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Lesser Public License for more details.
+ *
+ * You should have received a copy of the GNU General Lesser Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/lgpl-3.0.html>.
+ * #L%
+ */
+@CHARSET "UTF-8";
+
+body {
+ font-family: Verdana,Arial,Helvetica,sans-serif;
+ background-color: #b8b1b1;
+ width:700px;
+ margin:auto;
+}
+
+#searchTree {
+ margin:auto;
+ display:block;
+ border : solid 1px black;
+ margin-right:15px;
+}
\ No newline at end of file
Added: trunk/src/main/webapp/img/editor/head.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/webapp/img/editor/head.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/webapp/img/editor/save-quit-hover.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/webapp/img/editor/save-quit-hover.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/webapp/img/editor/save-quit-hover2.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/webapp/img/editor/save-quit-hover2.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/webapp/img/editor/save-quit.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/webapp/img/editor/save-quit.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
1
0
r235 - in trunk/src/main/java/org/nuiton/scmwebeditor: . actions
by kcardineaud@users.nuiton.org 19 Aug '11
by kcardineaud@users.nuiton.org 19 Aug '11
19 Aug '11
Author: kcardineaud
Date: 2011-08-19 15:23:31 +0200 (Fri, 19 Aug 2011)
New Revision: 235
Url: http://nuiton.org/repositories/revision/scmwebeditor/235
Log:
Fix an issue with authentification in reset action
Modified:
trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorBaseAction.java
trunk/src/main/java/org/nuiton/scmwebeditor/actions/ResetAction.java
Modified: trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorBaseAction.java
===================================================================
--- trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorBaseAction.java 2011-08-19 10:30:54 UTC (rev 234)
+++ trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorBaseAction.java 2011-08-19 13:23:31 UTC (rev 235)
@@ -262,38 +262,13 @@
String lastRevision = "";
- SvnConnection svnConn = null;
+ SvnConnection svnConn = new SvnConnection(address);
- svnConn = new SvnConnection(address);
-
-
+
String url = svnConn.getSvnPath();
String file = svnConn.getFileName();
- //Si le repo n'est pas protege en ecriture on recupere sont UUID
- String repositoryUUID = svnConn.getUUID();
- if (repositoryUUID==null) {
- repositoryUUID=address;
- }
-
- if(login==null && password==null) {
- if(getScmSession().getUsername(repositoryUUID)!=null && getScmSession().getPassword(repositoryUUID)!=null) {
- //On recupère les identifiants en session
- login = getScmSession().getUsername(repositoryUUID);
- password = getScmSession().getPassword(repositoryUUID);
- }
- else {
- login = "anonymous";
- password = "anonymous";
- }
- }
- else {
- getScmSession().addScmUser(repositoryUUID, login , password);
- }
-
-
-
SVNRepository repository = SVNRepositoryFactory.create( SVNURL.parseURIEncoded( url ));
ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager( login , password );
repository.setAuthenticationManager( authManager );
Modified: trunk/src/main/java/org/nuiton/scmwebeditor/actions/ResetAction.java
===================================================================
--- trunk/src/main/java/org/nuiton/scmwebeditor/actions/ResetAction.java 2011-08-19 10:30:54 UTC (rev 234)
+++ trunk/src/main/java/org/nuiton/scmwebeditor/actions/ResetAction.java 2011-08-19 13:23:31 UTC (rev 235)
@@ -27,6 +27,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.scmwebeditor.ScmWebEditorBaseAction;
+import org.nuiton.scmwebeditor.SvnConnection;
import org.tmatesoft.svn.core.SVNAuthenticationException;
import org.tmatesoft.svn.core.SVNException;
@@ -79,12 +80,32 @@
public String execute() {
-
+ SvnConnection svnConn = new SvnConnection(address);
+
+ //Si le repo n'est pas protege en ecriture on recupere sont UUID
+ String repositoryUUID = svnConn.getUUID();
+ if (repositoryUUID==null) {
+ repositoryUUID=address;
+ }
+
+ if(username==null && pw==null) {
+ if(getScmSession().getUsername(repositoryUUID)!=null && getScmSession().getPassword(repositoryUUID)!=null) {
+ //On recupère les identifiants en session
+ username = getScmSession().getUsername(repositoryUUID);
+ pw = getScmSession().getPassword(repositoryUUID);
+ }
+ else {
+ username = null;
+ pw = null;
+ }
+ }
+
+
try {
lastRevision = getHeadRevision(address, username, pw);
- numRevision=getHeadNumberRevision(address, username, pw);
+ numRevision =getHeadNumberRevision(address, username, pw);
} catch (SVNAuthenticationException authexep) {
1
0