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
July 2011
- 1 participants
- 44 discussions
r174 - in trunk/src/main: resources resources/i18n webapp/WEB-INF/content webapp/css webapp/js
by kcardineaud@users.nuiton.org 19 Jul '11
by kcardineaud@users.nuiton.org 19 Jul '11
19 Jul '11
Author: kcardineaud
Date: 2011-07-19 14:41:07 +0200 (Tue, 19 Jul 2011)
New Revision: 174
Url: http://nuiton.org/repositories/revision/scmwebeditor/174
Log:
ModificationViewer.jsp is now in i18n
Modified:
trunk/src/main/resources/i18n/scmwebeditor_en_GB.properties
trunk/src/main/resources/i18n/scmwebeditor_fr_FR.properties
trunk/src/main/resources/struts.xml
trunk/src/main/webapp/WEB-INF/content/modificationViewer.jsp
trunk/src/main/webapp/css/main.css
trunk/src/main/webapp/js/cancelRedirect.js
Modified: trunk/src/main/resources/i18n/scmwebeditor_en_GB.properties
===================================================================
--- trunk/src/main/resources/i18n/scmwebeditor_en_GB.properties 2011-07-18 15:23:54 UTC (rev 173)
+++ trunk/src/main/resources/i18n/scmwebeditor_en_GB.properties 2011-07-19 12:41:07 UTC (rev 174)
@@ -9,4 +9,23 @@
scm.text=Text
scm.modificationViewer.noJavascript=Javascript is not activated. You can't only use Save and Quit or upload button.
scm.modificationViewer.betterUseJavascript=For a better use of SCMWebEditor please activate JavaScript.
-scm.commitMessage=Commit message \:
\ No newline at end of file
+scm.commitMessage=Commit message
+scm.username=Username
+scm.password=Password
+scm.commitMessageTitle=let a message for commit
+scm.FileInEditor=File in editor \:
+scm.usernameTitle=Repository username
+scm.passwordTitle=Repository password
+scm.logAs=You are log as \:
+scm.saveAndContinue=Save and Continue Editing
+scm.saveAndContinueTitle=Commit modifications and continue editing the file.
+scm.saveAndQuit=Save and quit
+scm.saveAndQuitTitle=Save this file and go back to previous page.
+scm.preview=Preview
+scm.reset=Reset
+scm.resetTitle=Go back to the last revision of the file
+scm.exit=Exit
+scm.exitTitle=Exit ScmWebEditor without saving.
+scm.exitJavascript=Exit ScmWebEditor without saving ? All modification will be lost.
+scm.upload=Upload
+scm.uploadTitle=Upload a file on the repository
\ No newline at end of file
Modified: trunk/src/main/resources/i18n/scmwebeditor_fr_FR.properties
===================================================================
--- trunk/src/main/resources/i18n/scmwebeditor_fr_FR.properties 2011-07-18 15:23:54 UTC (rev 173)
+++ trunk/src/main/resources/i18n/scmwebeditor_fr_FR.properties 2011-07-19 12:41:07 UTC (rev 174)
@@ -1,12 +1,31 @@
-scm.commitMessage=Message associe au commit \:
+scm.FileInEditor=Fichier dans l''editeur \:
+scm.commitMessage=Message associe au commit
+scm.commitMessageTitle=laisser un message pour le commit
+scm.exit=Quitter
+scm.exitJavascript=Quitter ScmWebEditor sans sauvegarder ? Toutes les modifications serons perdues.
+scm.exitTitle=Quitter ScmWebEditor sans sauvegarder.
scm.info.ProblemWithRst=Si vous rencontrez des problemes avec RestruturedText, visitez le
scm.info.rstWebsite=site de la documentation RST
-scm.language=langage
+scm.language=Langage
+scm.logAs=Connecte
scm.modificationViewer.betterUseJavascript=
scm.modificationViewer.noJavascript=Javascript est desactive. Vous pouvais seulement utiliser les boutons sauvegarder et quitter, quitter ou upload.
-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.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.search=Chercher
+scm.password=Mot de passe
+scm.passwordTitle=Mot de pass du depot
+scm.preview=Apercu
+scm.reset=Reinitialiser
+scm.resetTitle=Retour a la derniere revision du fichier
+scm.saveAndContinue=Sauvegarder et continuer
+scm.saveAndContinueTitle=Enregister les modifications sur le depot et continer d''editer le fichier
+scm.saveAndQuit=Sauvegarder et quitter
+scm.saveAndQuitTitle=Sauvegarder le fichier sur le depot et retourner à la page precedente.
scm.text=Texte
+scm.upload=Ajouter un fichier
+scm.uploadTitle=Ajouter un fichier sur le depot
+scm.username=Identifiant
+scm.usernameTitle=Identifiant du depot
scm.welcome=Bienvenue sur SCMWebEditor
Modified: trunk/src/main/resources/struts.xml
===================================================================
--- trunk/src/main/resources/struts.xml 2011-07-18 15:23:54 UTC (rev 173)
+++ trunk/src/main/resources/struts.xml 2011-07-19 12:41:07 UTC (rev 174)
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration
2.0//EN"
Modified: trunk/src/main/webapp/WEB-INF/content/modificationViewer.jsp
===================================================================
--- trunk/src/main/webapp/WEB-INF/content/modificationViewer.jsp 2011-07-18 15:23:54 UTC (rev 173)
+++ trunk/src/main/webapp/WEB-INF/content/modificationViewer.jsp 2011-07-19 12:41:07 UTC (rev 174)
@@ -49,12 +49,12 @@
<a title="ScmWebEditor Project Website" target="_blank" href="http://maven-site.nuiton.org/scmwebeditor/"><img src="img/ScmWebEditor_main.png" alt="ScmWebEditor logo"/></a>
<center>
- <h2>Welcome on SCMWebEditor</h2>
+ <h2><s:text name="scm.welcome"/></h2>
<%
String typeEditor="null";
if (request.getAttribute("format")!=null && request.getAttribute("format").equals("rst")){
%>
- <h4>For any Problem with RestruturedText visit <a href="http://docutils.sourceforge.net/rst.html">RST documentation website</a>.</h4>
+ <h4><s:text name="scm.info.ProblemWithRst"/> <a href="http://docutils.sourceforge.net/rst.html"><s:text name="scm.info.rstWebsite"/></a>.</h4>
<% } %>
</center>
@@ -74,7 +74,9 @@
%>
- <p>File in editor : <a href="<%=request.getAttribute("address")%>" ><%=request.getAttribute("address")%></a> </p>
+ <p>
+ <s:text name="scm.FileInEditor"/><a href="<%=request.getAttribute("address")%>" ><%=request.getAttribute("address")%></a>
+ </p>
<textarea id="newTextId" rows="50" cols="80" name="newText"><%=valueTextarea%></textarea>
@@ -87,9 +89,9 @@
</script>
- <label>Language :
+ <label><s:text name="scm.language"/>
<select id="language" name="langageSelection" onchange="changeModeBy(editor,this)">
- <option value="null">Text</option>
+ <option value="null"><s:text name="scm.text"/></option>
<option value="rst">ReStructuredText</option>
<option value="javascript">Javascript</option>
<option value="text/html">HTML</option>
@@ -117,15 +119,23 @@
<script src="js/gereSession.js" type="text/javascript"></script>
<script src="js/cancelRedirect.js" type="text/javascript"></script>
<script src="js/pictureUpload.js" type="text/javascript"></script>
- <noscript><h4>Javascript is not activated. You can't only use Save and Quit or Reset button.</h4></noscript>
- <noscript><h4>For a better use of SCMWebEditor please activate JavaScript.</h4></noscript>
+ <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"></div>
- <label>Commit Message: <input type="text" name="commitMessage" title="Let a commit message with this file."/></label>
+ <s:set id="scm.commitMessage">
+ <s:text name="scm.commitMessage"/>
+ </s:set>
+ <s:set id="scm.commitMessageTitle">
+ <s:text name="scm.commitMessageTitle"/>
+ </s:set>
+ <s:textfield required="true" label="%{scm.commitMessage}" name="commitMessage" title="%{scm.commitMessageTitle}" />
+
+
<%if (request.getAttribute("IsLogin").equals(false) == true){
%>
<%if (request.getAttribute("badLogin")!=null && request.getAttribute("badLogin").equals(true)) { %>
@@ -137,10 +147,27 @@
<% } %>
<p>
- <label ACCESSKEY=U>User name: <input TYPE=text NAME=username SIZE=12 title="Commit Username."/></label>
- <label ACCESSKEY=P>Password: <input TYPE=password NAME=pw SIZE=12 title="Commit Password."/></label> </p><%
+
+ <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>
+
+ <%
} else {
- %><p>You are log as: <%=request.getAttribute("Login")%></p>
+ %><p><s:text name="scm.logAs"/> <%=request.getAttribute("Login")%></p>
<input type="hidden" NAME=username />
<input type="hidden" NAME=pw /><%
}%>
@@ -153,6 +180,15 @@
<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"
@@ -161,17 +197,26 @@
indicator="indicator"
button="true"
buttonIcon="ui-icon-refresh"
- value="Save and Continue Editing"
- title="Commit modifications and continue editing the file"
+ value="%{scm.saveAndContinue}"
+ title="%{scm.saveAndContinueTitle}"
>
</sj:submit>
-
- <input title="Save this file and go back to previous page." type="submit" value="Save and Quit" name="Save"/>
+ <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"
@@ -179,35 +224,61 @@
href="%{ajaxPreview}"
button="true"
buttonIcon="ui-icon-refresh"
- value="Preview"
+ 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="Go back to the last revision of the file"
+ title="%{scm.resetTitle}"
id="resetButton"
- targets="resetResult"
- value="Reset"
+ targets="resetResult"
+ value="%{scm.reset}"
button="true"
href="reset.action"
/>
+
<div id="resetResult"></div>
- <!-- <input title="Reset text as current repository HEAD revision." type="reset" value="Reset" name="Reset" /> -->
<input type="hidden" value="<%=request.getAttribute("ProjectUrl")%>" name="ProjectUrl">
- <input title="Exit ScmWebEditor without saving." type="button" value="Exit" name="Cancel" onclick="javascript:cancelRedirect(this.form.ProjectUrl);"/>
+
+ <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>
</form>
+
+ <s:set id="scm.upload">
+ <s:text name="scm.upload"/>
+ </s:set>
+ <s:set id="scm.uploadTitle">
+ <s:text name="scm.uploadTitle"/>
+ </s:set>
<center>
- <button title="Upload a file on the repository" onClick="javascript:upload_popup('doUpload.action','upload');" >Upload</button>
+ <s:submit name="uploadButton" value="%{scm.upload}" title="%{scm.uploadTitle}" onClick="javascript:upload_popup('doUpload.action','upload');" />
</center>
+
+
<div>
Modified: trunk/src/main/webapp/css/main.css
===================================================================
--- trunk/src/main/webapp/css/main.css 2011-07-18 15:23:54 UTC (rev 173)
+++ trunk/src/main/webapp/css/main.css 2011-07-19 12:41:07 UTC (rev 174)
@@ -6,6 +6,9 @@
margin:auto;
}
+.wwlbl , .wwctrl {
+ display:inline;
+}
#form {
width:70%;
@@ -15,6 +18,24 @@
text-align:center;
}
+#wwctrl_Save, #wwctrl_Cancel, #wwctrl_uploadButton {
+ text-align:center;
+}
+
+#wwgrp_username {
+ float:left;
+ }
+
+#scmButton {
+
+}
+
+#loginDiv {
+ margin:auto;
+ width:285px;
+}
+
+
#uploadFormId {
width:70%;
margin:auto;
Modified: trunk/src/main/webapp/js/cancelRedirect.js
===================================================================
--- trunk/src/main/webapp/js/cancelRedirect.js 2011-07-18 15:23:54 UTC (rev 173)
+++ trunk/src/main/webapp/js/cancelRedirect.js 2011-07-19 12:41:07 UTC (rev 174)
@@ -3,9 +3,11 @@
*/
-function cancelRedirect(url)
+function cancelRedirect(text, url)
{
- if (confirm("Exit SCMWebEditor ?")){
+ if (confirm(text)){
window.location.replace(url.value);
+ return false;
}
+ else {return false};
}
\ No newline at end of file
1
0
Author: kcardineaud
Date: 2011-07-18 17:23:54 +0200 (Mon, 18 Jul 2011)
New Revision: 173
Url: http://nuiton.org/repositories/revision/scmwebeditor/173
Log:
Texts in outConnection.jsp are now compatible with i18n
Modified:
trunk/src/main/webapp/WEB-INF/content/outConnection.jsp
Modified: trunk/src/main/webapp/WEB-INF/content/outConnection.jsp
===================================================================
--- trunk/src/main/webapp/WEB-INF/content/outConnection.jsp 2011-07-18 15:21:26 UTC (rev 172)
+++ trunk/src/main/webapp/WEB-INF/content/outConnection.jsp 2011-07-18 15:23:54 UTC (rev 173)
@@ -18,19 +18,22 @@
<body>
<a target="_blank" href="http://maven-site.nuiton.org/scmwebeditor/"><img src="img/ScmWebEditor_main.png" alt="$alt" /></a>
<center>
-<h2>Welcome on SCMWebEditor</h2>
-<noscript><h4>Javascript is not activated. Please activate it for a fully use of ScmWebEditor.</h4></noscript>
+<h2><s:text name="scm.welcome"/></h2>
+<noscript><h4><s:text name="scm.outConnection.noJavascript"/></h4></noscript>
<h4>
-Please complete this form for application using.
+<s:text name="scm.outConnection.enterRepo"/>
</h4>
</center>
<form id="configForm" method="get" action="checkout.action">
<center>
- <p><label>SCM path: <input TYPE=text name="address" SIZE=100></label>
+ <p><label><s:text name="scm.outConnection.scmPath"/> <input TYPE=text name="address" SIZE=100></label>
<s:url id="ajaxSearch" value="search.action" />
+ <s:set id="search">
+ <s:text name="scm.outConnection.search"/>
+ </s:set>
<sj:submit
id="ajaxSearchButton"
formIds="configForm"
@@ -39,7 +42,7 @@
indicator="indicator"
button="true"
buttonIcon="ui-icon-refresh"
- value="Search"
+ value="%{search}"
>
</sj:submit>
1
0
r172 - in trunk: . src/main src/main/i18n src/main/resources src/main/resources/i18n
by kcardineaud@users.nuiton.org 18 Jul '11
by kcardineaud@users.nuiton.org 18 Jul '11
18 Jul '11
Author: kcardineaud
Date: 2011-07-18 17:21:26 +0200 (Mon, 18 Jul 2011)
New Revision: 172
Url: http://nuiton.org/repositories/revision/scmwebeditor/172
Log:
Add i18n in scmwebeditor
Added:
trunk/src/main/i18n/
trunk/src/main/i18n/jsp.rules
trunk/src/main/resources/i18n/
trunk/src/main/resources/i18n/scmwebeditor_en_GB.properties
trunk/src/main/resources/i18n/scmwebeditor_fr_FR.properties
trunk/src/main/resources/struts.properties
Modified:
trunk/pom.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-07-12 12:40:41 UTC (rev 171)
+++ trunk/pom.xml 2011-07-18 15:21:26 UTC (rev 172)
@@ -79,6 +79,14 @@
<version>0.9</version>
</dependency>
+
+ <dependency>
+ <groupId>org.nuiton.i18n</groupId>
+ <artifactId>nuiton-i18n</artifactId>
+ <version>${nuitonI18nVersion}</version>
+ <scope>compile</scope>
+ </dependency>
+
<!-- Struts -->
<dependency>
@@ -185,7 +193,15 @@
<struts2Version>2.2.3</struts2Version>
<struts2jqueryVersion>3.1.0</struts2jqueryVersion>
<strutsxworksVersion>2.2.3</strutsxworksVersion>
+ <nuitonI18nVersion>2.4</nuitonI18nVersion>
+ <i18n.bundles>fr_FR,en_GB</i18n.bundles>
+ <i18n.silent>true</i18n.silent>
+
+ <i18n.silent>true</i18n.silent>
+ <i18n.bundleOutputName>scmwebeditor-i18n</i18n.bundleOutputName>
+ <i18n.bundleOutputPackage/>
+
<!-- extra files to include in release -->
<redmine.releaseFiles>${redmine.libReleaseFiles}</redmine.releaseFiles>
@@ -195,8 +211,65 @@
<build>
- <pluginManagement>
+
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+
<plugins>
+
+
+
+
+ <plugin>
+
+ <groupId>org.nuiton.i18n</groupId>
+ <artifactId>maven-i18n-plugin</artifactId>
+ <version>${nuitonI18nVersion}</version>
+ <configuration>
+ <bundles>fr_FR</bundles>
+ </configuration>
+ <executions>
+ <execution>
+ <id>scan-java-sources</id>
+ <goals>
+ <goal>parserJava</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>scan-jsp-sources</id>
+ <goals>
+ <goal>parserJsp</goal>
+ </goals>
+ <configuration>
+ <userRulesFiles>
+ <file>${basedir}/src/main/i18n/jsp.rules</file>
+ </userRulesFiles>
+ <namespaces>
+ <s>http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd</s>
+ <sx>http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd</sx>
+ <sj>http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd</sj>
+ <jsp>http://java.sun.com/JSP/Page</jsp>
+ </namespaces>
+ </configuration>
+ </execution>
+ <execution>
+ <id>gen-and-make-bundle</id>
+ <goals>
+ <goal>gen</goal>
+ <goal>bundle</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
@@ -221,7 +294,6 @@
</dependencies>
</plugin>
</plugins>
- </pluginManagement>
</build>
@@ -247,27 +319,8 @@
<plugins>
- <!-- launch in a release the assembly automaticly -->
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <id>create-assemblies</id>
- <phase>verify</phase>
- <goals>
- <goal>single</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <attach>false</attach>
- <descriptorRefs>
- <descriptorRef>deps</descriptorRef>
- <descriptorRef>full</descriptorRef>
- </descriptorRefs>
- </configuration>
- </plugin>
+
</plugins>
</build>
</profile>
Added: trunk/src/main/i18n/jsp.rules
===================================================================
--- trunk/src/main/i18n/jsp.rules (rev 0)
+++ trunk/src/main/i18n/jsp.rules 2011-07-18 15:21:26 UTC (rev 172)
@@ -0,0 +1,12 @@
+# Règles i18n pour les jsp
+
+//s:text/@name
+//s:submit/@key
+//sj:submit/@key
+//s:textfield/@key
+//s:checkbox/@key
+//s:password/@key
+//s:file/@key
+//s:label/@key
+//s:optiontransferselect/@key
+//s:select/@key
\ No newline at end of file
Added: trunk/src/main/resources/i18n/scmwebeditor_en_GB.properties
===================================================================
--- trunk/src/main/resources/i18n/scmwebeditor_en_GB.properties (rev 0)
+++ trunk/src/main/resources/i18n/scmwebeditor_en_GB.properties 2011-07-18 15:21:26 UTC (rev 172)
@@ -0,0 +1,12 @@
+scm.outConnection.search=Search
+scm.outConnection.scmPath=SCM path \:
+scm.welcome=Welcome on SCMWebEditor
+scm.outConnection.noJavascript=Javascript is not activated. Please activate it for a fully use of ScmWebEditor.
+scm.outConnection.enterRepo=Please enter your repository address.
+scm.info.ProblemWithRst=For any Problem with RestruturedText visit
+scm.info.rstWebsite=RST documentation website
+scm.language=Language
+scm.text=Text
+scm.modificationViewer.noJavascript=Javascript is not activated. You can't only use Save and Quit or upload button.
+scm.modificationViewer.betterUseJavascript=For a better use of SCMWebEditor please activate JavaScript.
+scm.commitMessage=Commit message \:
\ No newline at end of file
Added: trunk/src/main/resources/i18n/scmwebeditor_fr_FR.properties
===================================================================
--- trunk/src/main/resources/i18n/scmwebeditor_fr_FR.properties (rev 0)
+++ trunk/src/main/resources/i18n/scmwebeditor_fr_FR.properties 2011-07-18 15:21:26 UTC (rev 172)
@@ -0,0 +1,12 @@
+scm.commitMessage=Message associe au commit \:
+scm.info.ProblemWithRst=Si vous rencontrez des problemes avec RestruturedText, visitez le
+scm.info.rstWebsite=site de la documentation RST
+scm.language=langage
+scm.modificationViewer.betterUseJavascript=
+scm.modificationViewer.noJavascript=Javascript est desactive. Vous pouvais seulement utiliser les boutons sauvegarder et quitter, quitter ou upload.
+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.search=Chercher
+scm.text=Texte
+scm.welcome=Bienvenue sur SCMWebEditor
Added: trunk/src/main/resources/struts.properties
===================================================================
--- trunk/src/main/resources/struts.properties (rev 0)
+++ trunk/src/main/resources/struts.properties 2011-07-18 15:21:26 UTC (rev 172)
@@ -0,0 +1,45 @@
+struts.locale=fr_FR
+struts.i18n.encoding=UTF-8
+
+# struts.multipart.parser=cos
+# struts.multipart.parser=pell
+struts.multipart.parser=jakarta
+# uses javax.servlet.context.tempdir by default
+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.serve.static=true
+
+struts.serve.static.browserCache=true
+
+struts.tag.altSyntax=true
+
+struts.devMode=true
+
+struts.i18n.reload=true
+
+struts.ui.theme=css_xhtml
+struts.ui.templateDir=template
+#sets the default template type. Either ftl, vm, or jsp
+struts.ui.templateSuffix=ftl
+
+struts.configuration.xml.reload=false
+
+struts.url.http.port = 80
+struts.url.https.port = 443
+
+struts.custom.i18n.resources=scmwebeditor-i18n
+
+struts.dispatcher.parametersWorkaround = false
+
+#struts.freemarker.manager.classname=org.apache.struts2.views.freemarker.FreemarkerManager
+
+struts.freemarker.wrapper.altMap=true
+
+struts.xslt.nocache=false
1
0
r171 - in trunk/src/main: java/org/nuiton/scmwebeditor/actions resources webapp webapp/WEB-INF webapp/WEB-INF/content webapp/js
by kcardineaud@users.nuiton.org 12 Jul '11
by kcardineaud@users.nuiton.org 12 Jul '11
12 Jul '11
Author: kcardineaud
Date: 2011-07-12 14:40:41 +0200 (Tue, 12 Jul 2011)
New Revision: 171
Url: http://nuiton.org/repositories/revision/scmwebeditor/171
Log:
Move jsp and javascript file in proper directory and delete capital letter for jsp files names
Added:
trunk/src/main/webapp/WEB-INF/content/
trunk/src/main/webapp/WEB-INF/content/accueil.jsp
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/index.jsp
trunk/src/main/webapp/WEB-INF/content/loginSearch.jsp
trunk/src/main/webapp/WEB-INF/content/modificationViewer.jsp
trunk/src/main/webapp/WEB-INF/content/outConnection.jsp
trunk/src/main/webapp/WEB-INF/content/preview.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/WEB-INF/content/reset.jsp
trunk/src/main/webapp/WEB-INF/content/save.jsp
trunk/src/main/webapp/WEB-INF/content/search.jsp
trunk/src/main/webapp/WEB-INF/content/upload.jsp
trunk/src/main/webapp/WEB-INF/content/uploadForm.jsp
trunk/src/main/webapp/WEB-INF/content/uploadSuccess.jsp
trunk/src/main/webapp/js/
trunk/src/main/webapp/js/cancelRedirect.js
trunk/src/main/webapp/js/gereSession.js
trunk/src/main/webapp/js/pictureUpload.js
trunk/src/main/webapp/js/selectLanguage.js
Removed:
trunk/src/main/webapp/BadFileRedirect.jsp
trunk/src/main/webapp/BadUseRedirect.jsp
trunk/src/main/webapp/Error.jsp
trunk/src/main/webapp/GereSession.js
trunk/src/main/webapp/LoginSearch.jsp
trunk/src/main/webapp/ModificationViewer.jsp
trunk/src/main/webapp/OutConnection.jsp
trunk/src/main/webapp/Preview.jsp
trunk/src/main/webapp/PrivateSvnRedirect.jsp
trunk/src/main/webapp/Recall.jsp
trunk/src/main/webapp/Redirect.jsp
trunk/src/main/webapp/Save.jsp
trunk/src/main/webapp/Search.jsp
trunk/src/main/webapp/accueil.jsp
trunk/src/main/webapp/cancelRedirect.js
trunk/src/main/webapp/index.jsp
trunk/src/main/webapp/pictureUpload.js
trunk/src/main/webapp/reset.jsp
trunk/src/main/webapp/selectLanguage.js
trunk/src/main/webapp/upload.jsp
trunk/src/main/webapp/uploadForm.jsp
trunk/src/main/webapp/uploadSuccess.jsp
Modified:
trunk/src/main/java/org/nuiton/scmwebeditor/actions/UploadAction.java
trunk/src/main/resources/struts.xml
trunk/src/main/webapp/WEB-INF/web.xml
Modified: trunk/src/main/java/org/nuiton/scmwebeditor/actions/UploadAction.java
===================================================================
--- trunk/src/main/java/org/nuiton/scmwebeditor/actions/UploadAction.java 2011-07-08 10:23:16 UTC (rev 170)
+++ trunk/src/main/java/org/nuiton/scmwebeditor/actions/UploadAction.java 2011-07-12 12:40:41 UTC (rev 171)
@@ -88,6 +88,9 @@
public String execute() {
+ if(upload==null) {
+ return "redirect";
+ }
badLogin=false;
error=false;
@@ -161,7 +164,7 @@
} catch (IOException e) {
error=true;
log.error("Can't copy the file to the checkout directory",e);
- return "error";
+ return ERROR;
}
@@ -218,7 +221,7 @@
error=true;
//Suppression du repertoire temporaire
delTempDirectory(svnSess);
- return Action.ERROR;
+ return ERROR;
}
@@ -229,7 +232,7 @@
log.info("File upload successful");
}
- return Action.SUCCESS;
+ return SUCCESS;
}
Modified: trunk/src/main/resources/struts.xml
===================================================================
--- trunk/src/main/resources/struts.xml 2011-07-08 10:23:16 UTC (rev 170)
+++ trunk/src/main/resources/struts.xml 2011-07-12 12:40:41 UTC (rev 171)
@@ -9,51 +9,52 @@
</result-types>
<action name="checkout" class="org.nuiton.scmwebeditor.actions.ScmWebEditorMainAction" method="execute">
- <result name="noParameter" >/OutConnection.jsp</result>
- <result name="login" >/PrivateSvnRedirect.jsp</result>
- <result name="errorPath" >/BadFileRedirect.jsp</result>
- <result name="editPage" >/ModificationViewer.jsp</result>
+ <result name="noParameter" >/WEB-INF/content/outConnection.jsp</result>
+ <result name="login" >/WEB-INF/content/privateSvnRedirect.jsp</result>
+ <result name="errorPath" >/WEB-INF/content/badFileRedirect.jsp</result>
+ <result name="editPage" >/WEB-INF/content/modificationViewer.jsp</result>
</action>
<action name="commit" class="org.nuiton.scmwebeditor.actions.ScmWebEditorCommitAction" method="execute">
- <result name="success" >/Redirect.jsp</result>
- <result name="login" >/ModificationViewer.jsp</result>
- <result name="error">/BadFileRedirect.jsp</result>
- <result name="errorPath">/BadFileRedirect.jsp</result>
+ <result name="success" >/WEB-INF/content/redirect.jsp</result>
+ <result name="login" >/WEB-INF/content/modificationViewer.jsp</result>
+ <result name="error">/WEB-INF/content/badFileRedirect.jsp</result>
+ <result name="errorPath">/WEB-INF/content/badFileRedirect.jsp</result>
</action>
<action name="save" class="org.nuiton.scmwebeditor.actions.SaveAction" method="save">
- <result>/Save.jsp</result>
+ <result>/WEB-INF/content/save.jsp</result>
</action>
<action name="reset" class="org.nuiton.scmwebeditor.actions.ResetAction" >
- <result>/reset.jsp</result>
+ <result>/WEB-INF/content/reset.jsp</result>
</action>
<action name="doUpload" class="org.nuiton.scmwebeditor.actions.UploadAction" >
- <result>/uploadSuccess.jsp</result>
- <result name="login" >/uploadForm.jsp</result>
- <result name="error" >/uploadForm.jsp</result>
+ <result>/WEB-INF/content/uploadSuccess.jsp</result>
+ <result name="redirect" >/WEB-INF/content/uploadForm.jsp</result>
+ <result name="login" >/WEB-INF/content/uploadForm.jsp</result>
+ <result name="error" >/WEB-INF/content/uploadForm.jsp</result>
</action>
<action name="uploadFile" class="org.nuiton.scmwebeditor.actions.UploadAction" >
- <result>/upload.jsp</result>
- <result name="login" >/upload.jsp</result>
- <result name="error" >/upload.jsp</result>
+ <result>/WEB-INF/content/upload.jsp</result>
+ <result name="login" >/WEB-INF/content/upload.jsp</result>
+ <result name="error" >/WEB-INF/content/upload.jsp</result>
</action>
<action name="preview" class="org.nuiton.scmwebeditor.actions.PreviewAction" >
- <result>/Preview.jsp</result>
+ <result>/WEB-INF/content/preview.jsp</result>
</action>
<action name="search" class="org.nuiton.scmwebeditor.actions.SearchAction" method="search">
<param name="address"/>
- <result name="root" >Search.jsp</result>
+ <result name="root" >/WEB-INF/content/search.jsp</result>
<result name="success" type="json">
<param name="root">nodes</param>
</result>
- <result name="authError" >/LoginSearch.jsp</result>
+ <result name="authError" >/WEB-INF/content/loginSearch.jsp</result>
</action>
</package>
Deleted: trunk/src/main/webapp/BadFileRedirect.jsp
===================================================================
--- trunk/src/main/webapp/BadFileRedirect.jsp 2011-07-08 10:23:16 UTC (rev 170)
+++ trunk/src/main/webapp/BadFileRedirect.jsp 2011-07-12 12:40:41 UTC (rev 171)
@@ -1,23 +0,0 @@
-<%-- Document : BadFileRedirect Created on : 6 oct. 2009, 15:33:56
-Author : glorieux --%> <%@page contentType="text/html"
-pageEncoding="UTF-8"%>
-<!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>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("projectUrl")%>">
-</head>
-<body>
-<a target="_blank" href="http://maven-site.nuiton.org/scmwebeditor/"><img src="img/ScmWebEditor_main.png" alt="$alt" /></a>
-<p>Bad SCM path or file name! Please correct it.</p>
-<p>You should be transferred automatically to the form page. If not
-please <a href="<%=request.getAttribute("projectUrl")%>">click
-this link</a>.</p>
-<p>©2004-2009 CodeLutin</p>
-</body>
-</html>
Deleted: trunk/src/main/webapp/BadUseRedirect.jsp
===================================================================
--- trunk/src/main/webapp/BadUseRedirect.jsp 2011-07-08 10:23:16 UTC (rev 170)
+++ trunk/src/main/webapp/BadUseRedirect.jsp 2011-07-12 12:40:41 UTC (rev 171)
@@ -1,24 +0,0 @@
-<%-- Document : BadFileRedirect Created on : 6 oct. 2009, 15:33:56
-Author : glorieux --%> <%@page contentType="text/html"
-pageEncoding="UTF-8"%>
-<!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>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")%>">
-</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>
-<p>©2004-2009 CodeLutin</p>
-</body>
-</html>
Deleted: trunk/src/main/webapp/Error.jsp
===================================================================
--- trunk/src/main/webapp/Error.jsp 2011-07-08 10:23:16 UTC (rev 170)
+++ trunk/src/main/webapp/Error.jsp 2011-07-12 12:40:41 UTC (rev 171)
@@ -1,22 +0,0 @@
-<%-- Document : Error Created on : 15 sept. 2009, 12:22:29 Author :
-glorieux --%> <%@page contentType="text/html" pageEncoding="UTF-8"%>
-<!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>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")%>">
-<%--%=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>
-<a target="_blank" href="http://maven-site.nuiton.org/scmwebeditor/"><img src="img/ScmWebEditor_main.png" alt="$alt" /></a>
-<p>Bad Login or Password. Please Wait.</p>
-<p>©2004-2009 CodeLutin</p>
-</body>
-</html>
Deleted: trunk/src/main/webapp/GereSession.js
===================================================================
--- trunk/src/main/webapp/GereSession.js 2011-07-08 10:23:16 UTC (rev 170)
+++ trunk/src/main/webapp/GereSession.js 2011-07-12 12:40:41 UTC (rev 171)
@@ -1,41 +0,0 @@
-/**
- * @author geoffroy lorieux
- */
-
-function rappelSession(minutes)
-{
- var msg='Your session expire on '+minutes+' minute';
- if(minutes>1)
- {
- msg+='s';
- }
- msg+='.\nDo you want to reload this page ?(You will not lose your data)';
-
- if(confirm(msg))
- {
- location.reload();
- }
-}
-
-/**
- * affiche une alerte sur l'expiration de la session et redirige vers une autre page
- */
-function expirationSession()
-{
- alert("Your session has expire. Please relogin");
- window.history.back(-1);
-}
-
-/**
- * affiche des avertissements sur le délai d'expiration de la session :
- * - un premier au bout de (expiration-rappel) minutes (par ex. : 20-3 = 17 minutes)
- * - un second au bout de (expiration) minutes (par ex. : 20 minutes)
- */
-function geresession(expiration, rappel)
-{
- // affichage du rappel
- var chronoRappel=setTimeout('rappelSession('+rappel+')', (expiration-rappel)*60*1000);
-
- // une fois le rappel affiché, on avertit uniquement de l'expiration
- var chronoExpiration=setTimeout('expirationSession()', (expiration)*60*1000);
-}
Deleted: trunk/src/main/webapp/LoginSearch.jsp
===================================================================
--- trunk/src/main/webapp/LoginSearch.jsp 2011-07-08 10:23:16 UTC (rev 170)
+++ trunk/src/main/webapp/LoginSearch.jsp 2011-07-12 12:40:41 UTC (rev 171)
@@ -1,28 +0,0 @@
-<%@ page language="java" contentType="text/html; charset=UTF-8"
- pageEncoding="UTF-8"%>
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <%@ taglib prefix="s" uri="/struts-tags"%>
- <%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
- <sj:head jquerytheme="default"/>
-
-<div id="search">
- <p>You must be login to see this repository.</p>
- <p>
- <label>Username : <input type="text" name="username"></input></label><br/>
- <label>Password : <input type ="password" name="pw"></input></label><br/>
-
- <s:url id="ajaxSearchLogin" value="search.action" />
-
- <sj:submit
- id="ajaxSearchButtonLogin"
- formIds="configForm"
- targets="htmlcontentSearch"
- href="%{ajaxSearchLogin}"
- indicator="indicator"
- button="true"
- buttonIcon="ui-icon-refresh"
- value="Login"
- >
- </sj:submit>
- </p>
-</div>
\ No newline at end of file
Deleted: trunk/src/main/webapp/ModificationViewer.jsp
===================================================================
--- trunk/src/main/webapp/ModificationViewer.jsp 2011-07-08 10:23:16 UTC (rev 170)
+++ trunk/src/main/webapp/ModificationViewer.jsp 2011-07-12 12:40:41 UTC (rev 171)
@@ -1,247 +0,0 @@
- <%-- Document : ModificationViewer Created on : 10 sept. 2009, 13:43:11 Author : glorieux --%>
- <%@page import="org.apache.commons.lang.StringEscapeUtils"%>
- <%@page contentType="text/html" pageEncoding="UTF-8"%>
- <%@ taglib prefix="s" uri="/struts-tags"%>
- <%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
- <sj:head jquerytheme="default"/>
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
- <title>SCMWebEditor</title>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
- <script src="selectLanguage.js"></script>
-
-
- <!-- Code mirror -->
- <!-- First the CodeMirror stuff -->
- <script src="codemirror-ui/lib/CodeMirror-2.1/lib/codemirror.js" type="text/javascript"></script>
- <link rel="stylesheet" href="codemirror-ui/lib/CodeMirror-2.1/lib/codemirror.css">
-
- <script src="codemirror-ui/lib/CodeMirror-2.1/mode/rst/rst.js"></script>
- <link rel="stylesheet" href="codemirror-ui/lib/CodeMirror-2.1/mode/rst/rst.css">
-
- <script src="codemirror-ui/lib/CodeMirror-2.1/mode/clike/clike.js"></script>
- <link rel="stylesheet" href="codemirror-ui/lib/CodeMirror-2.1/mode/clike/clike.css">
-
- <link rel="stylesheet" href="codemirror-ui/lib/CodeMirror-2.1/theme/default.css">
-
- <script src="codemirror-ui/lib/CodeMirror-2.1/mode/htmlmixed/htmlmixed.js"></script>
- <script src="codemirror-ui/lib/CodeMirror-2.1/mode/javascript/javascript.js"></script>
- <script src="codemirror-ui/lib/CodeMirror-2.1/mode/css/css.js"></script>
- <script src="codemirror-ui/lib/CodeMirror-2.1/mode/xml/xml.js"></script>
-
-
- <!-- 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" />
-
-
-
- <link rel="icon" href="img/ScmWebEditor_little.png" type="image/png">
- <link rel="stylesheet" type="text/css" href="css/main.css">
-
-
-
-</head>
-<body onload="geresession(<%=request.getAttribute("InvalidateMaxTime")%>, 5);">
- <a title="ScmWebEditor Project Website" target="_blank" href="http://maven-site.nuiton.org/scmwebeditor/"><img src="img/ScmWebEditor_main.png" alt="ScmWebEditor logo"/></a>
-
- <center>
- <h2>Welcome on SCMWebEditor</h2>
- <%
- String typeEditor="null";
- if (request.getAttribute("format")!=null && request.getAttribute("format").equals("rst")){
- %>
- <h4>For any Problem with RestruturedText visit <a href="http://docutils.sourceforge.net/rst.html">RST documentation website</a>.</h4>
- <% } %>
- </center>
-
-
- <form method="post" action=commit.action id="editForm">
-
-
-
- <%
- String valueTextarea;
- if(request.getAttribute("lastText")!=null) {
- valueTextarea = (String) request.getAttribute("lastText");
- } else {
- valueTextarea = (String) request.getAttribute("OrigText");
- }
-
-
- %>
-
- <p>File in editor : <a href="<%=request.getAttribute("address")%>" ><%=request.getAttribute("address")%></a> </p>
- <textarea id="newTextId" rows="50" cols="80" name="newText"><%=valueTextarea%></textarea>
-
-
-
- <script type="text/javascript">
- var textarea = document.getElementById('newTextId');
- var uiOptions = { path : 'codemirror-ui/js/', searchMode : 'inline' }
- var codeMirrorOptions = { mode: "null" }
- var editor = new CodeMirrorUI(textarea,uiOptions,codeMirrorOptions);
- </script>
-
-
- <label>Language :
- <select id="language" name="langageSelection" onchange="changeModeBy(editor,this)">
- <option value="null">Text</option>
- <option value="rst">ReStructuredText</option>
- <option value="javascript">Javascript</option>
- <option value="text/html">HTML</option>
- <option value="xml">XML</option>
- <option value="text/x-java">JAVA</option>
- </select>
- </label>
-
-
-
- <script type='text/javascript'>
- selectLanguage('<%=((String) request.getAttribute("minetype"))%>','<%=request.getAttribute("format")%>' );
- changeModeBy(editor, document.getElementById('language'));
- </script>
-
-
- <script type="text/javascript">
- function loadChange(){
- document.getElementById('newTextId').value = editor.mirror.getValue();
- }
- </script>
-
-
-
- <script src="GereSession.js" type="text/javascript"></script>
- <script src="cancelRedirect.js" type="text/javascript"></script>
- <script src="pictureUpload.js" type="text/javascript"></script>
- <noscript><h4>Javascript is not activated. You can't only use Save and Quit or Reset button.</h4></noscript>
- <noscript><h4>For a better use of SCMWebEditor please activate JavaScript.</h4></noscript>
-
- <div id="form">
-
- <div id="htmlcontentCommit"></div>
-
- <label>Commit Message: <input type="text" name="commitMessage" title="Let a commit message with this file."/></label>
-
- <%if (request.getAttribute("IsLogin").equals(false) == true){
- %>
- <%if (request.getAttribute("badLogin")!=null && request.getAttribute("badLogin").equals(true)) { %>
- <p>
- <font color="red">
- Bad username or password
- </font>
- </p>
- <% } %>
- <p>
-
- <label ACCESSKEY=U>User name: <input TYPE=text NAME=username SIZE=12 title="Commit Username."/></label>
- <label ACCESSKEY=P>Password: <input TYPE=password NAME=pw SIZE=12 title="Commit Password."/></label> </p><%
- } else {
- %><p>You are log as: <%=request.getAttribute("Login")%></p>
- <input type="hidden" NAME=username />
- <input type="hidden" NAME=pw /><%
- }%>
- <input type="hidden" name="address" value="<%=request.getAttribute("address")%>"/>
- <input type="hidden" name="origText" value="<%=request.getAttribute("OrigText")%>"/>
- <% if(request.getAttribute("lastText")!=null) { %>
- <input type="hidden" name="lastText" value="<%=request.getAttribute("lastText")%>" />
- <% } %>
- <input type="hidden" name="scmEditorUrl" value="<%=request.getAttribute("scmEditorUrl")%>"/>
-
- <s:url id="ajaxCommit" value="save.action" />
-
- <sj:submit onclick="loadChange()"
- id="ajaxSaveButton"
- formIds="editForm"
- targets="htmlcontentCommit"
- href="%{ajaxCommit}"
- indicator="indicator"
- button="true"
- buttonIcon="ui-icon-refresh"
- value="Save and Continue Editing"
- title="Commit modifications and continue editing the file"
- >
- </sj:submit>
-
- <input title="Save this file and go back to previous page." type="submit" value="Save and Quit" name="Save"/>
-
- <%if (request.getAttribute("format")!=null && request.getAttribute("format")!=null && request.getAttribute("format").equals("rst") == true){
- %>
- <s:url id="ajaxPreview" value="preview.action" />
-
- <sj:submit onclick="loadChange()"
- id="ajaxPreviewButton"
- formIds="editForm"
- targets="htmlcontentPreview"
- href="%{ajaxPreview}"
- button="true"
- buttonIcon="ui-icon-refresh"
- value="Preview"
- >
- </sj:submit>
-
- <%}%>
-
- <sj:submit
- title="Go back to the last revision of the file"
- id="resetButton"
- targets="resetResult"
- value="Reset"
- button="true"
- href="reset.action"
- />
- <div id="resetResult"></div>
-
- <!-- <input title="Reset text as current repository HEAD revision." type="reset" value="Reset" name="Reset" /> -->
- <input type="hidden" value="<%=request.getAttribute("ProjectUrl")%>" name="ProjectUrl">
- <input title="Exit ScmWebEditor without saving." type="button" value="Exit" name="Cancel" onclick="javascript:cancelRedirect(this.form.ProjectUrl);"/>
-
-
- <br/>
-
- </div>
- </form>
- <center>
- <button title="Upload a file on the repository" onClick="javascript:upload_popup('uploadForm.jsp','upload');" >Upload</button>
- </center>
-
- <div>
-
-
- </div>
-
-
- <!--
- <div id="uploadFormId" >
- <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>username : <input type="text" name="username" /></label><br/>
- <label>password : <input type="password" name="pw" /></label><br/>
-
- <sj:submit
- id="ajaxUploadButton"
- targets="targetContentUpload"
- button="true"
- value="upload"
- >
- </sj:submit>
-
- </s:form>
- </div>
- -->
-
- <div id="targetContentUpload"></div>
-
-
- <div id="htmlcontentPreview"></div>
-
-
- <p align="right">©2004-2009 CodeLutin</p>
-</body>
-</html>
Deleted: trunk/src/main/webapp/OutConnection.jsp
===================================================================
--- trunk/src/main/webapp/OutConnection.jsp 2011-07-08 10:23:16 UTC (rev 170)
+++ trunk/src/main/webapp/OutConnection.jsp 2011-07-12 12:40:41 UTC (rev 171)
@@ -1,67 +0,0 @@
-<%-- Document : OutConnection Created on : 6 oct. 2009, 12:07:27 Author: glorieux --%>
-<%@page contentType="text/html" pageEncoding="UTF-8"%>
- <%@ taglib prefix="s" uri="/struts-tags"%>
- <%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
- <%@ taglib prefix="sjt" uri="/struts-jquery-tree-tags" %>
- <sj:head jquerytheme="default"/>
-
-<!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">
-<link rel="icon" href="img/ScmWebEditor_little.png" type="image/png">
-<link rel="stylesheet" type="text/css" href="css/main.css">
-<title>SCM Web Editor</title>
-</head>
-<body>
-<a target="_blank" href="http://maven-site.nuiton.org/scmwebeditor/"><img src="img/ScmWebEditor_main.png" alt="$alt" /></a>
-<center>
-<h2>Welcome on SCMWebEditor</h2>
-<noscript><h4>Javascript is not activated. Please activate it for a fully use of ScmWebEditor.</h4></noscript>
-<h4>
-Please complete this form for application using.
-</h4>
-</center>
-
-<form id="configForm" method="get" action="checkout.action">
-<center>
- <p><label>SCM path: <input TYPE=text name="address" SIZE=100></label>
-
- <s:url id="ajaxSearch" value="search.action" />
-
- <sj:submit
- id="ajaxSearchButton"
- formIds="configForm"
- targets="htmlcontentSearch"
- href="%{ajaxSearch}"
- indicator="indicator"
- button="true"
- buttonIcon="ui-icon-refresh"
- value="Search"
- >
- </sj:submit>
-
- <input type="submit" name="Save" />
- </p>
-</center>
-<div id="htmlcontentSearch" ></div>
-</form>
-
-<!--
- <div id="searchTree">
-
- <s:url id="searchTreeUrl" action="search?address=http://localhost/scmsvn"/>
-
- <sjt:tree id="svnTree"
- jstreetheme="classic"
- href="%{searchTreeUrl}"
- onClickTopics="treeClicked"/>
-
- </div>
- -->
-
-<p align="right">©2004-2009 CodeLutin</p>
-</body>
-</html>
Deleted: trunk/src/main/webapp/Preview.jsp
===================================================================
--- trunk/src/main/webapp/Preview.jsp 2011-07-08 10:23:16 UTC (rev 170)
+++ trunk/src/main/webapp/Preview.jsp 2011-07-12 12:40:41 UTC (rev 171)
@@ -1,10 +0,0 @@
- <%@ taglib prefix="s" uri="/struts-tags"%>
- <%@page contentType="text/html" pageEncoding="UTF-8"%>
- <%--Title and div for rst preview--%>
- <h3 id="prevtitle" >Preview :</h3>
-
- <div id="prev" title="Preview">
- <div id="preview" >
- <s:property value="XMLResponse" escapeHtml="false"/>
- </div>
- </div>
Deleted: trunk/src/main/webapp/PrivateSvnRedirect.jsp
===================================================================
--- trunk/src/main/webapp/PrivateSvnRedirect.jsp 2011-07-08 10:23:16 UTC (rev 170)
+++ trunk/src/main/webapp/PrivateSvnRedirect.jsp 2011-07-12 12:40:41 UTC (rev 171)
@@ -1,29 +0,0 @@
-<%-- Document : PrivateSvnRedirect Created on : 30 sept. 2009, 14:05:43
-Author : glorieux --%> <%@page contentType="text/html"
-pageEncoding="UTF-8"%>
-<!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>Private Scm</title>
-<link rel="icon" href="img/ScmWebEditor_little.png" type="image/png">
-<link rel="stylesheet" type="text/css" href="css/main.css">
-</head>
-<body>
-<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")%>"/>
-<script src="cancelRedirect.js"></script>
-<p>You try to access a Private SCM. Please login</p>
-<p><label ACCESSKEY=U>User name: <input TYPE=text
- NAME=username SIZE=12></label> <label ACCESSKEY=P>Password: <input
- TYPE=password NAME=pw SIZE=12></label></p>
-<input type="submit" value="Submit" name="Save" /> <input type="button"
- value="Exit" name="Cancel"
- onclick="cancelRedirect(this.form.projectUrl);" /></form>
-<p>©2004-2009 CodeLutin</p>
-</body>
-</html>
\ No newline at end of file
Deleted: trunk/src/main/webapp/Recall.jsp
===================================================================
--- trunk/src/main/webapp/Recall.jsp 2011-07-08 10:23:16 UTC (rev 170)
+++ trunk/src/main/webapp/Recall.jsp 2011-07-12 12:40:41 UTC (rev 171)
@@ -1,13 +0,0 @@
-<%-- Document : Recall Created on : 30 sept. 2009, 17:05:40 Author :
-glorieux --%> <%@page contentType="text/html" pageEncoding="UTF-8"%>
-<!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>Redirect...</title>
-<meta http-equiv="Refresh" content="0; url=
-<%=request.getAttribute("Redirect_url")%>">
-</head>
-</html>
Deleted: trunk/src/main/webapp/Redirect.jsp
===================================================================
--- trunk/src/main/webapp/Redirect.jsp 2011-07-08 10:23:16 UTC (rev 170)
+++ trunk/src/main/webapp/Redirect.jsp 2011-07-12 12:40:41 UTC (rev 171)
@@ -1,23 +0,0 @@
-<%-- Document : Redirect Created on : 10 sept. 2009, 13:43:11 Author :
-glorieux --%> <%@page contentType="text/html" pageEncoding="UTF-8"%>
-<!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>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")%>">
-</head>
-<body>
-<a target="_blank" href="http://maven-site.nuiton.org/scmwebeditor/"><img src="img/ScmWebEditor_main.png" alt="$alt" /></a>
-<p>Thank you using RSTEditor</p>
-<p>You should be transferred automatically to the new page. If not
-please <a href="<%=request.getAttribute("Redirection_url")%>">click
-this link</a>.</p>
-<p>©2004-2009 CodeLutin</p>
-</body>
-</html>
Deleted: trunk/src/main/webapp/Save.jsp
===================================================================
--- trunk/src/main/webapp/Save.jsp 2011-07-08 10:23:16 UTC (rev 170)
+++ trunk/src/main/webapp/Save.jsp 2011-07-12 12:40:41 UTC (rev 171)
@@ -1,17 +0,0 @@
- <%@ taglib prefix="s" uri="/struts-tags"%>
- <%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
-
-
-
- <s:if test="result=='authError'" >
- <h4> <font color="red"> Bad username or password, can't save modification</font> </h4>
- </s:if>
- <s:elseif test="result=='error'" >
- <h4> Can't save modification </h4>
- </s:elseif>
- <s:elseif test="result=='uselessSave'" >
- <h4> It's useless to save the file, file is not modify</h4>
- </s:elseif>
- <s:else>
- <h4>Last change save <s:property value="formatDate" /> </h4>
- </s:else>
\ No newline at end of file
Deleted: trunk/src/main/webapp/Search.jsp
===================================================================
--- trunk/src/main/webapp/Search.jsp 2011-07-08 10:23:16 UTC (rev 170)
+++ trunk/src/main/webapp/Search.jsp 2011-07-12 12:40:41 UTC (rev 171)
@@ -1,49 +0,0 @@
-<%@ 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="sj" uri="/struts-jquery-tags"%>
- <%@ taglib prefix="sjt" uri="/struts-jquery-tree-tags" %>
-
- <sj:head debug="true" jquerytheme="default"/>
-
-<script>
-$.subscribe('treeClicked', function(event, data) {
- var item = event.originalEvent.data.rslt.obj;
-
- if(item.text().indexOf("/") == -1) {
- document.location.href=("checkout.action?address="+item.attr("id"));
- }
-
-});
-
-</script>
-
- <div id="searchTree">
- <s:set name="address">
- <s:property value="address"/>
- </s:set>
- <s:set name="username">
- <s:property value="username"/>
- </s:set>
- <s:set name="pw">
- <s:property value="pw"/>
- </s:set>
-
-
- <s:url id="searchTreeUrl" action="search?address=%{address}&username=%{username}&pw=%{pw}" />
- <sjt:tree id="svnTree"
- htmlTitles="true"
- jstreetheme="classic"
- href="%{searchTreeUrl}"
- onClickTopics="treeClicked"
- />
-
- </div>
-
- <s:label name="error"></s:label>
-
Added: trunk/src/main/webapp/WEB-INF/content/accueil.jsp
===================================================================
--- trunk/src/main/webapp/WEB-INF/content/accueil.jsp (rev 0)
+++ trunk/src/main/webapp/WEB-INF/content/accueil.jsp 2011-07-12 12:40:41 UTC (rev 171)
@@ -0,0 +1,3 @@
+<%@ page contentType="text/html; charset=UTF-8" %>
+
+ <p>Parametres detectés</p>
Added: trunk/src/main/webapp/WEB-INF/content/badFileRedirect.jsp
===================================================================
--- trunk/src/main/webapp/WEB-INF/content/badFileRedirect.jsp (rev 0)
+++ trunk/src/main/webapp/WEB-INF/content/badFileRedirect.jsp 2011-07-12 12:40:41 UTC (rev 171)
@@ -0,0 +1,23 @@
+<%-- Document : BadFileRedirect Created on : 6 oct. 2009, 15:33:56
+Author : glorieux --%> <%@page contentType="text/html"
+pageEncoding="UTF-8"%>
+<!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>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("projectUrl")%>">
+</head>
+<body>
+<a target="_blank" href="http://maven-site.nuiton.org/scmwebeditor/"><img src="img/ScmWebEditor_main.png" alt="$alt" /></a>
+<p>Bad SCM path or file name! Please correct it.</p>
+<p>You should be transferred automatically to the form page. If not
+please <a href="<%=request.getAttribute("projectUrl")%>">click
+this link</a>.</p>
+<p>©2004-2009 CodeLutin</p>
+</body>
+</html>
Added: trunk/src/main/webapp/WEB-INF/content/badUseRedirect.jsp
===================================================================
--- trunk/src/main/webapp/WEB-INF/content/badUseRedirect.jsp (rev 0)
+++ trunk/src/main/webapp/WEB-INF/content/badUseRedirect.jsp 2011-07-12 12:40:41 UTC (rev 171)
@@ -0,0 +1,24 @@
+<%-- Document : BadFileRedirect Created on : 6 oct. 2009, 15:33:56
+Author : glorieux --%> <%@page contentType="text/html"
+pageEncoding="UTF-8"%>
+<!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>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")%>">
+</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>
+<p>©2004-2009 CodeLutin</p>
+</body>
+</html>
Added: trunk/src/main/webapp/WEB-INF/content/error.jsp
===================================================================
--- trunk/src/main/webapp/WEB-INF/content/error.jsp (rev 0)
+++ trunk/src/main/webapp/WEB-INF/content/error.jsp 2011-07-12 12:40:41 UTC (rev 171)
@@ -0,0 +1,22 @@
+<%-- Document : Error Created on : 15 sept. 2009, 12:22:29 Author :
+glorieux --%> <%@page contentType="text/html" pageEncoding="UTF-8"%>
+<!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>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")%>">
+<%--%=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>
+<a target="_blank" href="http://maven-site.nuiton.org/scmwebeditor/"><img src="img/ScmWebEditor_main.png" alt="$alt" /></a>
+<p>Bad Login or Password. Please Wait.</p>
+<p>©2004-2009 CodeLutin</p>
+</body>
+</html>
Added: trunk/src/main/webapp/WEB-INF/content/index.jsp
===================================================================
--- trunk/src/main/webapp/WEB-INF/content/index.jsp (rev 0)
+++ trunk/src/main/webapp/WEB-INF/content/index.jsp 2011-07-12 12:40:41 UTC (rev 171)
@@ -0,0 +1,3 @@
+<%
+response.sendRedirect("checkout.action");
+%>
\ No newline at end of file
Added: trunk/src/main/webapp/WEB-INF/content/loginSearch.jsp
===================================================================
--- trunk/src/main/webapp/WEB-INF/content/loginSearch.jsp (rev 0)
+++ trunk/src/main/webapp/WEB-INF/content/loginSearch.jsp 2011-07-12 12:40:41 UTC (rev 171)
@@ -0,0 +1,28 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+ pageEncoding="UTF-8"%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+ <%@ taglib prefix="s" uri="/struts-tags"%>
+ <%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
+ <sj:head jquerytheme="default"/>
+
+<div id="search">
+ <p>You must be login to see this repository.</p>
+ <p>
+ <label>Username : <input type="text" name="username"></input></label><br/>
+ <label>Password : <input type ="password" name="pw"></input></label><br/>
+
+ <s:url id="ajaxSearchLogin" value="search.action" />
+
+ <sj:submit
+ id="ajaxSearchButtonLogin"
+ formIds="configForm"
+ targets="htmlcontentSearch"
+ href="%{ajaxSearchLogin}"
+ indicator="indicator"
+ button="true"
+ buttonIcon="ui-icon-refresh"
+ value="Login"
+ >
+ </sj:submit>
+ </p>
+</div>
\ No newline at end of file
Added: trunk/src/main/webapp/WEB-INF/content/modificationViewer.jsp
===================================================================
--- trunk/src/main/webapp/WEB-INF/content/modificationViewer.jsp (rev 0)
+++ trunk/src/main/webapp/WEB-INF/content/modificationViewer.jsp 2011-07-12 12:40:41 UTC (rev 171)
@@ -0,0 +1,247 @@
+ <%-- Document : ModificationViewer Created on : 10 sept. 2009, 13:43:11 Author : glorieux --%>
+ <%@page import="org.apache.commons.lang.StringEscapeUtils"%>
+ <%@page contentType="text/html" pageEncoding="UTF-8"%>
+ <%@ taglib prefix="s" uri="/struts-tags"%>
+ <%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
+ <sj:head jquerytheme="default"/>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title>SCMWebEditor</title>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ <script type="text/javascript" src="js/selectLanguage.js"></script>
+
+
+ <!-- Code mirror -->
+ <!-- First the CodeMirror stuff -->
+ <script src="codemirror-ui/lib/CodeMirror-2.1/lib/codemirror.js" type="text/javascript"></script>
+ <link rel="stylesheet" href="codemirror-ui/lib/CodeMirror-2.1/lib/codemirror.css">
+
+ <script src="codemirror-ui/lib/CodeMirror-2.1/mode/rst/rst.js"></script>
+ <link rel="stylesheet" href="codemirror-ui/lib/CodeMirror-2.1/mode/rst/rst.css">
+
+ <script src="codemirror-ui/lib/CodeMirror-2.1/mode/clike/clike.js"></script>
+ <link rel="stylesheet" href="codemirror-ui/lib/CodeMirror-2.1/mode/clike/clike.css">
+
+ <link rel="stylesheet" href="codemirror-ui/lib/CodeMirror-2.1/theme/default.css">
+
+ <script src="codemirror-ui/lib/CodeMirror-2.1/mode/htmlmixed/htmlmixed.js"></script>
+ <script src="codemirror-ui/lib/CodeMirror-2.1/mode/javascript/javascript.js"></script>
+ <script src="codemirror-ui/lib/CodeMirror-2.1/mode/css/css.js"></script>
+ <script src="codemirror-ui/lib/CodeMirror-2.1/mode/xml/xml.js"></script>
+
+
+ <!-- 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" />
+
+
+
+ <link rel="icon" href="img/ScmWebEditor_little.png" type="image/png">
+ <link rel="stylesheet" type="text/css" href="css/main.css">
+
+
+
+</head>
+<body onload="geresession(<%=request.getAttribute("InvalidateMaxTime")%>, 5);">
+ <a title="ScmWebEditor Project Website" target="_blank" href="http://maven-site.nuiton.org/scmwebeditor/"><img src="img/ScmWebEditor_main.png" alt="ScmWebEditor logo"/></a>
+
+ <center>
+ <h2>Welcome on SCMWebEditor</h2>
+ <%
+ String typeEditor="null";
+ if (request.getAttribute("format")!=null && request.getAttribute("format").equals("rst")){
+ %>
+ <h4>For any Problem with RestruturedText visit <a href="http://docutils.sourceforge.net/rst.html">RST documentation website</a>.</h4>
+ <% } %>
+ </center>
+
+
+ <form method="post" action=commit.action id="editForm">
+
+
+
+ <%
+ String valueTextarea;
+ if(request.getAttribute("lastText")!=null) {
+ valueTextarea = (String) request.getAttribute("lastText");
+ } else {
+ valueTextarea = (String) request.getAttribute("OrigText");
+ }
+
+
+ %>
+
+ <p>File in editor : <a href="<%=request.getAttribute("address")%>" ><%=request.getAttribute("address")%></a> </p>
+ <textarea id="newTextId" rows="50" cols="80" name="newText"><%=valueTextarea%></textarea>
+
+
+
+ <script type="text/javascript">
+ var textarea = document.getElementById('newTextId');
+ var uiOptions = { path : 'codemirror-ui/js/', searchMode : 'inline' }
+ var codeMirrorOptions = { mode: "null" }
+ var editor = new CodeMirrorUI(textarea,uiOptions,codeMirrorOptions);
+ </script>
+
+
+ <label>Language :
+ <select id="language" name="langageSelection" onchange="changeModeBy(editor,this)">
+ <option value="null">Text</option>
+ <option value="rst">ReStructuredText</option>
+ <option value="javascript">Javascript</option>
+ <option value="text/html">HTML</option>
+ <option value="xml">XML</option>
+ <option value="text/x-java">JAVA</option>
+ </select>
+ </label>
+
+
+
+ <script type='text/javascript'>
+ selectLanguage('<%=((String) request.getAttribute("minetype"))%>','<%=request.getAttribute("format")%>' );
+ changeModeBy(editor, document.getElementById('language'));
+ </script>
+
+
+ <script type="text/javascript">
+ function loadChange(){
+ document.getElementById('newTextId').value = editor.mirror.getValue();
+ }
+ </script>
+
+
+
+ <script src="js/gereSession.js" type="text/javascript"></script>
+ <script src="js/cancelRedirect.js" type="text/javascript"></script>
+ <script src="js/pictureUpload.js" type="text/javascript"></script>
+ <noscript><h4>Javascript is not activated. You can't only use Save and Quit or Reset button.</h4></noscript>
+ <noscript><h4>For a better use of SCMWebEditor please activate JavaScript.</h4></noscript>
+
+ <div id="form">
+
+ <div id="htmlcontentCommit"></div>
+
+ <label>Commit Message: <input type="text" name="commitMessage" title="Let a commit message with this file."/></label>
+
+ <%if (request.getAttribute("IsLogin").equals(false) == true){
+ %>
+ <%if (request.getAttribute("badLogin")!=null && request.getAttribute("badLogin").equals(true)) { %>
+ <p>
+ <font color="red">
+ Bad username or password
+ </font>
+ </p>
+ <% } %>
+ <p>
+
+ <label ACCESSKEY=U>User name: <input TYPE=text NAME=username SIZE=12 title="Commit Username."/></label>
+ <label ACCESSKEY=P>Password: <input TYPE=password NAME=pw SIZE=12 title="Commit Password."/></label> </p><%
+ } else {
+ %><p>You are log as: <%=request.getAttribute("Login")%></p>
+ <input type="hidden" NAME=username />
+ <input type="hidden" NAME=pw /><%
+ }%>
+ <input type="hidden" name="address" value="<%=request.getAttribute("address")%>"/>
+ <input type="hidden" name="origText" value="<%=request.getAttribute("OrigText")%>"/>
+ <% if(request.getAttribute("lastText")!=null) { %>
+ <input type="hidden" name="lastText" value="<%=request.getAttribute("lastText")%>" />
+ <% } %>
+ <input type="hidden" name="scmEditorUrl" value="<%=request.getAttribute("scmEditorUrl")%>"/>
+
+ <s:url id="ajaxCommit" value="save.action" />
+
+ <sj:submit onclick="loadChange()"
+ id="ajaxSaveButton"
+ formIds="editForm"
+ targets="htmlcontentCommit"
+ href="%{ajaxCommit}"
+ indicator="indicator"
+ button="true"
+ buttonIcon="ui-icon-refresh"
+ value="Save and Continue Editing"
+ title="Commit modifications and continue editing the file"
+ >
+ </sj:submit>
+
+ <input title="Save this file and go back to previous page." type="submit" value="Save and Quit" name="Save"/>
+
+ <%if (request.getAttribute("format")!=null && request.getAttribute("format")!=null && request.getAttribute("format").equals("rst") == true){
+ %>
+ <s:url id="ajaxPreview" value="preview.action" />
+
+ <sj:submit onclick="loadChange()"
+ id="ajaxPreviewButton"
+ formIds="editForm"
+ targets="htmlcontentPreview"
+ href="%{ajaxPreview}"
+ button="true"
+ buttonIcon="ui-icon-refresh"
+ value="Preview"
+ >
+ </sj:submit>
+
+ <%}%>
+
+ <sj:submit
+ title="Go back to the last revision of the file"
+ id="resetButton"
+ targets="resetResult"
+ value="Reset"
+ button="true"
+ href="reset.action"
+ />
+ <div id="resetResult"></div>
+
+ <!-- <input title="Reset text as current repository HEAD revision." type="reset" value="Reset" name="Reset" /> -->
+ <input type="hidden" value="<%=request.getAttribute("ProjectUrl")%>" name="ProjectUrl">
+ <input title="Exit ScmWebEditor without saving." type="button" value="Exit" name="Cancel" onclick="javascript:cancelRedirect(this.form.ProjectUrl);"/>
+
+
+ <br/>
+
+ </div>
+ </form>
+ <center>
+ <button title="Upload a file on the repository" onClick="javascript:upload_popup('doUpload.action','upload');" >Upload</button>
+ </center>
+
+ <div>
+
+
+ </div>
+
+
+ <!--
+ <div id="uploadFormId" >
+ <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>username : <input type="text" name="username" /></label><br/>
+ <label>password : <input type="password" name="pw" /></label><br/>
+
+ <sj:submit
+ id="ajaxUploadButton"
+ targets="targetContentUpload"
+ button="true"
+ value="upload"
+ >
+ </sj:submit>
+
+ </s:form>
+ </div>
+ -->
+
+ <div id="targetContentUpload"></div>
+
+
+ <div id="htmlcontentPreview"></div>
+
+
+ <p align="right">©2004-2009 CodeLutin</p>
+</body>
+</html>
Added: trunk/src/main/webapp/WEB-INF/content/outConnection.jsp
===================================================================
--- trunk/src/main/webapp/WEB-INF/content/outConnection.jsp (rev 0)
+++ trunk/src/main/webapp/WEB-INF/content/outConnection.jsp 2011-07-12 12:40:41 UTC (rev 171)
@@ -0,0 +1,67 @@
+<%-- Document : OutConnection Created on : 6 oct. 2009, 12:07:27 Author: glorieux --%>
+<%@page contentType="text/html" pageEncoding="UTF-8"%>
+ <%@ taglib prefix="s" uri="/struts-tags"%>
+ <%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
+ <%@ taglib prefix="sjt" uri="/struts-jquery-tree-tags" %>
+ <sj:head jquerytheme="default"/>
+
+<!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">
+<link rel="icon" href="img/ScmWebEditor_little.png" type="image/png">
+<link rel="stylesheet" type="text/css" href="css/main.css">
+<title>SCM Web Editor</title>
+</head>
+<body>
+<a target="_blank" href="http://maven-site.nuiton.org/scmwebeditor/"><img src="img/ScmWebEditor_main.png" alt="$alt" /></a>
+<center>
+<h2>Welcome on SCMWebEditor</h2>
+<noscript><h4>Javascript is not activated. Please activate it for a fully use of ScmWebEditor.</h4></noscript>
+<h4>
+Please complete this form for application using.
+</h4>
+</center>
+
+<form id="configForm" method="get" action="checkout.action">
+<center>
+ <p><label>SCM path: <input TYPE=text name="address" SIZE=100></label>
+
+ <s:url id="ajaxSearch" value="search.action" />
+
+ <sj:submit
+ id="ajaxSearchButton"
+ formIds="configForm"
+ targets="htmlcontentSearch"
+ href="%{ajaxSearch}"
+ indicator="indicator"
+ button="true"
+ buttonIcon="ui-icon-refresh"
+ value="Search"
+ >
+ </sj:submit>
+
+ <input type="submit" name="Save" />
+ </p>
+</center>
+<div id="htmlcontentSearch" ></div>
+</form>
+
+<!--
+ <div id="searchTree">
+
+ <s:url id="searchTreeUrl" action="search?address=http://localhost/scmsvn"/>
+
+ <sjt:tree id="svnTree"
+ jstreetheme="classic"
+ href="%{searchTreeUrl}"
+ onClickTopics="treeClicked"/>
+
+ </div>
+ -->
+
+<p align="right">©2004-2009 CodeLutin</p>
+</body>
+</html>
Added: trunk/src/main/webapp/WEB-INF/content/preview.jsp
===================================================================
--- trunk/src/main/webapp/WEB-INF/content/preview.jsp (rev 0)
+++ trunk/src/main/webapp/WEB-INF/content/preview.jsp 2011-07-12 12:40:41 UTC (rev 171)
@@ -0,0 +1,10 @@
+ <%@ taglib prefix="s" uri="/struts-tags"%>
+ <%@page contentType="text/html" pageEncoding="UTF-8"%>
+ <%--Title and div for rst preview--%>
+ <h3 id="prevtitle" >Preview :</h3>
+
+ <div id="prev" title="Preview">
+ <div id="preview" >
+ <s:property value="XMLResponse" escapeHtml="false"/>
+ </div>
+ </div>
Added: trunk/src/main/webapp/WEB-INF/content/privateSvnRedirect.jsp
===================================================================
--- trunk/src/main/webapp/WEB-INF/content/privateSvnRedirect.jsp (rev 0)
+++ trunk/src/main/webapp/WEB-INF/content/privateSvnRedirect.jsp 2011-07-12 12:40:41 UTC (rev 171)
@@ -0,0 +1,29 @@
+<%-- Document : PrivateSvnRedirect Created on : 30 sept. 2009, 14:05:43
+Author : glorieux --%> <%@page contentType="text/html"
+pageEncoding="UTF-8"%>
+<!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>Private Scm</title>
+<link rel="icon" href="img/ScmWebEditor_little.png" type="image/png">
+<link rel="stylesheet" type="text/css" href="css/main.css">
+</head>
+<body>
+<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")%>"/>
+<script src="cancelRedirect.js"></script>
+<p>You try to access a Private SCM. Please login</p>
+<p><label ACCESSKEY=U>User name: <input TYPE=text
+ NAME=username SIZE=12></label> <label ACCESSKEY=P>Password: <input
+ TYPE=password NAME=pw SIZE=12></label></p>
+<input type="submit" value="Submit" name="Save" /> <input type="button"
+ value="Exit" name="Cancel"
+ onclick="cancelRedirect(this.form.projectUrl);" /></form>
+<p>©2004-2009 CodeLutin</p>
+</body>
+</html>
\ No newline at end of file
Added: trunk/src/main/webapp/WEB-INF/content/recall.jsp
===================================================================
--- trunk/src/main/webapp/WEB-INF/content/recall.jsp (rev 0)
+++ trunk/src/main/webapp/WEB-INF/content/recall.jsp 2011-07-12 12:40:41 UTC (rev 171)
@@ -0,0 +1,13 @@
+<%-- Document : Recall Created on : 30 sept. 2009, 17:05:40 Author :
+glorieux --%> <%@page contentType="text/html" pageEncoding="UTF-8"%>
+<!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>Redirect...</title>
+<meta http-equiv="Refresh" content="0; url=
+<%=request.getAttribute("Redirect_url")%>">
+</head>
+</html>
Added: trunk/src/main/webapp/WEB-INF/content/redirect.jsp
===================================================================
--- trunk/src/main/webapp/WEB-INF/content/redirect.jsp (rev 0)
+++ trunk/src/main/webapp/WEB-INF/content/redirect.jsp 2011-07-12 12:40:41 UTC (rev 171)
@@ -0,0 +1,23 @@
+<%-- Document : Redirect Created on : 10 sept. 2009, 13:43:11 Author :
+glorieux --%> <%@page contentType="text/html" pageEncoding="UTF-8"%>
+<!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>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")%>">
+</head>
+<body>
+<a target="_blank" href="http://maven-site.nuiton.org/scmwebeditor/"><img src="img/ScmWebEditor_main.png" alt="$alt" /></a>
+<p>Thank you using RSTEditor</p>
+<p>You should be transferred automatically to the new page. If not
+please <a href="<%=request.getAttribute("Redirection_url")%>">click
+this link</a>.</p>
+<p>©2004-2009 CodeLutin</p>
+</body>
+</html>
Added: trunk/src/main/webapp/WEB-INF/content/reset.jsp
===================================================================
--- trunk/src/main/webapp/WEB-INF/content/reset.jsp (rev 0)
+++ trunk/src/main/webapp/WEB-INF/content/reset.jsp 2011-07-12 12:40:41 UTC (rev 171)
@@ -0,0 +1,12 @@
+<%@ taglib prefix="s" uri="/struts-tags"%>
+
+ <s:set name="lastRevision">
+ <s:property value="lastRevision"/>
+ </s:set>
+
+ <s:hidden id="valueOfLastRevision" value="%{lastRevision}" />
+ <script type="text/javascript">
+
+ editor.mirror.setValue(document.getElementById('valueOfLastRevision').value);
+
+ </script>
\ No newline at end of file
Added: trunk/src/main/webapp/WEB-INF/content/save.jsp
===================================================================
--- trunk/src/main/webapp/WEB-INF/content/save.jsp (rev 0)
+++ trunk/src/main/webapp/WEB-INF/content/save.jsp 2011-07-12 12:40:41 UTC (rev 171)
@@ -0,0 +1,17 @@
+ <%@ taglib prefix="s" uri="/struts-tags"%>
+ <%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
+
+
+
+ <s:if test="result=='authError'" >
+ <h4> <font color="red"> Bad username or password, can't save modification</font> </h4>
+ </s:if>
+ <s:elseif test="result=='error'" >
+ <h4> Can't save modification </h4>
+ </s:elseif>
+ <s:elseif test="result=='uselessSave'" >
+ <h4> It's useless to save the file, file is not modify</h4>
+ </s:elseif>
+ <s:else>
+ <h4>Last change save <s:property value="formatDate" /> </h4>
+ </s:else>
\ No newline at end of file
Added: trunk/src/main/webapp/WEB-INF/content/search.jsp
===================================================================
--- trunk/src/main/webapp/WEB-INF/content/search.jsp (rev 0)
+++ trunk/src/main/webapp/WEB-INF/content/search.jsp 2011-07-12 12:40:41 UTC (rev 171)
@@ -0,0 +1,49 @@
+<%@ 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="sj" uri="/struts-jquery-tags"%>
+ <%@ taglib prefix="sjt" uri="/struts-jquery-tree-tags" %>
+
+ <sj:head debug="true" jquerytheme="default"/>
+
+<script>
+$.subscribe('treeClicked', function(event, data) {
+ var item = event.originalEvent.data.rslt.obj;
+
+ if(item.text().indexOf("/") == -1) {
+ document.location.href=("checkout.action?address="+item.attr("id"));
+ }
+
+});
+
+</script>
+
+ <div id="searchTree">
+ <s:set name="address">
+ <s:property value="address"/>
+ </s:set>
+ <s:set name="username">
+ <s:property value="username"/>
+ </s:set>
+ <s:set name="pw">
+ <s:property value="pw"/>
+ </s:set>
+
+
+ <s:url id="searchTreeUrl" action="search?address=%{address}&username=%{username}&pw=%{pw}" />
+ <sjt:tree id="svnTree"
+ htmlTitles="true"
+ jstreetheme="classic"
+ href="%{searchTreeUrl}"
+ onClickTopics="treeClicked"
+ />
+
+ </div>
+
+ <s:label name="error"></s:label>
+
Added: trunk/src/main/webapp/WEB-INF/content/upload.jsp
===================================================================
--- trunk/src/main/webapp/WEB-INF/content/upload.jsp (rev 0)
+++ trunk/src/main/webapp/WEB-INF/content/upload.jsp 2011-07-12 12:40:41 UTC (rev 171)
@@ -0,0 +1,14 @@
+<%@ taglib prefix="s" uri="/struts-tags"%>
+
+<p>Result : </p>
+
+
+ <s:if test="badLogin">
+ <p><font color="red">Bad username or password</font></p>
+ </s:if>
+ <s:elseif test="error">
+ <p><font color="red">Erreur SVN</font></p>
+ </s:elseif>
+ <s:else>
+ <p>File upload successful</p>
+ </s:else>
\ No newline at end of file
Added: trunk/src/main/webapp/WEB-INF/content/uploadForm.jsp
===================================================================
--- trunk/src/main/webapp/WEB-INF/content/uploadForm.jsp (rev 0)
+++ trunk/src/main/webapp/WEB-INF/content/uploadForm.jsp 2011-07-12 12:40:41 UTC (rev 171)
@@ -0,0 +1,28 @@
+<%@ 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>UploadFile</title>
+</head>
+<body>
+
+ <form method="POST" id="uploadForm" action="doUpload" 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>username : <input type="text" name="username" /></label><br/>
+ <label>password : <input type="password" name="pw" /></label><br/>
+
+ <s:if test="badLogin">
+ <p><font color="red">Bad username or password</font></p>
+ </s:if>
+ <s:elseif test="error">
+ <p><font color="red">Erreur SVN</font></p>
+ </s:elseif>
+ <input type="submit"/>
+ </form>
+
+</body>
+</html>
\ No newline at end of file
Added: trunk/src/main/webapp/WEB-INF/content/uploadSuccess.jsp
===================================================================
--- trunk/src/main/webapp/WEB-INF/content/uploadSuccess.jsp (rev 0)
+++ trunk/src/main/webapp/WEB-INF/content/uploadSuccess.jsp 2011-07-12 12:40:41 UTC (rev 171)
@@ -0,0 +1,15 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+ pageEncoding="UTF-8"%>
+<!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>Success</title>
+</head>
+<body>
+<p>File upload successful</p>
+ <form>
+ <input type="button" value="close" onclick="window.close()">
+ </form>
+</body>
+</html>
\ No newline at end of file
Modified: trunk/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/src/main/webapp/WEB-INF/web.xml 2011-07-08 10:23:16 UTC (rev 170)
+++ trunk/src/main/webapp/WEB-INF/web.xml 2011-07-12 12:40:41 UTC (rev 171)
@@ -15,7 +15,7 @@
<welcome-file-list>
- <welcome-file>index.jsp</welcome-file>
+ <welcome-file>/WEB-INF/content/index.jsp</welcome-file>
</welcome-file-list>
<listener>
Deleted: trunk/src/main/webapp/accueil.jsp
===================================================================
--- trunk/src/main/webapp/accueil.jsp 2011-07-08 10:23:16 UTC (rev 170)
+++ trunk/src/main/webapp/accueil.jsp 2011-07-12 12:40:41 UTC (rev 171)
@@ -1,3 +0,0 @@
-<%@ page contentType="text/html; charset=UTF-8" %>
-
- <p>Parametres detectés</p>
Deleted: trunk/src/main/webapp/cancelRedirect.js
===================================================================
--- trunk/src/main/webapp/cancelRedirect.js 2011-07-08 10:23:16 UTC (rev 170)
+++ trunk/src/main/webapp/cancelRedirect.js 2011-07-12 12:40:41 UTC (rev 171)
@@ -1,11 +0,0 @@
-/**
- * @author geoffroy lorieux
- */
-
-
-function cancelRedirect(url)
- {
- if (confirm("Exit SCMWebEditor ?")){
- window.location.replace(url.value);
- }
- }
\ No newline at end of file
Deleted: trunk/src/main/webapp/index.jsp
===================================================================
--- trunk/src/main/webapp/index.jsp 2011-07-08 10:23:16 UTC (rev 170)
+++ trunk/src/main/webapp/index.jsp 2011-07-12 12:40:41 UTC (rev 171)
@@ -1,3 +0,0 @@
-<%
-response.sendRedirect("checkout.action");
-%>
\ No newline at end of file
Added: trunk/src/main/webapp/js/cancelRedirect.js
===================================================================
--- trunk/src/main/webapp/js/cancelRedirect.js (rev 0)
+++ trunk/src/main/webapp/js/cancelRedirect.js 2011-07-12 12:40:41 UTC (rev 171)
@@ -0,0 +1,11 @@
+/**
+ * @author geoffroy lorieux
+ */
+
+
+function cancelRedirect(url)
+ {
+ if (confirm("Exit SCMWebEditor ?")){
+ window.location.replace(url.value);
+ }
+ }
\ No newline at end of file
Added: trunk/src/main/webapp/js/gereSession.js
===================================================================
--- trunk/src/main/webapp/js/gereSession.js (rev 0)
+++ trunk/src/main/webapp/js/gereSession.js 2011-07-12 12:40:41 UTC (rev 171)
@@ -0,0 +1,41 @@
+/**
+ * @author geoffroy lorieux
+ */
+
+function rappelSession(minutes)
+{
+ var msg='Your session expire on '+minutes+' minute';
+ if(minutes>1)
+ {
+ msg+='s';
+ }
+ msg+='.\nDo you want to reload this page ?(You will not lose your data)';
+
+ if(confirm(msg))
+ {
+ location.reload();
+ }
+}
+
+/**
+ * affiche une alerte sur l'expiration de la session et redirige vers une autre page
+ */
+function expirationSession()
+{
+ alert("Your session has expire. Please relogin");
+ window.history.back(-1);
+}
+
+/**
+ * affiche des avertissements sur le délai d'expiration de la session :
+ * - un premier au bout de (expiration-rappel) minutes (par ex. : 20-3 = 17 minutes)
+ * - un second au bout de (expiration) minutes (par ex. : 20 minutes)
+ */
+function geresession(expiration, rappel)
+{
+ // affichage du rappel
+ var chronoRappel=setTimeout('rappelSession('+rappel+')', (expiration-rappel)*60*1000);
+
+ // une fois le rappel affiché, on avertit uniquement de l'expiration
+ var chronoExpiration=setTimeout('expirationSession()', (expiration)*60*1000);
+}
Added: trunk/src/main/webapp/js/pictureUpload.js
===================================================================
--- trunk/src/main/webapp/js/pictureUpload.js (rev 0)
+++ trunk/src/main/webapp/js/pictureUpload.js 2011-07-12 12:40:41 UTC (rev 171)
@@ -0,0 +1,4 @@
+function upload_popup(page, name)
+{
+window.open (page, name, config='top=300, left=300, height=300, width=500, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no')
+}
\ No newline at end of file
Added: trunk/src/main/webapp/js/selectLanguage.js
===================================================================
--- trunk/src/main/webapp/js/selectLanguage.js (rev 0)
+++ trunk/src/main/webapp/js/selectLanguage.js 2011-07-12 12:40:41 UTC (rev 171)
@@ -0,0 +1,92 @@
+/**
+ *
+ */
+
+
+function contains(text, test) {
+
+ if(text.indexOf(test) == -1) {
+ return false;
+ }
+ else {
+ return true;
+ }
+}
+
+
+
+function changeModeBy(CodeMirrorEditor, select){
+ CodeMirrorEditor.mirror.setOption("mode",select.value);
+}
+
+
+
+function selectLanguage(minetype, format) {
+
+ var typeEditor = null;
+
+ if(typeEditor==null && minetype!=null) {
+
+ if(contains(minetype, "rst") ) {
+ typeEditor="rst";
+ document.getElementById('language').selectedIndex=1
+ }
+ else if(contains(minetype, "javascript")) {
+ typeEditor="javascript";
+ document.getElementById('language').selectedIndex=2
+ }
+ else if(contains(minetype, "html") ) {
+ typeEditor="text/html";
+
+
+ document.getElementById('language').selectedIndex=3
+
+
+ }
+ else if( contains(minetype, "xml") ) {
+ typeEditor="xml";
+
+
+ document.getElementById('language').selectedIndex=4
+
+
+ }
+ }
+
+ if (typeEditor==null && format!=null){
+
+
+ if (format==("rst")) {
+ typeEditor="rst";
+
+
+ document.getElementById('language').selectedIndex=1
+// var element = document.getElementById('language');
+// element.value = "rst";
+
+ } else if(format==("javascript")) {
+ typeEditor="javascript";
+
+ document.getElementById('language').selectedIndex=2
+
+ } else if(format==("html")) {
+ typeEditor="text/html";
+
+ document.getElementById('language').selectedIndex=3
+
+ } else if(format==("xml")) {
+ typeEditor="xml";
+
+ document.getElementById('language').selectedIndex=4
+
+ } else if(format==("java")) {
+ typeEditor="text/x-java";
+
+ document.getElementById('language').selectedIndex=5
+
+ }
+
+ }
+
+
+}
\ No newline at end of file
Deleted: trunk/src/main/webapp/pictureUpload.js
===================================================================
--- trunk/src/main/webapp/pictureUpload.js 2011-07-08 10:23:16 UTC (rev 170)
+++ trunk/src/main/webapp/pictureUpload.js 2011-07-12 12:40:41 UTC (rev 171)
@@ -1,4 +0,0 @@
-function upload_popup(page, name)
-{
-window.open (page, name, config='top=300, left=300, height=300, width=500, toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no')
-}
\ No newline at end of file
Deleted: trunk/src/main/webapp/reset.jsp
===================================================================
--- trunk/src/main/webapp/reset.jsp 2011-07-08 10:23:16 UTC (rev 170)
+++ trunk/src/main/webapp/reset.jsp 2011-07-12 12:40:41 UTC (rev 171)
@@ -1,12 +0,0 @@
-<%@ taglib prefix="s" uri="/struts-tags"%>
-
- <s:set name="lastRevision">
- <s:property value="lastRevision"/>
- </s:set>
-
- <s:hidden id="valueOfLastRevision" value="%{lastRevision}" />
- <script type="text/javascript">
-
- editor.mirror.setValue(document.getElementById('valueOfLastRevision').value);
-
- </script>
\ No newline at end of file
Deleted: trunk/src/main/webapp/selectLanguage.js
===================================================================
--- trunk/src/main/webapp/selectLanguage.js 2011-07-08 10:23:16 UTC (rev 170)
+++ trunk/src/main/webapp/selectLanguage.js 2011-07-12 12:40:41 UTC (rev 171)
@@ -1,92 +0,0 @@
-/**
- *
- */
-
-
-function contains(text, test) {
-
- if(text.indexOf(test) == -1) {
- return false;
- }
- else {
- return true;
- }
-}
-
-
-
-function changeModeBy(CodeMirrorEditor, select){
- CodeMirrorEditor.mirror.setOption("mode",select.value);
-}
-
-
-
-function selectLanguage(minetype, format) {
-
- var typeEditor = null;
-
- if(typeEditor==null && minetype!=null) {
-
- if(contains(minetype, "rst") ) {
- typeEditor="rst";
- document.getElementById('language').selectedIndex=1
- }
- else if(contains(minetype, "javascript")) {
- typeEditor="javascript";
- document.getElementById('language').selectedIndex=2
- }
- else if(contains(minetype, "html") ) {
- typeEditor="text/html";
-
-
- document.getElementById('language').selectedIndex=3
-
-
- }
- else if( contains(minetype, "xml") ) {
- typeEditor="xml";
-
-
- document.getElementById('language').selectedIndex=4
-
-
- }
- }
-
- if (typeEditor==null && format!=null){
-
-
- if (format==("rst")) {
- typeEditor="rst";
-
-
- document.getElementById('language').selectedIndex=1
-// var element = document.getElementById('language');
-// element.value = "rst";
-
- } else if(format==("javascript")) {
- typeEditor="javascript";
-
- document.getElementById('language').selectedIndex=2
-
- } else if(format==("html")) {
- typeEditor="text/html";
-
- document.getElementById('language').selectedIndex=3
-
- } else if(format==("xml")) {
- typeEditor="xml";
-
- document.getElementById('language').selectedIndex=4
-
- } else if(format==("java")) {
- typeEditor="text/x-java";
-
- document.getElementById('language').selectedIndex=5
-
- }
-
- }
-
-
-}
\ No newline at end of file
Deleted: trunk/src/main/webapp/upload.jsp
===================================================================
--- trunk/src/main/webapp/upload.jsp 2011-07-08 10:23:16 UTC (rev 170)
+++ trunk/src/main/webapp/upload.jsp 2011-07-12 12:40:41 UTC (rev 171)
@@ -1,14 +0,0 @@
-<%@ taglib prefix="s" uri="/struts-tags"%>
-
-<p>Result : </p>
-
-
- <s:if test="badLogin">
- <p><font color="red">Bad username or password</font></p>
- </s:if>
- <s:elseif test="error">
- <p><font color="red">Erreur SVN</font></p>
- </s:elseif>
- <s:else>
- <p>File upload successful</p>
- </s:else>
\ No newline at end of file
Deleted: trunk/src/main/webapp/uploadForm.jsp
===================================================================
--- trunk/src/main/webapp/uploadForm.jsp 2011-07-08 10:23:16 UTC (rev 170)
+++ trunk/src/main/webapp/uploadForm.jsp 2011-07-12 12:40:41 UTC (rev 171)
@@ -1,28 +0,0 @@
-<%@ 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>UploadFile</title>
-</head>
-<body>
-
- <form method="POST" id="uploadForm" action="doUpload" 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>username : <input type="text" name="username" /></label><br/>
- <label>password : <input type="password" name="pw" /></label><br/>
-
- <s:if test="badLogin">
- <p><font color="red">Bad username or password</font></p>
- </s:if>
- <s:elseif test="error">
- <p><font color="red">Erreur SVN</font></p>
- </s:elseif>
- <input type="submit"/>
- </form>
-
-</body>
-</html>
\ No newline at end of file
Deleted: trunk/src/main/webapp/uploadSuccess.jsp
===================================================================
--- trunk/src/main/webapp/uploadSuccess.jsp 2011-07-08 10:23:16 UTC (rev 170)
+++ trunk/src/main/webapp/uploadSuccess.jsp 2011-07-12 12:40:41 UTC (rev 171)
@@ -1,15 +0,0 @@
-<%@ page language="java" contentType="text/html; charset=UTF-8"
- pageEncoding="UTF-8"%>
-<!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>Success</title>
-</head>
-<body>
-<p>File upload successful</p>
- <form>
- <input type="button" value="close" onclick="window.close()">
- </form>
-</body>
-</html>
\ No newline at end of file
1
0
r170 - in trunk/src/main: java/org/nuiton/scmwebeditor/actions webapp
by kcardineaud@users.nuiton.org 08 Jul '11
by kcardineaud@users.nuiton.org 08 Jul '11
08 Jul '11
Author: kcardineaud
Date: 2011-07-08 12:23:16 +0200 (Fri, 08 Jul 2011)
New Revision: 170
Url: http://nuiton.org/repositories/revision/scmwebeditor/170
Log:
Fix a problem with encoding of preview
Modified:
trunk/src/main/java/org/nuiton/scmwebeditor/actions/PreviewAction.java
trunk/src/main/webapp/ModificationViewer.jsp
trunk/src/main/webapp/Preview.jsp
Modified: trunk/src/main/java/org/nuiton/scmwebeditor/actions/PreviewAction.java
===================================================================
--- trunk/src/main/java/org/nuiton/scmwebeditor/actions/PreviewAction.java 2011-07-08 07:40:02 UTC (rev 169)
+++ trunk/src/main/java/org/nuiton/scmwebeditor/actions/PreviewAction.java 2011-07-08 10:23:16 UTC (rev 170)
@@ -59,24 +59,23 @@
if(log.isDebugEnabled()) {
log.debug(newText);
}
-
+ XMLResponse="";
//Using jrst for generate html document
try {
XMLResponse = JRST.generate(JRST.TYPE_HTML, newText);
if(log.isDebugEnabled()) {
log.debug("RST generate");
}
+
} catch (Exception eee) {
if(log.isWarnEnabled()) {
log.warn("RST generate fail",eee);
}
- XMLResponse = "<h4>Parsing error, please read RST specification<h4>";
+ XMLResponse = "<h4>Parsing érror, please read RST specification<h4>";
return;
}
-
-
}
static public PreviewAction getAction() {
Modified: trunk/src/main/webapp/ModificationViewer.jsp
===================================================================
--- trunk/src/main/webapp/ModificationViewer.jsp 2011-07-08 07:40:02 UTC (rev 169)
+++ trunk/src/main/webapp/ModificationViewer.jsp 2011-07-08 10:23:16 UTC (rev 170)
@@ -10,7 +10,7 @@
<html>
<head>
<title>SCMWebEditor</title>
-
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<script src="selectLanguage.js"></script>
@@ -41,7 +41,7 @@
<link rel="icon" href="img/ScmWebEditor_little.png" type="image/png">
<link rel="stylesheet" type="text/css" href="css/main.css">
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+
</head>
Modified: trunk/src/main/webapp/Preview.jsp
===================================================================
--- trunk/src/main/webapp/Preview.jsp 2011-07-08 07:40:02 UTC (rev 169)
+++ trunk/src/main/webapp/Preview.jsp 2011-07-08 10:23:16 UTC (rev 170)
@@ -1,5 +1,5 @@
<%@ taglib prefix="s" uri="/struts-tags"%>
-
+ <%@page contentType="text/html" pageEncoding="UTF-8"%>
<%--Title and div for rst preview--%>
<h3 id="prevtitle" >Preview :</h3>
1
0
r169 - in trunk/src/main: java/org/nuiton/scmwebeditor webapp/WEB-INF
by kcardineaud@users.nuiton.org 08 Jul '11
by kcardineaud@users.nuiton.org 08 Jul '11
08 Jul '11
Author: kcardineaud
Date: 2011-07-08 09:40:02 +0200 (Fri, 08 Jul 2011)
New Revision: 169
Url: http://nuiton.org/repositories/revision/scmwebeditor/169
Log:
Change the name of ApplicationListener to ScmWebEditorApplicationListener
Added:
trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorApplicationListener.java
Removed:
trunk/src/main/java/org/nuiton/scmwebeditor/ApplicationListener.java
Modified:
trunk/src/main/webapp/WEB-INF/web.xml
Deleted: trunk/src/main/java/org/nuiton/scmwebeditor/ApplicationListener.java
===================================================================
--- trunk/src/main/java/org/nuiton/scmwebeditor/ApplicationListener.java 2011-07-07 16:02:27 UTC (rev 168)
+++ trunk/src/main/java/org/nuiton/scmwebeditor/ApplicationListener.java 2011-07-08 07:40:02 UTC (rev 169)
@@ -1,24 +0,0 @@
-package org.nuiton.scmwebeditor;
-
-import javax.servlet.ServletContextEvent;
-import javax.servlet.ServletContextListener;
-
-import org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory;
-import org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryFactoryImpl;
-
-public class ApplicationListener implements ServletContextListener {
-
- @Override
- public void contextInitialized(ServletContextEvent sce) {
- SVNRepositoryFactoryImpl.setup();
- DAVRepositoryFactory.setup();
-
- }
-
- @Override
- public void contextDestroyed(ServletContextEvent sce) {
- // Nothing
-
- }
-
-}
Added: trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorApplicationListener.java
===================================================================
--- trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorApplicationListener.java (rev 0)
+++ trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorApplicationListener.java 2011-07-08 07:40:02 UTC (rev 169)
@@ -0,0 +1,24 @@
+package org.nuiton.scmwebeditor;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+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();
+
+ }
+
+ @Override
+ public void contextDestroyed(ServletContextEvent sce) {
+ // Nothing
+
+ }
+
+}
Modified: trunk/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/src/main/webapp/WEB-INF/web.xml 2011-07-07 16:02:27 UTC (rev 168)
+++ trunk/src/main/webapp/WEB-INF/web.xml 2011-07-08 07:40:02 UTC (rev 169)
@@ -20,7 +20,7 @@
<listener>
<description>Init</description>
- <listener-class>org.nuiton.scmwebeditor.ApplicationListener</listener-class>
+ <listener-class>org.nuiton.scmwebeditor.ScmWebEditorApplicationListener</listener-class>
</listener>
</web-app>
1
0
r168 - trunk/src/main/java/org/nuiton/scmwebeditor/actions
by kcardineaud@users.nuiton.org 07 Jul '11
by kcardineaud@users.nuiton.org 07 Jul '11
07 Jul '11
Author: kcardineaud
Date: 2011-07-07 18:02:27 +0200 (Thu, 07 Jul 2011)
New Revision: 168
Url: http://nuiton.org/repositories/revision/scmwebeditor/168
Log:
If a file url is search, the file is show in result window
Modified:
trunk/src/main/java/org/nuiton/scmwebeditor/actions/SearchAction.java
Modified: trunk/src/main/java/org/nuiton/scmwebeditor/actions/SearchAction.java
===================================================================
--- trunk/src/main/java/org/nuiton/scmwebeditor/actions/SearchAction.java 2011-07-07 15:32:54 UTC (rev 167)
+++ trunk/src/main/java/org/nuiton/scmwebeditor/actions/SearchAction.java 2011-07-07 16:02:27 UTC (rev 168)
@@ -216,7 +216,12 @@
if(log.isInfoEnabled()) {
log.info( "The entry at '" + url + "' is a file." );
}
-
+ TreeNode node = new TreeNode();
+ node.setId(url);
+ node.setTitle(url.substring(url.lastIndexOf("/")+1));
+ node.setState(TreeNode.NODE_STATE_LEAF);
+ node.setIcon("ui-icon-document");
+ nodes.add(node);
return Action.SUCCESS;
}
numberOfFile=0;
1
0
r167 - in trunk/src/main/java/org/nuiton/scmwebeditor: . actions
by kcardineaud@users.nuiton.org 07 Jul '11
by kcardineaud@users.nuiton.org 07 Jul '11
07 Jul '11
Author: kcardineaud
Date: 2011-07-07 17:32:54 +0200 (Thu, 07 Jul 2011)
New Revision: 167
Url: http://nuiton.org/repositories/revision/scmwebeditor/167
Log:
The list of file for search action is now a list of String instead of a list of Object UrlSvnFile
Removed:
trunk/src/main/java/org/nuiton/scmwebeditor/UrlSvnFile.java
Modified:
trunk/src/main/java/org/nuiton/scmwebeditor/actions/ScmWebEditorMainAction.java
trunk/src/main/java/org/nuiton/scmwebeditor/actions/SearchAction.java
Deleted: trunk/src/main/java/org/nuiton/scmwebeditor/UrlSvnFile.java
===================================================================
--- trunk/src/main/java/org/nuiton/scmwebeditor/UrlSvnFile.java 2011-07-07 15:01:43 UTC (rev 166)
+++ trunk/src/main/java/org/nuiton/scmwebeditor/UrlSvnFile.java 2011-07-07 15:32:54 UTC (rev 167)
@@ -1,50 +0,0 @@
-package org.nuiton.scmwebeditor;
-
-
-
-public class UrlSvnFile implements java.lang.Comparable<UrlSvnFile> {
- String url;
-
- public UrlSvnFile (String url) {
- this.url=url;
- }
-
- public String toString() {
- return url;
- }
-
- public int getLevel() {
- String[] tab = url.split("/");
- return tab.length;
- }
-
-
- @Override
- public int compareTo(UrlSvnFile o) {
- int level1 = o.getLevel();
- int level2 = this.getLevel();
-
- if (level1 > level2) {
- return -1;
- }
- else if(level1 == level2) {
- if(o.toString().length() > this.toString().length()) {
- return -1;
- }
- else if(o.toString().length() == this.toString().length()) {
- return 0;
- }
- else {
- return 1;
- }
-
- }
- else {
- return 1;
- }
- }
-
-
-
-
-}
Modified: trunk/src/main/java/org/nuiton/scmwebeditor/actions/ScmWebEditorMainAction.java
===================================================================
--- trunk/src/main/java/org/nuiton/scmwebeditor/actions/ScmWebEditorMainAction.java 2011-07-07 15:01:43 UTC (rev 166)
+++ trunk/src/main/java/org/nuiton/scmwebeditor/actions/ScmWebEditorMainAction.java 2011-07-07 15:32:54 UTC (rev 167)
@@ -17,7 +17,6 @@
import org.tmatesoft.svn.core.SVNNodeKind;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager;
-import org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory;
import org.tmatesoft.svn.core.io.SVNRepository;
import org.tmatesoft.svn.core.io.SVNRepositoryFactory;
import org.tmatesoft.svn.core.wc.SVNWCUtil;
@@ -163,7 +162,7 @@
setSvnSession(httpSession, svnSess);
- DAVRepositoryFactory.setup();
+
String originalText ="";
Modified: trunk/src/main/java/org/nuiton/scmwebeditor/actions/SearchAction.java
===================================================================
--- trunk/src/main/java/org/nuiton/scmwebeditor/actions/SearchAction.java 2011-07-07 15:01:43 UTC (rev 166)
+++ trunk/src/main/java/org/nuiton/scmwebeditor/actions/SearchAction.java 2011-07-07 15:32:54 UTC (rev 167)
@@ -2,7 +2,6 @@
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
@@ -15,7 +14,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.nuiton.scmwebeditor.ScmWebEditorBaseAction;
-import org.nuiton.scmwebeditor.UrlSvnFile;
import org.tmatesoft.svn.core.SVNAuthenticationException;
import org.tmatesoft.svn.core.SVNDirEntry;
import org.tmatesoft.svn.core.SVNException;
@@ -23,7 +21,6 @@
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager;
import org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory;
-import org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryFactoryImpl;
import org.tmatesoft.svn.core.io.SVNRepository;
import org.tmatesoft.svn.core.io.SVNRepositoryFactory;
@@ -43,7 +40,7 @@
String address;
- LinkedList<UrlSvnFile> files;
+ LinkedList<String> files;
Map<String,String> directories;
String username;
String pw;
@@ -77,7 +74,7 @@
}
- public LinkedList<UrlSvnFile> getFiles() {
+ public LinkedList<String> getFiles() {
return files;
}
@@ -148,7 +145,7 @@
- files = new LinkedList<UrlSvnFile>();
+ files = new LinkedList<String>();
directories = new HashMap<String,String>();
@@ -216,10 +213,10 @@
error="There is no entry at '" + url + "'.";
return Action.SUCCESS;
} else if ( nodeKind == SVNNodeKind.FILE ) {
- if(log.isErrorEnabled()) {
- log.error( "The entry at '" + url + "' is a file while a directory was expected." );
+ if(log.isInfoEnabled()) {
+ log.info( "The entry at '" + url + "' is a file." );
}
- error="The entry is a file while a directory was expected.";
+
return Action.SUCCESS;
}
numberOfFile=0;
@@ -228,13 +225,12 @@
log.info("Nombre de fichier : "+files.size());
}
- Collections.sort(files);
-
+
- for (UrlSvnFile file : files ) {
+ for (String file : files ) {
TreeNode node = new TreeNode();
- node.setId(file.toString());
- node.setTitle(file.toString().substring(file.toString().lastIndexOf("/")+1));
+ node.setId(file);
+ node.setTitle(file.substring(file.lastIndexOf("/")+1));
node.setState(TreeNode.NODE_STATE_LEAF);
node.setIcon("ui-icon-document");
nodes.add(node);
@@ -301,7 +297,7 @@
}
else {
// On ajoute dans la liste files seulement les fichiers et pas les répertoires
- files.add(new UrlSvnFile(fichier));
+ files.add(fichier);
}
}
1
0
r166 - in trunk: . src/main/java/org/nuiton/scmwebeditor src/main/java/org/nuiton/scmwebeditor/actions src/main/webapp/WEB-INF
by kcardineaud@users.nuiton.org 07 Jul '11
by kcardineaud@users.nuiton.org 07 Jul '11
07 Jul '11
Author: kcardineaud
Date: 2011-07-07 17:01:43 +0200 (Thu, 07 Jul 2011)
New Revision: 166
Url: http://nuiton.org/repositories/revision/scmwebeditor/166
Log:
ScmWebEditor can now be use with svn protocol repository
Added:
trunk/src/main/java/org/nuiton/scmwebeditor/ApplicationListener.java
Modified:
trunk/pom.xml
trunk/src/main/java/org/nuiton/scmwebeditor/actions/SearchAction.java
trunk/src/main/webapp/WEB-INF/web.xml
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-07-07 14:00:26 UTC (rev 165)
+++ trunk/pom.xml 2011-07-07 15:01:43 UTC (rev 166)
@@ -44,7 +44,7 @@
<dependency>
<groupId>org.tmatesoft.svnkit</groupId>
<artifactId>svnkit</artifactId>
- <version>1.3.2-1</version>
+ <version>1.3.5</version>
</dependency>
<dependency>
Added: trunk/src/main/java/org/nuiton/scmwebeditor/ApplicationListener.java
===================================================================
--- trunk/src/main/java/org/nuiton/scmwebeditor/ApplicationListener.java (rev 0)
+++ trunk/src/main/java/org/nuiton/scmwebeditor/ApplicationListener.java 2011-07-07 15:01:43 UTC (rev 166)
@@ -0,0 +1,24 @@
+package org.nuiton.scmwebeditor;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+import org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory;
+import org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryFactoryImpl;
+
+public class ApplicationListener implements ServletContextListener {
+
+ @Override
+ public void contextInitialized(ServletContextEvent sce) {
+ SVNRepositoryFactoryImpl.setup();
+ DAVRepositoryFactory.setup();
+
+ }
+
+ @Override
+ public void contextDestroyed(ServletContextEvent sce) {
+ // Nothing
+
+ }
+
+}
Modified: trunk/src/main/java/org/nuiton/scmwebeditor/actions/SearchAction.java
===================================================================
--- trunk/src/main/java/org/nuiton/scmwebeditor/actions/SearchAction.java 2011-07-07 14:00:26 UTC (rev 165)
+++ trunk/src/main/java/org/nuiton/scmwebeditor/actions/SearchAction.java 2011-07-07 15:01:43 UTC (rev 166)
@@ -23,6 +23,7 @@
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager;
import org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory;
+import org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryFactoryImpl;
import org.tmatesoft.svn.core.io.SVNRepository;
import org.tmatesoft.svn.core.io.SVNRepositoryFactory;
@@ -164,6 +165,9 @@
if(id.equals("")) {
try {
+ log.info("Address svn : "+address);
+
+
repository = SVNRepositoryFactory.create( SVNURL.parseURIDecoded( address ) );
authManager = SVNWCUtil.createDefaultAuthenticationManager( name , password );
repository.setAuthenticationManager( authManager );
@@ -177,7 +181,7 @@
return "authError";
} catch (SVNException e) {
if(log.isErrorEnabled()) {
- log.error("Can't access to the repository");
+ log.error("Can't access to the repository",e);
}
error="Can't access to the repository";
}
Modified: trunk/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/src/main/webapp/WEB-INF/web.xml 2011-07-07 14:00:26 UTC (rev 165)
+++ trunk/src/main/webapp/WEB-INF/web.xml 2011-07-07 15:01:43 UTC (rev 166)
@@ -18,52 +18,9 @@
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
- <!--
- <servlet>
- <servlet-name>ScmWebEditorMainServlet</servlet-name>
- <servlet-class>org.nuiton.scmwebeditor.ScmWebEditorMainServlet</servlet-class>
- </servlet>
- <servlet>
- <servlet-name>PreviewServlet</servlet-name>
- <servlet-class>org.nuiton.scmwebeditor.PreviewServlet</servlet-class>
- </servlet>
- <servlet>
- <servlet-name>PrivateSvnServlet</servlet-name>
- <servlet-class>org.nuiton.scmwebeditor.PrivateSvnServlet</servlet-class>
- </servlet>
- -->
+ <listener>
+ <description>Init</description>
+ <listener-class>org.nuiton.scmwebeditor.ApplicationListener</listener-class>
+ </listener>
-<!-- <servlet>-->
-<!-- <servlet-name>PictureUpload</servlet-name>-->
-<!-- <servlet-class>org.nuiton.scmwebeditor.PictureUpload</servlet-class>-->
-<!-- </servlet>-->
-<!--
- <servlet>
- <servlet-name>SearchServlet</servlet-name>
- <servlet-class>org.nuiton.scmwebeditor.SearchServlet</servlet-class>
- </servlet>
- <servlet-mapping>
- <servlet-name>ScmWebEditorMainServlet</servlet-name>
- <url-pattern>/scmwebeditor</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>PreviewServlet</servlet-name>
- <url-pattern>/previewservlet</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>PrivateSvnServlet</servlet-name>
- <url-pattern>/privatesvnservlet</url-pattern>
- </servlet-mapping>
--->
-<!-- <servlet-mapping>-->
-<!-- <servlet-name>PictureUpload</servlet-name>-->
-<!-- <url-pattern>/pictureUpload</url-pattern>-->
-<!-- </servlet-mapping>-->
-<!--
- <servlet-mapping>
- <servlet-name>SearchServlet</servlet-name>
- <url-pattern>/searchservlet</url-pattern>
- </servlet-mapping>
- -->
-
</web-app>
1
0
r165 - in trunk/src/main: java/org/nuiton/scmwebeditor java/org/nuiton/scmwebeditor/actions webapp
by kcardineaud@users.nuiton.org 07 Jul '11
by kcardineaud@users.nuiton.org 07 Jul '11
07 Jul '11
Author: kcardineaud
Date: 2011-07-07 16:00:26 +0200 (Thu, 07 Jul 2011)
New Revision: 165
Url: http://nuiton.org/repositories/revision/scmwebeditor/165
Log:
ScmwebEditor use stream to get the file content to edit, faster than checkout the directory
Modified:
trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorBaseAction.java
trunk/src/main/java/org/nuiton/scmwebeditor/actions/ScmWebEditorMainAction.java
trunk/src/main/webapp/ModificationViewer.jsp
Modified: trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorBaseAction.java
===================================================================
--- trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorBaseAction.java 2011-07-07 10:31:09 UTC (rev 164)
+++ trunk/src/main/java/org/nuiton/scmwebeditor/ScmWebEditorBaseAction.java 2011-07-07 14:00:26 UTC (rev 165)
@@ -236,7 +236,7 @@
protected String getMineType(File file) throws IOException, SAXException, TikaException {
- FileInputStream is = new FileInputStream(file);
+ InputStream is = new FileInputStream(file);
try {
BodyContentHandler contenthandler = new BodyContentHandler();
Metadata metadata = new Metadata();
@@ -251,5 +251,22 @@
is.close();
}
}
+
+ protected String getMineType(String content, String filename) throws IOException, SAXException, TikaException {
+ InputStream is = new ByteArrayInputStream(content.getBytes());
+ try {
+ BodyContentHandler contenthandler = new BodyContentHandler();
+ Metadata metadata = new Metadata();
+ metadata.set(Metadata.RESOURCE_NAME_KEY, filename);
+ AutoDetectParser parser = new AutoDetectParser();
+ parser.parse(is, contenthandler, metadata);
+ String result = metadata.get(Metadata.CONTENT_TYPE);
+ log.info("Mine type of " + filename + " is : " + result);
+ return result;
+ }
+ finally {
+ is.close();
+ }
+ }
}
Modified: trunk/src/main/java/org/nuiton/scmwebeditor/actions/ScmWebEditorMainAction.java
===================================================================
--- trunk/src/main/java/org/nuiton/scmwebeditor/actions/ScmWebEditorMainAction.java 2011-07-07 10:31:09 UTC (rev 164)
+++ trunk/src/main/java/org/nuiton/scmwebeditor/actions/ScmWebEditorMainAction.java 2011-07-07 14:00:26 UTC (rev 165)
@@ -1,13 +1,11 @@
package org.nuiton.scmwebeditor.actions;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
+import java.io.ByteArrayOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
-import org.apache.commons.io.FileUtils;
+
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -16,7 +14,13 @@
import org.nuiton.scmwebeditor.SvnSession;
import org.tmatesoft.svn.core.SVNAuthenticationException;
import org.tmatesoft.svn.core.SVNException;
+import org.tmatesoft.svn.core.SVNNodeKind;
+import org.tmatesoft.svn.core.SVNURL;
+import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager;
import org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory;
+import org.tmatesoft.svn.core.io.SVNRepository;
+import org.tmatesoft.svn.core.io.SVNRepositoryFactory;
+import org.tmatesoft.svn.core.wc.SVNWCUtil;
import com.opensymphony.xwork2.Action;
@@ -162,34 +166,84 @@
DAVRepositoryFactory.setup();
-// Checkout svn and file organisation
+ String originalText ="";
+
+
+ String login = svnSess.getLogin();
+ String pw = svnSess.getPassword();
+ String url = svnSess.getSvnPath();
+ String file = svnSess.getFileName();
+
+ if(login==null && pw==null) {
+ login = "anonymous";
+ pw = "anonymous";
+ }
+
+ SVNRepository repository = null;
+
try {
- checkout(svnSess);
- } catch (SVNAuthenticationException authexep) {
- request.setAttribute(PARAMETER_ADDRESS, address);
-
- // if svn authentication failed user is redirected on login page
- if(log.isDebugEnabled()) {
- log.debug("Private SCM on reading " + svnSess.getRemoteUrl());
+ repository = SVNRepositoryFactory.create( SVNURL.parseURIEncoded( url ) );
+ ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager( login , pw );
+ repository.setAuthenticationManager( authManager );
+
+ SVNNodeKind nodeKind = repository.checkPath( file , -1 );
+
+
+
+
+ if ( nodeKind == SVNNodeKind.NONE ) {
+ if(log.isErrorEnabled()) {
+ log.error( "There is no entry at '" + url + "'." );
}
- //On supprime le repertoire temporaire
+ request.setAttribute("projectUrl", projectUrl);
+ //Suppression du repertoire temporaire
delTempDirectory(svnSess);
- //redirect to a login page
- return Action.LOGIN;
-
- } catch (SVNException e) {
+ return "errorPath";
+ } else if ( nodeKind == SVNNodeKind.DIR ) {
+ if(log.isErrorEnabled()) {
+ log.error( "The entry at '" + url + "' is a file while a directory was expected." );
+ }
request.setAttribute("projectUrl", projectUrl);
//Suppression du repertoire temporaire
delTempDirectory(svnSess);
return "errorPath";
}
+
+ ByteArrayOutputStream baos = new ByteArrayOutputStream( );
+
+ repository.getFile( file , -1 , null , baos );
+
+ originalText=baos.toString();
+
- File CheckOutFile = new File(svnSess.getCheckoutdir(), svnSess.getFileName());
+ } catch (SVNAuthenticationException authexep) {
+
+ request.setAttribute(PARAMETER_ADDRESS, address);
+
+ // if svn authentication failed user is redirected on login page
+ if(log.isDebugEnabled()) {
+ log.debug("Private SCM on reading " + svnSess.getRemoteUrl());
+ }
+ //On supprime le repertoire temporaire
+ delTempDirectory(svnSess);
+ //redirect to a login page
+ return Action.LOGIN;
+
+ } catch (SVNException e) {
+ request.setAttribute("projectUrl", projectUrl);
+ //Suppression du repertoire temporaire
+ delTempDirectory(svnSess);
+ return "errorPath";
+ }
+
+
+
+
String mineType =null;
try {
- mineType = getMineType(CheckOutFile);
+ mineType = getMineType(originalText, svnSess.getFileName());
} catch (Exception e) {
if(log.isErrorEnabled()) {
log.error("Can't get MimeType",e);
@@ -210,39 +264,24 @@
}
- try {
- String originalText = FileUtils.readFileToString(CheckOutFile);
- request.setAttribute(PARAMETER_FORMAT, svnSess.getFormat());
- request.setAttribute(ATTRIBUTE_ORIG_TEXT, StringEscapeUtils.escapeHtml(originalText));
- request.setAttribute(ATTRIBUTE_INVALIDATE_MAX_TIME, (httpSession.getMaxInactiveInterval() / 60));
- request.setAttribute(ATTRIBUTE_LOGIN, (svnSess.getLogin() != null && !svnSess.getLogin().equalsIgnoreCase("") ? svnSess.getLogin() : null));
- request.setAttribute(ATTRIBUTE_IS_LOGIN, (svnSess.getLogin() != null && svnSess.getPassword() != null && !svnSess.getLogin().equalsIgnoreCase("") && !svnSess.getPassword().equalsIgnoreCase("")));
- request.setAttribute(ATTRIBUTE_PROJECT_URL, svnSess.getProjectUrl());
- request.setAttribute(PARAMETER_SCM_EDITOR_URL, svnSess.getScmEditorUrl());
- if (log.isDebugEnabled()) {
- log.debug("l'url est : " + svnSess.getScmEditorUrl());
- }
- request.setAttribute(ATTRIBUTE_SCM_EDITOR_URI, request.getRequestURI());
- request.setAttribute(ATTRIBUTE_PREVIEW_SERVLET_URL, request.getContextPath() + "/previewservlet");
+
- // End on first part
-
- } catch (FileNotFoundException ee) {
- /* fichier non trouve, on redirige vers BadFileRedirect.jsp
- * après avoir supprimé le repertoire temporaire
- */
- delTempDirectory(svnSess);
- request.setAttribute(PARAMETER_SCM_EDITOR_URL, svnSess.getProjectUrl());
- return "errorPath";
- } catch (IOException e) {
- log.error("Can't find the checkout file",e);
+ request.setAttribute(PARAMETER_FORMAT, svnSess.getFormat());
+ request.setAttribute(ATTRIBUTE_ORIG_TEXT, StringEscapeUtils.escapeHtml(originalText));
+ request.setAttribute(ATTRIBUTE_INVALIDATE_MAX_TIME, (httpSession.getMaxInactiveInterval() / 60));
+ request.setAttribute(ATTRIBUTE_LOGIN, (svnSess.getLogin() != null && !svnSess.getLogin().equalsIgnoreCase("") ? svnSess.getLogin() : null));
+ request.setAttribute(ATTRIBUTE_IS_LOGIN, (svnSess.getLogin() != null && svnSess.getPassword() != null && !svnSess.getLogin().equalsIgnoreCase("") && !svnSess.getPassword().equalsIgnoreCase("")));
+ request.setAttribute(ATTRIBUTE_PROJECT_URL, svnSess.getProjectUrl());
+ request.setAttribute(PARAMETER_SCM_EDITOR_URL, svnSess.getScmEditorUrl());
+ if (log.isDebugEnabled()) {
+ log.debug("l'url est : " + svnSess.getScmEditorUrl());
}
+ request.setAttribute(ATTRIBUTE_SCM_EDITOR_URI, request.getRequestURI());
+ request.setAttribute(ATTRIBUTE_PREVIEW_SERVLET_URL, request.getContextPath() + "/previewservlet");
- //On supprime le repertoire temporaire
- delTempDirectory(svnSess);
return "editPage";
+
-
}
Modified: trunk/src/main/webapp/ModificationViewer.jsp
===================================================================
--- trunk/src/main/webapp/ModificationViewer.jsp 2011-07-07 10:31:09 UTC (rev 164)
+++ trunk/src/main/webapp/ModificationViewer.jsp 2011-07-07 14:00:26 UTC (rev 165)
@@ -100,7 +100,6 @@
-
<script type='text/javascript'>
selectLanguage('<%=((String) request.getAttribute("minetype"))%>','<%=request.getAttribute("format")%>' );
changeModeBy(editor, document.getElementById('language'));
@@ -125,7 +124,7 @@
<div id="htmlcontentCommit"></div>
- <p>Commit Message: <input type="text" name="commitMessage" title="Let a commit message with this file."/></p>
+ <label>Commit Message: <input type="text" name="commitMessage" title="Let a commit message with this file."/></label>
<%if (request.getAttribute("IsLogin").equals(false) == true){
%>
@@ -163,6 +162,7 @@
button="true"
buttonIcon="ui-icon-refresh"
value="Save and Continue Editing"
+ title="Commit modifications and continue editing the file"
>
</sj:submit>
@@ -179,16 +179,17 @@
href="%{ajaxPreview}"
button="true"
buttonIcon="ui-icon-refresh"
- value="Preview"
+ value="Preview"
>
</sj:submit>
<%}%>
<sj:submit
+ title="Go back to the last revision of the file"
id="resetButton"
targets="resetResult"
- value="Reset Ajax"
+ value="Reset"
button="true"
href="reset.action"
/>
@@ -204,7 +205,7 @@
</div>
</form>
<center>
- <button onClick="javascript:upload_popup('uploadForm.jsp','upload');" >Upload</button>
+ <button title="Upload a file on the repository" onClick="javascript:upload_popup('uploadForm.jsp','upload');" >Upload</button>
</center>
<div>
1
0