This is an automated email from the git hooks/post-receive script. New commit to branch feature/GIT in repository scmwebeditor. See http://git.nuiton.org/scmwebeditor.git commit 236f350014d4b0c05e49c73197e987a12afbc387 Author: Hugo PIGEON <hpigeon@codelutin.com> Date: Fri May 15 11:00:08 2015 +0200 Add documentation in the code --- .../org/nuiton/scmwebeditor/git/GitConnection.java | 47 ++++-- .../org/nuiton/scmwebeditor/git/GitProvider.java | 4 + ...mUser.java => RepositoryNotFoundException.java} | 42 ++---- .../org/nuiton/scmwebeditor/api/ScmConnection.java | 4 +- .../scmwebeditor/api/ScmNotFoundException.java | 15 -- .../org/nuiton/scmwebeditor/api/ScmProvider.java | 3 + .../scmwebeditor/api/ScmWebEditorConfig.java | 20 ++- .../scmwebeditor/api/ScmWebEditorConfigOption.java | 5 +- .../scmwebeditor/api/dto/BrowseResultDto.java | 11 -- .../org/nuiton/scmwebeditor/svn/SvnConnection.java | 5 +- .../org/nuiton/scmwebeditor/svn/SvnProvider.java | 6 + .../org/nuiton/scmwebeditor/uiweb}/ScmSession.java | 38 ++++- .../org/nuiton/scmwebeditor/uiweb}/ScmUser.java | 15 +- .../uiweb/ScmWebEditorApplicationListener.java | 5 +- .../scmwebeditor/uiweb/SweSessionListener.java | 25 ++++ .../uiweb/actions/AbstractScmWebEditorAction.java | 25 +++- .../scmwebeditor/uiweb/actions/BrowseAction.java | 55 +++---- .../uiweb/actions/DetectScmAction.java | 13 ++ .../scmwebeditor/uiweb/actions/EditAction.java | 49 +++++-- .../uiweb/actions/ListBranchesAction.java | 13 ++ .../scmwebeditor/uiweb/actions/LogoutAction.java | 30 ++-- .../scmwebeditor/uiweb/actions/PreviewAction.java | 36 ++--- .../scmwebeditor/uiweb/actions/ResetAction.java | 39 ++--- .../scmwebeditor/uiweb/actions/SaveAction.java | 27 ++-- .../uiweb/actions/ScmWebEditorCommitAction.java | 162 +++++++++------------ .../uiweb/actions/ScmWebEditorMainAction.java | 33 +++-- .../scmwebeditor/uiweb/actions/UploadAction.java | 22 ++- swe-ui-web/src/main/resources/struts.xml | 2 +- .../webapp/WEB-INF/content/badFileRedirect.jsp | 7 +- .../src/main/webapp/WEB-INF/content/badRstFile.jsp | 3 +- .../main/webapp/WEB-INF/content/badUseRedirect.jsp | 7 +- .../src/main/webapp/WEB-INF/content/browse.jsp | 3 +- .../src/main/webapp/WEB-INF/content/error.jsp | 7 +- .../src/main/webapp/WEB-INF/content/fileModify.jsp | 3 +- .../src/main/webapp/WEB-INF/content/index.jsp | 3 +- .../main/webapp/WEB-INF/content/loginBrowse.jsp | 3 +- .../src/main/webapp/WEB-INF/content/logout.jsp | 3 +- .../webapp/WEB-INF/content/modificationViewer.jsp | 3 +- .../main/webapp/WEB-INF/content/outConnection.jsp | 4 +- .../src/main/webapp/WEB-INF/content/preview.jsp | 5 +- .../webapp/WEB-INF/content/privateScmRedirect.jsp | 5 +- .../src/main/webapp/WEB-INF/content/recall.jsp | 5 +- .../src/main/webapp/WEB-INF/content/redirect.jsp | 7 +- .../src/main/webapp/WEB-INF/content/reset.jsp | 3 +- .../src/main/webapp/WEB-INF/content/save.jsp | 3 +- .../src/main/webapp/WEB-INF/content/upload.jsp | 3 +- .../src/main/webapp/WEB-INF/content/uploadForm.jsp | 3 +- .../main/webapp/WEB-INF/content/uploadSuccess.jsp | 3 +- swe-ui-web/src/main/webapp/WEB-INF/web.xml | 2 +- 49 files changed, 489 insertions(+), 347 deletions(-) diff --git a/swe-git/src/main/java/org/nuiton/scmwebeditor/git/GitConnection.java b/swe-git/src/main/java/org/nuiton/scmwebeditor/git/GitConnection.java index 7725c09..398b9e2 100644 --- a/swe-git/src/main/java/org/nuiton/scmwebeditor/git/GitConnection.java +++ b/swe-git/src/main/java/org/nuiton/scmwebeditor/git/GitConnection.java @@ -37,9 +37,8 @@ import org.eclipse.jgit.storage.file.FileRepositoryBuilder; import org.eclipse.jgit.transport.CredentialsProvider; import org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider; import org.eclipse.jgit.treewalk.TreeWalk; +import org.nuiton.scmwebeditor.api.RepositoryNotFoundException; import org.nuiton.scmwebeditor.api.ScmConnection; -import org.nuiton.scmwebeditor.api.ScmNotFoundException; -import org.nuiton.scmwebeditor.api.ScmWebEditorConfig; import org.nuiton.scmwebeditor.api.dto.*; import javax.naming.AuthenticationException; @@ -52,6 +51,9 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedList; +/** + * Implementation of the Git's main features + */ public class GitConnection implements ScmConnection { private static final Log log = LogFactory.getLog(GitConnection.class); @@ -75,6 +77,12 @@ public class GitConnection implements ScmConnection { protected static final String DEFAULT_BRANCH = "master"; + /** + * Creates a new connection to a Git repository + * @param address the address of the Git repository to connect to + * @param pathToLocalRepos the path to the local folder which will store the user's repositories + * @throws IOException if the repository can not be reached + */ public GitConnection(String address, String pathToLocalRepos) throws IOException { if(log.isDebugEnabled()) { @@ -114,7 +122,7 @@ public class GitConnection implements ScmConnection { try { updateRepository(dto.getUsername(), dto.getPassword()); - } catch (ScmNotFoundException e) { + } catch (RepositoryNotFoundException e) { if (log.isErrorEnabled()) { log.error("Error while cloning the repository", e); @@ -286,7 +294,7 @@ public class GitConnection implements ScmConnection { try { updateRepository(dto.getUsername(), dto.getPassword()); - } catch (ScmNotFoundException e) { + } catch (RepositoryNotFoundException e) { if (log.isErrorEnabled()) { log.error("Error while cloning the repository", e); @@ -453,7 +461,7 @@ public class GitConnection implements ScmConnection { try { updateRepository(dto.getUsername(), dto.getPassword()); - } catch (ScmNotFoundException e) { + } catch (RepositoryNotFoundException e) { if (log.isErrorEnabled()) { log.error("Error while cloning the repository", e); @@ -636,7 +644,7 @@ public class GitConnection implements ScmConnection { try { updateRepository(username, password); - } catch (ScmNotFoundException e) { + } catch (RepositoryNotFoundException e) { if (log.isErrorEnabled()) { log.error("Error while cloning the repository", e); @@ -658,7 +666,7 @@ public class GitConnection implements ScmConnection { try { updateRepository(username, password); - } catch (ScmNotFoundException e) { + } catch (RepositoryNotFoundException e) { if (log.isErrorEnabled()) { log.error("Error while cloning the repository", e); @@ -727,8 +735,16 @@ public class GitConnection implements ScmConnection { } + /** + * Updates the repository to the last version by a clone or a pull command + * @param username the username to use to connect to the repository + * @param password the password to use to connect to the repository + * @throws RepositoryNotFoundException if the repository is not found + * @throws IOException if it is not possible to reach the repository + * @throws AuthenticationException if there is a problem during the authentication process + */ public void updateRepository(String username, String password) - throws ScmNotFoundException, IOException, AuthenticationException { + throws RepositoryNotFoundException, IOException, AuthenticationException { // Cloning the remote repository to a local directory String hashedAddress = addressGit; @@ -803,14 +819,21 @@ public class GitConnection implements ScmConnection { if (log.isErrorEnabled()) { log.error("The repository at address " + addressGit + " doesn't exist"); - throw new ScmNotFoundException("The repository at address " + addressGit + " doesn't exist"); + throw new RepositoryNotFoundException("The repository at address " + addressGit + " doesn't exist"); } } } + /** + * Clones the repository (clone command) + * @param credentials the username and password to use to connect to the repository + * @throws RepositoryNotFoundException if the repository is not found + * @throws IOException if it is not possible to reach the repository + * @throws AuthenticationException if there is a problem during the authentication process + */ protected void cloneRepository(CredentialsProvider credentials) - throws IOException, AuthenticationException, ScmNotFoundException { + throws IOException, AuthenticationException, RepositoryNotFoundException { if (localDirectory.exists()) { FileUtils.deleteDirectory(localDirectory); @@ -837,14 +860,14 @@ public class GitConnection implements ScmConnection { if (e.getMessage().endsWith("500 Internal Server Error")) { throw new AuthenticationException("Can not clone the Git repository: auth failed"); } else { - throw new ScmNotFoundException("Can not find a Git repository at address " + addressGit, e); + throw new RepositoryNotFoundException("Can not find a Git repository at address " + addressGit, e); } } catch (GitAPIException e) { FileUtils.deleteDirectory(localDirectory); if (log.isErrorEnabled()) { log.error("Can't clone the remote repository", e); } - throw new ScmNotFoundException("Can not find a Git repository at address " + addressGit, e); + throw new RepositoryNotFoundException("Can not find a Git repository at address " + addressGit, e); } if (log.isDebugEnabled()) { diff --git a/swe-git/src/main/java/org/nuiton/scmwebeditor/git/GitProvider.java b/swe-git/src/main/java/org/nuiton/scmwebeditor/git/GitProvider.java index 9bdabe4..4aeadcb 100644 --- a/swe-git/src/main/java/org/nuiton/scmwebeditor/git/GitProvider.java +++ b/swe-git/src/main/java/org/nuiton/scmwebeditor/git/GitProvider.java @@ -37,10 +37,14 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; +/** + * Implementation of the Git's specific features + */ public class GitProvider implements ScmProvider { private static final Log log = LogFactory.getLog(GitProvider.class); + /** the repository's address */ protected String address; diff --git a/swe-scm-api/src/main/java/org/nuiton/scmwebeditor/api/ScmUser.java b/swe-scm-api/src/main/java/org/nuiton/scmwebeditor/api/RepositoryNotFoundException.java similarity index 57% copy from swe-scm-api/src/main/java/org/nuiton/scmwebeditor/api/ScmUser.java copy to swe-scm-api/src/main/java/org/nuiton/scmwebeditor/api/RepositoryNotFoundException.java index 71ec796..7a07784 100644 --- a/swe-scm-api/src/main/java/org/nuiton/scmwebeditor/api/ScmUser.java +++ b/swe-scm-api/src/main/java/org/nuiton/scmwebeditor/api/RepositoryNotFoundException.java @@ -2,49 +2,35 @@ * #%L * ScmWebEditor * %% - * Copyright (C) 2009 - 2014 CodeLutin + * Copyright (C) 2009 - 2015 CodeLutin * %% * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public + * + * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-3.0.html>. * #L% */ package org.nuiton.scmwebeditor.api; -public class ScmUser { - - protected String username; - - protected String password; - - public ScmUser(String username, String password) { - setUsername(username); - setPassword(password); - } - - public void setUsername(String username) { - this.username = username; - } - - public String getUsername() { - return username; - } +/** + * An exception called when the requested SCM doesn't exist + */ +public class RepositoryNotFoundException extends Exception { - public void setPassword(String password) { - this.password = password; + public RepositoryNotFoundException(String message) { + super(message); } - public String getPassword() { - return password; + public RepositoryNotFoundException(String message, Throwable cause) { + super(message, cause); } } diff --git a/swe-scm-api/src/main/java/org/nuiton/scmwebeditor/api/ScmConnection.java b/swe-scm-api/src/main/java/org/nuiton/scmwebeditor/api/ScmConnection.java index a8d851b..a6fb165 100644 --- a/swe-scm-api/src/main/java/org/nuiton/scmwebeditor/api/ScmConnection.java +++ b/swe-scm-api/src/main/java/org/nuiton/scmwebeditor/api/ScmConnection.java @@ -27,7 +27,7 @@ import javax.naming.AuthenticationException; import java.io.File; /** - * An interface which the SCM classes have to implement + * An interface which gives the SCMs main features */ public interface ScmConnection { @@ -61,6 +61,7 @@ public interface ScmConnection { * @param username the user's login for the SCM * @param password the user's password for the SCM * @return a String which contains the file's content + * @throws AuthenticationException if there is a problem during the authentication process */ File getFileContent(String path, String username, String password) throws AuthenticationException; @@ -71,6 +72,7 @@ public interface ScmConnection { * @param username the user's login for the SCM * @param password the user's password for the SCM * @return a String which contains the head revision's number + * @throws AuthenticationException if there is a problem during the authentication process */ String getHeadRevisionNumber(String path, String username, String password) throws AuthenticationException; diff --git a/swe-scm-api/src/main/java/org/nuiton/scmwebeditor/api/ScmNotFoundException.java b/swe-scm-api/src/main/java/org/nuiton/scmwebeditor/api/ScmNotFoundException.java deleted file mode 100644 index b5ae0bd..0000000 --- a/swe-scm-api/src/main/java/org/nuiton/scmwebeditor/api/ScmNotFoundException.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.nuiton.scmwebeditor.api; - -/** - * An exception called when the requested SCM doesn't exist - */ -public class ScmNotFoundException extends Exception { - - public ScmNotFoundException(String message) { - super(message); - } - - public ScmNotFoundException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/swe-scm-api/src/main/java/org/nuiton/scmwebeditor/api/ScmProvider.java b/swe-scm-api/src/main/java/org/nuiton/scmwebeditor/api/ScmProvider.java index 8182654..f7961da 100644 --- a/swe-scm-api/src/main/java/org/nuiton/scmwebeditor/api/ScmProvider.java +++ b/swe-scm-api/src/main/java/org/nuiton/scmwebeditor/api/ScmProvider.java @@ -23,6 +23,9 @@ package org.nuiton.scmwebeditor.api; import java.util.List; +/** + * An interface which allows to know and to use the specific features of each SCM + */ public interface ScmProvider { /** diff --git a/swe-scm-api/src/main/java/org/nuiton/scmwebeditor/api/ScmWebEditorConfig.java b/swe-scm-api/src/main/java/org/nuiton/scmwebeditor/api/ScmWebEditorConfig.java index 0d85170..1f7efc7 100644 --- a/swe-scm-api/src/main/java/org/nuiton/scmwebeditor/api/ScmWebEditorConfig.java +++ b/swe-scm-api/src/main/java/org/nuiton/scmwebeditor/api/ScmWebEditorConfig.java @@ -2,7 +2,7 @@ * #%L * ScmWebEditor * %% - * Copyright (C) 2009 - 2014 CodeLutin + * Copyright (C) 2009 - 2015 CodeLutin * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -31,14 +31,22 @@ import java.util.List; import java.util.Map; import java.util.Properties; +/** + * Allows to access to the configured options + */ public class ScmWebEditorConfig { private static final Log log = LogFactory.getLog(ScmWebEditorConfig.class); - + /** this application's configuration */ protected static ApplicationConfig config; + /** + * Gives the configuration options for this application + * @param args the arguments to use when creating the configuration + * @return the configuration to use for this application + */ public static ApplicationConfig getConfig(String... args) { if (config == null) { synchronized (ScmWebEditorConfig.class) { @@ -87,6 +95,10 @@ public class ScmWebEditorConfig { return providers; } + public static String getKey() { + return getConfig().getOption(ScmWebEditorConfigOption.COOKIES_PRIVATE_KEY.getKey()); + } + /** * Gives an instance of the provider for the given SCM type * @param scmType the type of SCM to use @@ -133,9 +145,5 @@ public class ScmWebEditorConfig { return provider; } - public static String getKey() { - return getConfig().getOption(ScmWebEditorConfigOption.COOKIES_PRIVATE_KEY.getKey()); - } - } diff --git a/swe-scm-api/src/main/java/org/nuiton/scmwebeditor/api/ScmWebEditorConfigOption.java b/swe-scm-api/src/main/java/org/nuiton/scmwebeditor/api/ScmWebEditorConfigOption.java index c0fb6df..111f042 100644 --- a/swe-scm-api/src/main/java/org/nuiton/scmwebeditor/api/ScmWebEditorConfigOption.java +++ b/swe-scm-api/src/main/java/org/nuiton/scmwebeditor/api/ScmWebEditorConfigOption.java @@ -2,7 +2,7 @@ * #%L * ScmWebEditor * %% - * Copyright (C) 2009 - 2014 CodeLutin + * Copyright (C) 2009 - 2015 CodeLutin * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -24,6 +24,9 @@ package org.nuiton.scmwebeditor.api; import org.nuiton.config.ApplicationConfig; import org.nuiton.config.ConfigOptionDef; +/** + * Definition of the configuration to use + */ public enum ScmWebEditorConfigOption implements ConfigOptionDef { CONFIG_FILE(ApplicationConfig.CONFIG_FILE_NAME, "The file name", "scmwebeditor.properties", String.class, false, false), diff --git a/swe-scm-api/src/main/java/org/nuiton/scmwebeditor/api/dto/BrowseResultDto.java b/swe-scm-api/src/main/java/org/nuiton/scmwebeditor/api/dto/BrowseResultDto.java index 2ae5715..679f2d2 100644 --- a/swe-scm-api/src/main/java/org/nuiton/scmwebeditor/api/dto/BrowseResultDto.java +++ b/swe-scm-api/src/main/java/org/nuiton/scmwebeditor/api/dto/BrowseResultDto.java @@ -30,23 +30,12 @@ public class BrowseResultDto { /** the name of the selected branch on the SCM */ protected String selectedBranch; - /** the number of files in the current folder */ - protected int numberOfFiles; - public BrowseResultDto() { files = new LinkedList<String>(); directories = new HashMap<String, String>(); } - public int getNumberOfFiles() { - return numberOfFiles; - } - - public void setNumberOfFiles(int numberOfFiles) { - this.numberOfFiles = numberOfFiles; - } - public String getError() { return error; } diff --git a/swe-svn/src/main/java/org/nuiton/scmwebeditor/svn/SvnConnection.java b/swe-svn/src/main/java/org/nuiton/scmwebeditor/svn/SvnConnection.java index 1058998..71d46f7 100644 --- a/swe-svn/src/main/java/org/nuiton/scmwebeditor/svn/SvnConnection.java +++ b/swe-svn/src/main/java/org/nuiton/scmwebeditor/svn/SvnConnection.java @@ -25,7 +25,6 @@ import org.apache.commons.io.FileUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.nuiton.scmwebeditor.api.ScmConnection; -import org.nuiton.scmwebeditor.api.ScmWebEditorConfig; import org.nuiton.scmwebeditor.api.dto.*; import org.nuiton.util.FileUtil; import org.tmatesoft.svn.core.*; @@ -41,6 +40,9 @@ import javax.naming.AuthenticationException; import java.io.*; import java.util.Collection; +/** + * Implementation of the SVN's main features + */ public class SvnConnection implements ScmConnection { @@ -177,7 +179,6 @@ public class SvnConnection implements ScmConnection { } return resultDto; } - resultDto.setNumberOfFiles(0); listEntries(repository, "", dto.getAddress(), resultDto); if (log.isDebugEnabled()) { log.debug("Number of file : " + resultDto.getFiles().size()); diff --git a/swe-svn/src/main/java/org/nuiton/scmwebeditor/svn/SvnProvider.java b/swe-svn/src/main/java/org/nuiton/scmwebeditor/svn/SvnProvider.java index bfc14b2..9615068 100644 --- a/swe-svn/src/main/java/org/nuiton/scmwebeditor/svn/SvnProvider.java +++ b/swe-svn/src/main/java/org/nuiton/scmwebeditor/svn/SvnProvider.java @@ -33,11 +33,17 @@ import org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryFactoryImpl; import java.util.List; +/** + * Implementation of the SVN's specific features + */ public class SvnProvider implements ScmProvider { private static final Log log = LogFactory.getLog(SvnProvider.class); + /** + * Initialization of the SVN features + */ public SvnProvider() { SVNRepositoryFactoryImpl.setup(); diff --git a/swe-scm-api/src/main/java/org/nuiton/scmwebeditor/api/ScmSession.java b/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/ScmSession.java similarity index 61% rename from swe-scm-api/src/main/java/org/nuiton/scmwebeditor/api/ScmSession.java rename to swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/ScmSession.java index f54c7d1..ce2ccda 100644 --- a/swe-scm-api/src/main/java/org/nuiton/scmwebeditor/api/ScmSession.java +++ b/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/ScmSession.java @@ -2,7 +2,7 @@ * #%L * ScmWebEditor * %% - * Copyright (C) 2009 - 2014 CodeLutin + * Copyright (C) 2009 - 2015 CodeLutin * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -19,32 +19,53 @@ * <http://www.gnu.org/licenses/lgpl-3.0.html>. * #L% */ -package org.nuiton.scmwebeditor.api; +package org.nuiton.scmwebeditor.uiweb; import java.util.HashMap; import java.util.Map; +/** + * Allows to manage sessions on a SCM + */ public class ScmSession { + /** list of all the users */ protected Map<String, ScmUser> scmUsers; + public Map<String, ScmUser> getScmUsers() { return scmUsers; } + + + /** + * Constructor which makes a new map of users + */ public ScmSession() { scmUsers = new HashMap<String, ScmUser>(); } - public Map<String, ScmUser> getScmUsers() { - return scmUsers; - } - + /** + * Adds a user to the list of users + * @param address the repository's address + * @param login the username to use to connect to the repository + * @param password the password to use to connect to the repository + */ public void addScmUser(String address, String login, String password) { scmUsers.put(address, new ScmUser(login, password)); } + /** + * Removes a user from the list of users + * @param address the repository's address + */ public void delScmUser(String address) { scmUsers.remove(address); } + /** + * Gives the username related to the given repository + * @param url the repository's address + * @return the known username for the repository + */ public String getUsername(String url) { if (scmUsers.containsKey(url)) { return scmUsers.get(url).getUsername(); @@ -54,6 +75,11 @@ public class ScmSession { } + /** + * Gives the password related to the given repository + * @param url the repository's address + * @return the known password for the repository + */ public String getPassword(String url) { if (scmUsers.containsKey(url)) { return scmUsers.get(url).getPassword(); diff --git a/swe-scm-api/src/main/java/org/nuiton/scmwebeditor/api/ScmUser.java b/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/ScmUser.java similarity index 78% rename from swe-scm-api/src/main/java/org/nuiton/scmwebeditor/api/ScmUser.java rename to swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/ScmUser.java index 71ec796..0f7629c 100644 --- a/swe-scm-api/src/main/java/org/nuiton/scmwebeditor/api/ScmUser.java +++ b/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/ScmUser.java @@ -2,7 +2,7 @@ * #%L * ScmWebEditor * %% - * Copyright (C) 2009 - 2014 CodeLutin + * Copyright (C) 2009 - 2015 CodeLutin * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -19,14 +19,25 @@ * <http://www.gnu.org/licenses/lgpl-3.0.html>. * #L% */ -package org.nuiton.scmwebeditor.api; +package org.nuiton.scmwebeditor.uiweb; +/** + * The authentication information related to an user + */ public class ScmUser { + /** the user's username */ protected String username; + /** the user's password */ protected String password; + + /** + * Constructor which makes a new user + * @param username the user's username + * @param password the user's password + */ public ScmUser(String username, String password) { setUsername(username); setPassword(password); diff --git a/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/ScmWebEditorApplicationListener.java b/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/ScmWebEditorApplicationListener.java index 9e2e510..f89d5f8 100644 --- a/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/ScmWebEditorApplicationListener.java +++ b/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/ScmWebEditorApplicationListener.java @@ -2,7 +2,7 @@ * #%L * ScmWebEditor * %% - * Copyright (C) 2009 - 2014 CodeLutin + * Copyright (C) 2009 - 2015 CodeLutin * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -29,6 +29,9 @@ import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; import java.util.Locale; +/** + * Initialization of the application + */ public class ScmWebEditorApplicationListener implements ServletContextListener { @Override diff --git a/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/SweSessionListener.java b/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/SweSessionListener.java index 9badeca..54335bb 100644 --- a/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/SweSessionListener.java +++ b/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/SweSessionListener.java @@ -1,3 +1,25 @@ +/* + * #%L + * ScmWebEditor + * %% + * Copyright (C) 2009 - 2015 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ + package org.nuiton.scmwebeditor.uiweb; import org.apache.commons.io.FileUtils; @@ -10,6 +32,9 @@ import javax.servlet.http.HttpSessionListener; import java.io.File; import java.io.IOException; +/** + * Manages creation and deletion of HTTP sessions + */ public class SweSessionListener implements HttpSessionListener { private static final Log log = LogFactory.getLog(SweSessionListener.class); diff --git a/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/AbstractScmWebEditorAction.java b/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/AbstractScmWebEditorAction.java index 15ff7ca..80e595a 100644 --- a/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/AbstractScmWebEditorAction.java +++ b/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/AbstractScmWebEditorAction.java @@ -2,7 +2,7 @@ * #%L * ScmWebEditor * %% - * Copyright (C) 2009 - 2014 CodeLutin + * Copyright (C) 2009 - 2015 CodeLutin * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -31,7 +31,7 @@ import org.apache.tika.exception.TikaException; import org.apache.tika.metadata.Metadata; import org.apache.tika.parser.AutoDetectParser; import org.apache.tika.sax.BodyContentHandler; -import org.nuiton.scmwebeditor.api.ScmSession; +import org.nuiton.scmwebeditor.uiweb.ScmSession; import org.nuiton.web.struts2.BaseAction; import org.xml.sax.SAXException; @@ -43,28 +43,30 @@ import java.util.Map; import java.util.Properties; /** - * User: chemit - * Date: 24 nov. 2009 - * Time: 21:24:39 + * Base for all the other actions */ public abstract class AbstractScmWebEditorAction extends BaseAction implements ServletRequestAware { + private static final Log log = LogFactory.getLog(AbstractScmWebEditorAction.class); + + public static final String AUTH_ERROR = "authError"; public static final String ERROR_PATH = "errorPath"; + /** the session which stores all the users' authentication information */ protected Map<String, Object> session; + /** the HTTP request received by the server */ protected transient HttpServletRequest request; + /** the name of the SCM to use for the given repository */ protected String scmType; private static final long serialVersionUID = 1L; final static protected String CONTEXT_ACTION_KEY = "action"; - private static final Log log = LogFactory.getLog(AbstractScmWebEditorAction.class); - //TODO-TC200924 : uniformize all this different parameter and attribute, this is a bit messy... protected static final String PARAMETER_ADDRESS = "address"; @@ -154,7 +156,7 @@ public abstract class AbstractScmWebEditorAction extends BaseAction implements S /** * Convert all files to UTF-8. * - * @param files fiels to convert + * @param files files to convert */ protected void convertToUnicode(File... files) { @@ -348,6 +350,13 @@ public abstract class AbstractScmWebEditorAction extends BaseAction implements S return scmSession; } + /** + * Reads the information in the session to give the username and the password for a given repository if necessary + * @param repositoryUUID the ID of the repository to connect to + * @param username the currently known username: the session won't be read if it is has a value + * @param pw the currently known password: the session won't be read if it is has a value + * @return the username to use at position [0] ; the password to use at position [1] + */ protected String[] getUsernamePwFromSession(String repositoryUUID, String username, String pw) { String[] usernamePw = new String[2]; diff --git a/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/BrowseAction.java b/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/BrowseAction.java index 4ebcae9..32a4aa2 100644 --- a/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/BrowseAction.java +++ b/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/BrowseAction.java @@ -2,7 +2,7 @@ * #%L * ScmWebEditor * %% - * Copyright (C) 2009 - 2011 CodeLutin + * Copyright (C) 2009 - 2015 CodeLutin * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -41,7 +41,9 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; - +/** + * Allows to browse through a repository + */ public class BrowseAction extends AbstractScmWebEditorAction implements ServletResponseAware { private static final long serialVersionUID = 4432027215087932750L; @@ -50,48 +52,43 @@ public class BrowseAction extends AbstractScmWebEditorAction implements ServletR public static final String ROOT = "root"; + /** the repository's address */ protected String address; + /** the username to connect with */ protected String username; + /** the password to connect with */ protected String pw; + /** equals true when an error occured */ protected boolean error; - protected int numberOfFiles; - - protected String info; - - protected String list; - + /** the nodes for the tree showing the repository's files and directories */ protected List<TreeNode> nodes = new ArrayList<TreeNode>(); + /** the SCM's identifier */ protected String id = ""; - protected List<String> branches; - + /** the selected branch's name */ protected String selectedBranch; + /** the name of the head branch on the SCM */ protected String headBranchName; + /** equals true if the SCM is able to use branches */ protected boolean scmSupportsBranches; + /** the HTTP response to send to the client */ protected transient HttpServletResponse response; + public boolean getError() { return error; } public void setError(boolean error) { this.error = error; } - public String getList() { return list; } - - public void setList(String list) { this.list = list; } - - public String getInfo() { return info; } - public String getAddress() { return address; } - public void setNumberOfFiles(int numberOfFiles) { this.numberOfFiles = numberOfFiles; } - public void setAddress(String address) { this.address = address; } public String getUsername() { return username; } @@ -104,10 +101,6 @@ public class BrowseAction extends AbstractScmWebEditorAction implements ServletR public String getId() { return id; } - public int getNumberOfFiles() { return numberOfFiles; } - - public List<String> getBranches() { return branches; } - public String getHeadBranchName() { return headBranchName; } public String getSelectedBranch() { return selectedBranch; } @@ -120,6 +113,15 @@ public class BrowseAction extends AbstractScmWebEditorAction implements ServletR public void setScmSupportsBranches(boolean scmSupportsBranches) { this.scmSupportsBranches = scmSupportsBranches; } + public List<TreeNode> getNodes() { return nodes; } + + public void setId(String id) { this.id = id; } + + + /** + * Execution of the browse action + * @return a code interpreted in the file struts.xml + */ public String execute() { if (log.isDebugEnabled()) { @@ -170,7 +172,6 @@ public class BrowseAction extends AbstractScmWebEditorAction implements ServletR if (resultDto.getSelectedBranch() != null) { selectedBranch = resultDto.getSelectedBranch(); } - numberOfFiles = resultDto.getNumberOfFiles(); String dtoError = resultDto.getError(); @@ -256,14 +257,6 @@ public class BrowseAction extends AbstractScmWebEditorAction implements ServletR return SUCCESS; } - public List<TreeNode> getNodes() { - return nodes; - } - - public void setId(String id) { - this.id = id; - } - @Override public void setServletResponse(HttpServletResponse response) { diff --git a/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/DetectScmAction.java b/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/DetectScmAction.java index 740e838..1ec9199 100644 --- a/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/DetectScmAction.java +++ b/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/DetectScmAction.java @@ -29,12 +29,17 @@ import org.nuiton.scmwebeditor.api.ScmWebEditorConfig; import java.util.List; +/** + * Detection of the SCM to use following the repository's address + */ public class DetectScmAction extends AbstractScmWebEditorAction { private static final Log log = LogFactory.getLog(DetectScmAction.class); + /** the repository's address */ protected String address; + /** the detected SCM for the given address */ protected String detectedScm; @@ -47,6 +52,10 @@ public class DetectScmAction extends AbstractScmWebEditorAction { public void setDetectedScm(String detectedScm) { this.detectedScm = detectedScm; } + /** + * Execution of the detect SCM action + * @return a code interpreted in the file struts.xml + */ public String execute() { List<String> supportedScms = Lists.newArrayList(ScmWebEditorConfig.getProviders().keySet()); @@ -64,6 +73,10 @@ public class DetectScmAction extends AbstractScmWebEditorAction { detectedScm = null; + if (log.isDebugEnabled()) { + log.debug("Detected SCM '" + detectedScm + "' for address " + address); + } + return SUCCESS; } } diff --git a/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/EditAction.java b/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/EditAction.java index b71fcd5..85a46b7 100644 --- a/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/EditAction.java +++ b/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/EditAction.java @@ -1,6 +1,26 @@ +/* + * #%L + * ScmWebEditor + * %% + * Copyright (C) 2009 - 2015 CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. + * #L% + */ package org.nuiton.scmwebeditor.uiweb.actions; - import org.apache.commons.io.FileUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -17,30 +37,33 @@ import java.io.File; import java.io.IOException; import java.util.LinkedList; +/** + * Allows to edit a file + */ public class EditAction extends ScmWebEditorMainAction { private static final Log log = LogFactory.getLog(EditAction.class); + /** the name of the selected branch */ protected String selectedBranch; + /** equals true if the SCM is able to use branches */ protected boolean scmSupportsBranches; - public String getSelectedBranch() { - return selectedBranch; - } - public void setSelectedBranch(String selectedBranch) { - this.selectedBranch = selectedBranch; - } + public String getSelectedBranch() { return selectedBranch; } - public boolean isScmSupportsBranches() { - return scmSupportsBranches; - } + public void setSelectedBranch(String selectedBranch) { this.selectedBranch = selectedBranch; } + + public boolean isScmSupportsBranches() { return scmSupportsBranches; } + + public void setScmSupportsBranches(boolean scmSupportsBranches) { this.scmSupportsBranches = scmSupportsBranches; } - public void setScmSupportsBranches(boolean scmSupportsBranches) { - this.scmSupportsBranches = scmSupportsBranches; - } + /** + * Execution of the edit action + * @return a code interpreted in the file struts.xml + */ public String execute() { HttpSession session = request.getSession(); diff --git a/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/ListBranchesAction.java b/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/ListBranchesAction.java index b21dad0..fe84486 100644 --- a/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/ListBranchesAction.java +++ b/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/ListBranchesAction.java @@ -29,18 +29,26 @@ import org.nuiton.scmwebeditor.api.ScmWebEditorConfig; import java.util.List; +/** + * Gives a list of the existing branches on the repository + */ public class ListBranchesAction extends AbstractScmWebEditorAction { private static final Log log = LogFactory.getLog(ListBranchesAction.class); + /** the repository's address */ protected String address; + /** equals true if the SCM is able to use branches */ protected boolean scmSupportsBranches; + /** list of the existing branches on the repository */ protected List<String> branches; + /** the username to use to connect to the repository */ protected String username; + /** the password to use to connect to the repository */ protected String pw; @@ -64,6 +72,11 @@ public class ListBranchesAction extends AbstractScmWebEditorAction { public void setPw(String pw) { this.pw = pw; } + + /** + * Execution of the list branches action + * @return a code interpreted in the file struts.xml + */ public String execute() { if (username == null) { diff --git a/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/LogoutAction.java b/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/LogoutAction.java index 1b9f065..e5e7a84 100644 --- a/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/LogoutAction.java +++ b/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/LogoutAction.java @@ -2,7 +2,7 @@ * #%L * ScmWebEditor * %% - * Copyright (C) 2009 - 2014 CodeLutin + * Copyright (C) 2009 - 2015 CodeLutin * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -34,37 +34,41 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.File; +/** + * Ends the user session on the repository + */ public class LogoutAction extends AbstractScmWebEditorAction implements ServletRequestAware, ServletResponseAware { private static final long serialVersionUID = 6937086747942656369L; private static final Log log = LogFactory.getLog(LogoutAction.class); + /** the repository's address */ protected String address; + /** the URL to the repository's root */ protected String projectUrl; + /** the HTTP request sent to the server */ protected transient HttpServletRequest request; + /** the HTTP response to send to the client */ protected transient HttpServletResponse response; - public void setAddress(String address) { - this.address = address; - } + public void setAddress(String address) { this.address = address; } - public String getAddress() { - return address; - } + public String getAddress() { return address; } - public String getProjectUrl() { - return projectUrl; - } + public String getProjectUrl() { return projectUrl; } + + public void setProjectUrl(String projectUrl) { this.projectUrl = projectUrl; } - public void setProjectUrl(String projectUrl) { - this.projectUrl = projectUrl; - } + /** + * Execution of the logout action + * @return a code interpreted in the file struts.xml + */ public String execute() { String sessionId = request.getSession().getId(); diff --git a/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/PreviewAction.java b/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/PreviewAction.java index c315b9d..4568f17 100644 --- a/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/PreviewAction.java +++ b/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/PreviewAction.java @@ -2,7 +2,7 @@ * #%L * ScmWebEditor * %% - * Copyright (C) 2009 - 2014 CodeLutin + * Copyright (C) 2009 - 2015 CodeLutin * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -31,6 +31,9 @@ import org.nuiton.jrst.legacy.JRSTReader; import javax.servlet.http.HttpServletRequest; import java.io.StringReader; +/** + * Gives a preview of the edited RST file + */ public class PreviewAction extends AbstractScmWebEditorAction implements ServletRequestAware { /** serialVersionUID. */ @@ -38,29 +41,28 @@ public class PreviewAction extends AbstractScmWebEditorAction implements Servlet private static final Log log = LogFactory.getLog(PreviewAction.class); + /** the HTTP request sent to the server */ protected transient HttpServletRequest request; - protected String XMLResponse; + /** the HTML code to display for the preview */ + protected String htmlPreview; + /** the RST text to preview */ protected String newText; - public String getNewText() { - return newText; - } + public String getNewText() { return newText; } - public void setNewText(String newText) { - this.newText = newText; - } + public void setNewText(String newText) { this.newText = newText; } - public String getXMLResponse() { - return XMLResponse; - } + public String getHtmlPreview() { return htmlPreview; } + public void setHtmlPreview(String htmlPreview) { this.htmlPreview = htmlPreview; } - public void setXMLResponse(String XMLResponse) { - this.XMLResponse = XMLResponse; - } + /** + * Execution of the preview action + * @return a code interpreted in the file struts.xml + */ public String execute() { if (log.isDebugEnabled()) { @@ -70,13 +72,13 @@ public class PreviewAction extends AbstractScmWebEditorAction implements Servlet if (log.isDebugEnabled()) { log.debug(newText); } - XMLResponse = ""; + htmlPreview = ""; //Using jrst to generate html document try { JRSTReader jrst = new JRSTReader(); Document doc = jrst.read(new StringReader(newText)); Document generatedDoc = JRST.generateXml(doc, JRST.TYPE_HTML); - XMLResponse = generatedDoc.asXML(); + htmlPreview = generatedDoc.asXML(); if (log.isDebugEnabled()) { log.debug("RST generate"); @@ -86,7 +88,7 @@ public class PreviewAction extends AbstractScmWebEditorAction implements Servlet if (log.isWarnEnabled()) { log.warn("RST generate fail", eee); } - XMLResponse = "<h4>Parsing error, please read RST specification<h4>"; + htmlPreview = "<h4>Parsing error, please read RST specification<h4>"; } return SUCCESS; diff --git a/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/ResetAction.java b/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/ResetAction.java index db27f98..6ddee5d 100644 --- a/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/ResetAction.java +++ b/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/ResetAction.java @@ -2,7 +2,7 @@ * #%L * ScmWebEditor * %% - * Copyright (C) 2009 - 2014 CodeLutin + * Copyright (C) 2009 - 2015 CodeLutin * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -32,49 +32,50 @@ import javax.naming.AuthenticationException; import java.io.File; import java.io.IOException; +/** + * Deletes all the changes made to the edited file + */ public class ResetAction extends AbstractScmWebEditorAction { private static final long serialVersionUID = -1154924826535371319L; private static final Log log = LogFactory.getLog(ResetAction.class); + /** the file's content in the last revision */ protected String lastRevision; + /** the number of the current revision */ protected String numRevision; + /** the repository's address */ protected String address; + /** the username to use to connect to the repository */ protected String username; + /** the password to use to connect to the repository */ protected String pw; + /** information about an error if one occurs */ protected String error; - public String getLastRevision() { - return lastRevision; - } + public String getLastRevision() { return lastRevision; } - public String getNumRevision() { - return numRevision; - } + public String getNumRevision() { return numRevision; } - public void setAddress(String address) { - this.address = address; - } + public void setAddress(String address) { this.address = address; } - public void setUsername(String username) { - this.username = username; - } + public void setUsername(String username) { this.username = username; } - public void setPw(String pw) { - this.pw = pw; - } + public void setPw(String pw) { this.pw = pw; } - public String getError() { - return error; - } + public String getError() { return error; } + /** + * Execution of the reset action + * @return a code interpreted in the file struts.xml + */ public String execute() { String sessionId = request.getSession().getId(); diff --git a/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/SaveAction.java b/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/SaveAction.java index f28d668..3564341 100644 --- a/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/SaveAction.java +++ b/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/SaveAction.java @@ -2,7 +2,7 @@ * #%L * ScmWebEditor * %% - * Copyright (C) 2009 - 2011 CodeLutin + * Copyright (C) 2009 - 2015 CodeLutin * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -26,32 +26,35 @@ import org.apache.commons.logging.LogFactory; import java.util.Date; - +/** + * Saves the edited file without quitting + */ public class SaveAction extends ScmWebEditorCommitAction { private static final Log log = LogFactory.getLog(SaveAction.class); private static final long serialVersionUID = -115627369699637253L; + protected static final String USELESS_SAVE = "uselessSave"; + + /** the result of the commit action */ protected String result; + /** the saving date */ protected Date date; - protected static final String USELESS_SAVE = "uselessSave"; - public String getResult() { - return result; - } + public String getResult() { return result; } - public void setResult(String result) { - this.result = result; - } + public void setResult(String result) { this.result = result; } - public Date getDate() { - return date; - } + public Date getDate() { return date; } + /** + * Execution of the save action + * @return a code interpreted in the file struts.xml + */ public String execute() { if (log.isDebugEnabled()) { diff --git a/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/ScmWebEditorCommitAction.java b/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/ScmWebEditorCommitAction.java index 7d5f6e9..2525968 100644 --- a/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/ScmWebEditorCommitAction.java +++ b/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/ScmWebEditorCommitAction.java @@ -2,7 +2,7 @@ * #%L * ScmWebEditor * %% - * Copyright (C) 2009 - 2011 CodeLutin + * Copyright (C) 2009 - 2015 CodeLutin * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -43,182 +43,149 @@ import javax.servlet.http.HttpSession; import java.io.File; import java.io.StringReader; - +/** + * Commits all the changes to the remote repository + */ public class ScmWebEditorCommitAction extends AbstractScmWebEditorAction implements ServletRequestAware, ServletResponseAware { + public static final String FILE_MODIFY = "fileModify"; + private static final long serialVersionUID = 6374273568146287730L; private static final Log log = LogFactory.getLog(ScmWebEditorCommitAction.class); - public static final String FILE_MODIFY = "fileModify"; - + /** the new file content */ protected String newText; + /** a message to describe the commit */ protected String commitMessage; + /** the old file content */ protected String origText; + /** the username to use to connect to the repository */ protected String username; + /** the password to use to connect to the repository */ protected String pw; + /** the repository's address */ protected String address; + /** the last revision's file content */ protected String lastText; + /** the edited file's format */ protected String format; + /** the URL to the root of the repository */ protected String projectUrl; + /** the differences between the current content and the last revision's content */ protected String diff; + /** the name of the person who made the last commit */ protected String headCommiter; + /** the file's MIME type */ protected String mimeType; + /** equals true to force the commit */ protected boolean force; + /** equals true if the authentication information has to be saved in a cookie */ protected boolean saveCookie; + /** equals true if there has been a problem during the authentication process */ protected boolean badLogin; + /** the number of the current revision */ protected String numRevision; + /** the HTTP request sent to the server */ protected transient HttpServletRequest request; + /** the HTTP response to send to the client */ protected transient HttpServletResponse response; - public String getCommitMessage() { - return commitMessage; - } + public String getCommitMessage() { return commitMessage; } - public void setCommitMessage(String commitMessage) { - this.commitMessage = commitMessage; - } + public void setCommitMessage(String commitMessage) { this.commitMessage = commitMessage; } - public String getNewText() { - return newText; - } + public String getNewText() { return newText; } - public String getFormat() { - return format; - } + public void setNewText(String newText) { this.newText = newText; } - public void setFormat(String format) { - this.format = format; - } + public String getFormat() { return format; } - public void setNewText(String newText) { - this.newText = newText; - } + public void setFormat(String format) { this.format = format; } - public String getOrigText() { - return origText; - } + public String getOrigText() { return origText; } - public void setOrigText(String origText) { - this.origText = origText; - } + public void setOrigText(String origText) { this.origText = origText; } - public String getUsername() { - return username; - } + public String getUsername() { return username; } - public void setUsername(String username) { - this.username = username; - } + public void setUsername(String username) { this.username = username; } - public String getPw() { - return pw; - } + public String getPw() { return pw; } - public void setPw(String pw) { - this.pw = pw; - } + public void setPw(String pw) { this.pw = pw; } - public String getAddress() { - return address; - } + public String getAddress() { return address; } - public void setAddress(String address) { - this.address = address; - } + public void setAddress(String address) { this.address = address; } - public String getLastText() { - return lastText; - } + public String getLastText() { return lastText; } - public void setLastText(String lastText) { - this.lastText = lastText; - } - - public String getProjectUrl() { - return projectUrl; - } + public void setLastText(String lastText) { this.lastText = lastText; } + public String getProjectUrl() { return projectUrl; } - public void setProjectUrl(String projectUrl) { - this.projectUrl = projectUrl; - } + public void setProjectUrl(String projectUrl) { this.projectUrl = projectUrl; } - public void setForce(boolean force) { - this.force = force; - } + public String getNumRevision() { return numRevision; } + public void setNumRevision(String numRevision) { this.numRevision = numRevision; } - public String getNumRevision() { - return numRevision; - } + public String getDiff() { return diff; } - public void setNumRevision(String numRevision) { - this.numRevision = numRevision; - } + public void setDiff(String diff) { this.diff = diff; } - public String getDiff() { - return diff; - } - - public String getHeadCommiter() { - return headCommiter; - } + public String getHeadCommiter() { return headCommiter; } public void setHeadCommiter(String headCommiter) { this.headCommiter = headCommiter; } - public boolean isSaveCookie() { - return saveCookie; - } + public boolean isSaveCookie() { return saveCookie; } - public void setSaveCookie(boolean saveCookie) { - this.saveCookie = saveCookie; - } + public void setSaveCookie(boolean saveCookie) { this.saveCookie = saveCookie; } - public String getMimeType() { - return mimeType; - } + public String getMimeType() { return mimeType; } - public void setMimeType(String mimeType) { - this.mimeType = mimeType; - } + public void setMimeType(String mimeType) { this.mimeType = mimeType; } public HttpServletRequest getRequest() { return request; } public boolean getForce() { return force; } - public void setDiff(String diff) { this.diff = diff; } - - public void setBadLogin(boolean badLogin) { this.badLogin = badLogin; } + public void setForce(boolean force) { this.force = force; } public String getParameterAddress() { return PARAMETER_ADDRESS; } + public boolean isBadLogin() { return badLogin; } - public boolean isBadLogin() { - return badLogin; - } + public void setBadLogin(boolean badLogin) { this.badLogin = badLogin; } - protected boolean isRstValid(String newText) { + + /** + * Tells whether a RST file has a valid syntax + * @param rstContent the text to check + * @return true if the syntax is valid + */ + protected boolean isRstValid(String rstContent) { try { JRSTReader jrst = new JRSTReader(); - Document doc = jrst.read(new StringReader(newText)); + Document doc = jrst.read(new StringReader(rstContent)); Document generatedDoc = JRST.generateXml(doc, JRST.TYPE_HTML); generatedDoc.asXML(); @@ -236,7 +203,10 @@ public class ScmWebEditorCommitAction extends AbstractScmWebEditorAction impleme } - + /** + * Execution of the commit action + * @return a code interpreted in the file struts.xml + */ public String execute() { System.setProperty("file.encoding", "UTF-8"); diff --git a/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/ScmWebEditorMainAction.java b/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/ScmWebEditorMainAction.java index a0c189a..26e4f4f 100644 --- a/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/ScmWebEditorMainAction.java +++ b/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/ScmWebEditorMainAction.java @@ -2,7 +2,7 @@ * #%L * ScmWebEditor * %% - * Copyright (C) 2009 - 2011 CodeLutin + * Copyright (C) 2009 - 2015 CodeLutin * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -30,7 +30,9 @@ import org.nuiton.scmwebeditor.api.ScmWebEditorConfig; import javax.servlet.http.HttpServletResponse; import java.util.List; - +/** + * The first action called when entering the website + */ public class ScmWebEditorMainAction extends AbstractScmWebEditorAction implements ServletResponseAware { @@ -42,35 +44,46 @@ public class ScmWebEditorMainAction extends AbstractScmWebEditorAction implement public static final String EDIT_PAGE = "editPage"; + /** the repository's address */ protected String address; + /** the URL to the repository's root */ protected String projectUrl; + /** the format of the edited file */ protected String format; + /** the original file's content */ protected String origText; + /** the edited file's MIME type */ protected String mimeType; + /** equals true if the authentication information has to be saved in a cookie */ protected boolean saveCookie = true; + /** equals true if there is a problem during the authentication process */ protected boolean badLogin; + /** the number of the edited file's revision */ protected String numRevision; + /** the username to use to connect to the repository */ protected String username; + /** the password to use to connect to the repository */ protected String pw; + /** the HTTP response to send to the client */ protected transient HttpServletResponse response; + /** the repository's unique identifier */ protected String repositoryId; + /** equals true if the client comes from the login page */ protected boolean fromLoginPage; - public String getMimeType() { - return mimeType; - } + public String getMimeType() { return mimeType; } public String getRepositoryId() { return repositoryId; @@ -139,9 +152,8 @@ public class ScmWebEditorMainAction extends AbstractScmWebEditorAction implement public List<String> getSupportedScmsName() { return Lists.newArrayList(ScmWebEditorConfig.getProviders().keySet()); } /** - * We check whether the parameters are empty - * - * @return + * Checks whether the parameters are empty + * @return true if the parameters are empty */ private boolean testParameters() { if (address == null || address.length() == 0) { @@ -152,9 +164,8 @@ public class ScmWebEditorMainAction extends AbstractScmWebEditorAction implement } /** - * Main method of the class - * - * @return + * Execution of the main action + * @return a code interpreted in the file struts.xml */ @Override public String execute() { diff --git a/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/UploadAction.java b/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/UploadAction.java index 5ecfe50..58bfb74 100644 --- a/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/UploadAction.java +++ b/swe-ui-web/src/main/java/org/nuiton/scmwebeditor/uiweb/actions/UploadAction.java @@ -2,7 +2,7 @@ * #%L * ScmWebEditor * %% - * Copyright (C) 2009 - 2011 CodeLutin + * Copyright (C) 2009 - 2015 CodeLutin * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as @@ -34,6 +34,9 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import java.io.File; +/** + * Uploads a file from the client to the repository + */ public class UploadAction extends AbstractScmWebEditorAction implements ServletRequestAware { private static final long serialVersionUID = 4244339447567114412L; @@ -42,28 +45,40 @@ public class UploadAction extends AbstractScmWebEditorAction implements ServletR public static final String REDIRECT = "redirect"; + /** the file to upload */ protected File upload; + /** the name of the file to upload */ protected String uploadFileName; + /** the type of the file to upload */ protected String uploadContentType; + /** the username to use to connect to the repository */ protected String username; + /** the password to use to connect to the repository */ protected String pw; + /** the repository's address */ protected String address; + /** the URL the root of the repository */ protected String scmRoot; + /** the full path where the file will be uploaded */ protected String fileRoot; + /** the path to the directory where the file will be uploaded to */ protected String scmPath; + /** equals true if there is a problem during the authentication process */ protected boolean badLogin; + /** equals true if an error occurs */ protected boolean error; + /** the HTTP request sent to the server */ protected transient HttpServletRequest request; public File getUpload() { @@ -144,6 +159,11 @@ public class UploadAction extends AbstractScmWebEditorAction implements ServletR public HttpServletRequest getRequest() { return request; } + + /** + * Execution of the upload action + * @return a code interpreted in the file struts.xml + */ public String execute() { HttpSession session = request.getSession(); diff --git a/swe-ui-web/src/main/resources/struts.xml b/swe-ui-web/src/main/resources/struts.xml index d019364..40bc0dd 100644 --- a/swe-ui-web/src/main/resources/struts.xml +++ b/swe-ui-web/src/main/resources/struts.xml @@ -3,7 +3,7 @@ #%L ScmWebEditor %% - Copyright (C) 2009 - 2011 CodeLutin + Copyright (C) 2009 - 2015 CodeLutin %% This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as diff --git a/swe-ui-web/src/main/webapp/WEB-INF/content/badFileRedirect.jsp b/swe-ui-web/src/main/webapp/WEB-INF/content/badFileRedirect.jsp index 9c125a3..f7fb747 100644 --- a/swe-ui-web/src/main/webapp/WEB-INF/content/badFileRedirect.jsp +++ b/swe-ui-web/src/main/webapp/WEB-INF/content/badFileRedirect.jsp @@ -2,7 +2,7 @@ #%L ScmWebEditor %% - Copyright (C) 2009 - 2011 CodeLutin + Copyright (C) 2009 - 2015 CodeLutin %% This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -19,8 +19,7 @@ <http://www.gnu.org/licenses/lgpl-3.0.html>. #L% --%> -<%-- Document : BadFileRedirect Created on : 6 oct. 2009, 15:33:56 -Author : glorieux --%> + <%@page contentType="text/html" pageEncoding="UTF-8" %> <%@ taglib prefix="s" uri="/struts-tags" %> @@ -55,6 +54,6 @@ Author : glorieux --%> <% } %> <s:text name="scm.clickHere"/></a>.</p> -<p>©2004-2014 CodeLutin</p> +<p>©2004-2015 CodeLutin</p> </body> </html> diff --git a/swe-ui-web/src/main/webapp/WEB-INF/content/badRstFile.jsp b/swe-ui-web/src/main/webapp/WEB-INF/content/badRstFile.jsp index 848dfa5..c640e60 100644 --- a/swe-ui-web/src/main/webapp/WEB-INF/content/badRstFile.jsp +++ b/swe-ui-web/src/main/webapp/WEB-INF/content/badRstFile.jsp @@ -2,7 +2,7 @@ #%L ScmWebEditor %% - Copyright (C) 2009 - 2011 CodeLutin + Copyright (C) 2009 - 2015 CodeLutin %% This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -19,6 +19,7 @@ <http://www.gnu.org/licenses/lgpl-3.0.html>. #L% --%> + <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> <%@ taglib prefix="s" uri="/struts-tags" %> diff --git a/swe-ui-web/src/main/webapp/WEB-INF/content/badUseRedirect.jsp b/swe-ui-web/src/main/webapp/WEB-INF/content/badUseRedirect.jsp index e3fdfca..508c8c4 100644 --- a/swe-ui-web/src/main/webapp/WEB-INF/content/badUseRedirect.jsp +++ b/swe-ui-web/src/main/webapp/WEB-INF/content/badUseRedirect.jsp @@ -2,7 +2,7 @@ #%L ScmWebEditor %% - Copyright (C) 2009 - 2011 CodeLutin + Copyright (C) 2009 - 2015 CodeLutin %% This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -19,8 +19,7 @@ <http://www.gnu.org/licenses/lgpl-3.0.html>. #L% --%> -<%-- 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" @@ -54,6 +53,6 @@ Author : glorieux --%> <% } %> click this link</a>.</p> -<p>©2004-2014 CodeLutin</p> +<p>©2004-2015 CodeLutin</p> </body> </html> diff --git a/swe-ui-web/src/main/webapp/WEB-INF/content/browse.jsp b/swe-ui-web/src/main/webapp/WEB-INF/content/browse.jsp index b3bd937..e9c4191 100644 --- a/swe-ui-web/src/main/webapp/WEB-INF/content/browse.jsp +++ b/swe-ui-web/src/main/webapp/WEB-INF/content/browse.jsp @@ -2,7 +2,7 @@ #%L ScmWebEditor %% - Copyright (C) 2009 - 2011 CodeLutin + Copyright (C) 2009 - 2015 CodeLutin %% This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -19,6 +19,7 @@ <http://www.gnu.org/licenses/lgpl-3.0.html>. #L% --%> + <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> diff --git a/swe-ui-web/src/main/webapp/WEB-INF/content/error.jsp b/swe-ui-web/src/main/webapp/WEB-INF/content/error.jsp index 323ddc6..98ad770 100644 --- a/swe-ui-web/src/main/webapp/WEB-INF/content/error.jsp +++ b/swe-ui-web/src/main/webapp/WEB-INF/content/error.jsp @@ -2,7 +2,7 @@ #%L ScmWebEditor %% - Copyright (C) 2009 - 2011 CodeLutin + Copyright (C) 2009 - 2015 CodeLutin %% This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -19,8 +19,7 @@ <http://www.gnu.org/licenses/lgpl-3.0.html>. #L% --%> -<%-- Document : Error Created on : 15 sept. 2009, 12:22:29 Author : -glorieux --%> + <%@page contentType="text/html" pageEncoding="UTF-8" %> <%@ taglib prefix="s" uri="/struts-tags" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" @@ -46,6 +45,6 @@ glorieux --%> <p><s:text name="scm.badUsernameOrPassword"/></p> -<p>©2004-2014 CodeLutin</p> +<p>©2004-2015 CodeLutin</p> </body> </html> diff --git a/swe-ui-web/src/main/webapp/WEB-INF/content/fileModify.jsp b/swe-ui-web/src/main/webapp/WEB-INF/content/fileModify.jsp index 66a1614..9fee2c6 100644 --- a/swe-ui-web/src/main/webapp/WEB-INF/content/fileModify.jsp +++ b/swe-ui-web/src/main/webapp/WEB-INF/content/fileModify.jsp @@ -2,7 +2,7 @@ #%L ScmWebEditor %% - Copyright (C) 2009 - 2011 CodeLutin + Copyright (C) 2009 - 2015 CodeLutin %% This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -19,6 +19,7 @@ <http://www.gnu.org/licenses/lgpl-3.0.html>. #L% --%> + <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> <%@ taglib prefix="s" uri="/struts-tags" %> diff --git a/swe-ui-web/src/main/webapp/WEB-INF/content/index.jsp b/swe-ui-web/src/main/webapp/WEB-INF/content/index.jsp index c1f6e13..03c2b89 100644 --- a/swe-ui-web/src/main/webapp/WEB-INF/content/index.jsp +++ b/swe-ui-web/src/main/webapp/WEB-INF/content/index.jsp @@ -2,7 +2,7 @@ #%L ScmWebEditor %% - Copyright (C) 2009 - 2011 CodeLutin + Copyright (C) 2009 - 2015 CodeLutin %% This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -19,6 +19,7 @@ <http://www.gnu.org/licenses/lgpl-3.0.html>. #L% --%> + <% response.sendRedirect("checkout.action"); %> diff --git a/swe-ui-web/src/main/webapp/WEB-INF/content/loginBrowse.jsp b/swe-ui-web/src/main/webapp/WEB-INF/content/loginBrowse.jsp index 32b4692..4fb5097 100644 --- a/swe-ui-web/src/main/webapp/WEB-INF/content/loginBrowse.jsp +++ b/swe-ui-web/src/main/webapp/WEB-INF/content/loginBrowse.jsp @@ -2,7 +2,7 @@ #%L ScmWebEditor %% - Copyright (C) 2009 - 2011 CodeLutin + Copyright (C) 2009 - 2015 CodeLutin %% This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -19,6 +19,7 @@ <http://www.gnu.org/licenses/lgpl-3.0.html>. #L% --%> + <%@ 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"> diff --git a/swe-ui-web/src/main/webapp/WEB-INF/content/logout.jsp b/swe-ui-web/src/main/webapp/WEB-INF/content/logout.jsp index 5f117e3..500b150 100644 --- a/swe-ui-web/src/main/webapp/WEB-INF/content/logout.jsp +++ b/swe-ui-web/src/main/webapp/WEB-INF/content/logout.jsp @@ -2,7 +2,7 @@ #%L ScmWebEditor %% - Copyright (C) 2009 - 2011 CodeLutin + Copyright (C) 2009 - 2015 CodeLutin %% This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -19,6 +19,7 @@ <http://www.gnu.org/licenses/lgpl-3.0.html>. #L% --%> + <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> <%@ taglib prefix="s" uri="/struts-tags" %> diff --git a/swe-ui-web/src/main/webapp/WEB-INF/content/modificationViewer.jsp b/swe-ui-web/src/main/webapp/WEB-INF/content/modificationViewer.jsp index 9caa33f..6c99e38 100644 --- a/swe-ui-web/src/main/webapp/WEB-INF/content/modificationViewer.jsp +++ b/swe-ui-web/src/main/webapp/WEB-INF/content/modificationViewer.jsp @@ -2,7 +2,7 @@ #%L ScmWebEditor %% - Copyright (C) 2009 - 2011 CodeLutin + Copyright (C) 2009 - 2015 CodeLutin %% This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -19,7 +19,6 @@ <http://www.gnu.org/licenses/lgpl-3.0.html>. #L% --%> -<%-- Document : ModificationViewer Created on : 10 sept. 2009, 13:43:11 Author : glorieux --%> <%@page contentType="text/html" pageEncoding="UTF-8" %> <%@ taglib prefix="s" uri="/struts-tags" %> diff --git a/swe-ui-web/src/main/webapp/WEB-INF/content/outConnection.jsp b/swe-ui-web/src/main/webapp/WEB-INF/content/outConnection.jsp index 8be197d..2545120 100644 --- a/swe-ui-web/src/main/webapp/WEB-INF/content/outConnection.jsp +++ b/swe-ui-web/src/main/webapp/WEB-INF/content/outConnection.jsp @@ -2,7 +2,7 @@ #%L ScmWebEditor %% - Copyright (C) 2009 - 2011 CodeLutin + Copyright (C) 2009 - 2015 CodeLutin %% This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -19,7 +19,7 @@ <http://www.gnu.org/licenses/lgpl-3.0.html>. #L% --%> -<%-- 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" %> diff --git a/swe-ui-web/src/main/webapp/WEB-INF/content/preview.jsp b/swe-ui-web/src/main/webapp/WEB-INF/content/preview.jsp index 1493845..7f26860 100644 --- a/swe-ui-web/src/main/webapp/WEB-INF/content/preview.jsp +++ b/swe-ui-web/src/main/webapp/WEB-INF/content/preview.jsp @@ -2,7 +2,7 @@ #%L ScmWebEditor %% - Copyright (C) 2009 - 2011 CodeLutin + Copyright (C) 2009 - 2015 CodeLutin %% This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -19,6 +19,7 @@ <http://www.gnu.org/licenses/lgpl-3.0.html>. #L% --%> + <%@ taglib prefix="s" uri="/struts-tags" %> <%@page contentType="text/html" pageEncoding="UTF-8" %> <%--Title and div for rst preview--%> @@ -26,6 +27,6 @@ <div id="prev" title="Preview"> <div id="preview"> - <s:property value="XMLResponse" escapeHtml="false"/> + <s:property value="htmlPreview" escapeHtml="false"/> </div> </div> diff --git a/swe-ui-web/src/main/webapp/WEB-INF/content/privateScmRedirect.jsp b/swe-ui-web/src/main/webapp/WEB-INF/content/privateScmRedirect.jsp index 7e40212..de9beb9 100644 --- a/swe-ui-web/src/main/webapp/WEB-INF/content/privateScmRedirect.jsp +++ b/swe-ui-web/src/main/webapp/WEB-INF/content/privateScmRedirect.jsp @@ -2,7 +2,7 @@ #%L ScmWebEditor %% - Copyright (C) 2009 - 2011 CodeLutin + Copyright (C) 2009 - 2015 CodeLutin %% This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -19,8 +19,7 @@ <http://www.gnu.org/licenses/lgpl-3.0.html>. #L% --%> -<%-- Document : PrivateScmRedirect Created on : 30 sept. 2009, 14:05:43 -Author : glorieux --%> + <%@page contentType="text/html" pageEncoding="UTF-8" %> <%@ taglib prefix="s" uri="/struts-tags" %> diff --git a/swe-ui-web/src/main/webapp/WEB-INF/content/recall.jsp b/swe-ui-web/src/main/webapp/WEB-INF/content/recall.jsp index 98bfeb7..b85b956 100644 --- a/swe-ui-web/src/main/webapp/WEB-INF/content/recall.jsp +++ b/swe-ui-web/src/main/webapp/WEB-INF/content/recall.jsp @@ -2,7 +2,7 @@ #%L ScmWebEditor %% - Copyright (C) 2009 - 2011 CodeLutin + Copyright (C) 2009 - 2015 CodeLutin %% This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -19,8 +19,7 @@ <http://www.gnu.org/licenses/lgpl-3.0.html>. #L% --%> -<%-- Document : Recall Created on : 30 sept. 2009, 17:05:40 Author : -glorieux --%> + <%@page contentType="text/html" pageEncoding="UTF-8" %> <%@ taglib prefix="s" uri="/struts-tags" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" diff --git a/swe-ui-web/src/main/webapp/WEB-INF/content/redirect.jsp b/swe-ui-web/src/main/webapp/WEB-INF/content/redirect.jsp index 88b8c1e..f95e61b 100644 --- a/swe-ui-web/src/main/webapp/WEB-INF/content/redirect.jsp +++ b/swe-ui-web/src/main/webapp/WEB-INF/content/redirect.jsp @@ -2,7 +2,7 @@ #%L ScmWebEditor %% - Copyright (C) 2009 - 2011 CodeLutin + Copyright (C) 2009 - 2015 CodeLutin %% This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -19,8 +19,7 @@ <http://www.gnu.org/licenses/lgpl-3.0.html>. #L% --%> -<%-- Document : Redirect Created on : 10 sept. 2009, 13:43:11 Author : -glorieux --%> + <%@page contentType="text/html" pageEncoding="UTF-8" %> <%@ taglib prefix="s" uri="/struts-tags" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" @@ -53,6 +52,6 @@ glorieux --%> <% } %> <s:text name="scm.clickHere"/></a>.</p> -<p>©2004-2014 CodeLutin</p> +<p>©2004-2015 CodeLutin</p> </body> </html> diff --git a/swe-ui-web/src/main/webapp/WEB-INF/content/reset.jsp b/swe-ui-web/src/main/webapp/WEB-INF/content/reset.jsp index 0c257f2..e0a77d5 100644 --- a/swe-ui-web/src/main/webapp/WEB-INF/content/reset.jsp +++ b/swe-ui-web/src/main/webapp/WEB-INF/content/reset.jsp @@ -2,7 +2,7 @@ #%L ScmWebEditor %% - Copyright (C) 2009 - 2011 CodeLutin + Copyright (C) 2009 - 2015 CodeLutin %% This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -19,6 +19,7 @@ <http://www.gnu.org/licenses/lgpl-3.0.html>. #L% --%> + <%@ taglib prefix="s" uri="/struts-tags" %> <s:set name="lastRevision"> diff --git a/swe-ui-web/src/main/webapp/WEB-INF/content/save.jsp b/swe-ui-web/src/main/webapp/WEB-INF/content/save.jsp index 230bb95..af0199a 100644 --- a/swe-ui-web/src/main/webapp/WEB-INF/content/save.jsp +++ b/swe-ui-web/src/main/webapp/WEB-INF/content/save.jsp @@ -2,7 +2,7 @@ #%L ScmWebEditor %% - Copyright (C) 2009 - 2011 CodeLutin + Copyright (C) 2009 - 2015 CodeLutin %% This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -19,6 +19,7 @@ <http://www.gnu.org/licenses/lgpl-3.0.html>. #L% --%> + <%@ taglib prefix="s" uri="/struts-tags" %> <%@ taglib prefix="sj" uri="/struts-jquery-tags" %> diff --git a/swe-ui-web/src/main/webapp/WEB-INF/content/upload.jsp b/swe-ui-web/src/main/webapp/WEB-INF/content/upload.jsp index e098379..8474225 100644 --- a/swe-ui-web/src/main/webapp/WEB-INF/content/upload.jsp +++ b/swe-ui-web/src/main/webapp/WEB-INF/content/upload.jsp @@ -2,7 +2,7 @@ #%L ScmWebEditor %% - Copyright (C) 2009 - 2011 CodeLutin + Copyright (C) 2009 - 2015 CodeLutin %% This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -19,6 +19,7 @@ <http://www.gnu.org/licenses/lgpl-3.0.html>. #L% --%> + <%@ taglib prefix="s" uri="/struts-tags" %> diff --git a/swe-ui-web/src/main/webapp/WEB-INF/content/uploadForm.jsp b/swe-ui-web/src/main/webapp/WEB-INF/content/uploadForm.jsp index f367e8d..773c53f 100644 --- a/swe-ui-web/src/main/webapp/WEB-INF/content/uploadForm.jsp +++ b/swe-ui-web/src/main/webapp/WEB-INF/content/uploadForm.jsp @@ -2,7 +2,7 @@ #%L ScmWebEditor %% - Copyright (C) 2009 - 2011 CodeLutin + Copyright (C) 2009 - 2015 CodeLutin %% This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -19,6 +19,7 @@ <http://www.gnu.org/licenses/lgpl-3.0.html>. #L% --%> + <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> diff --git a/swe-ui-web/src/main/webapp/WEB-INF/content/uploadSuccess.jsp b/swe-ui-web/src/main/webapp/WEB-INF/content/uploadSuccess.jsp index 5bb9f26..c8ae876 100644 --- a/swe-ui-web/src/main/webapp/WEB-INF/content/uploadSuccess.jsp +++ b/swe-ui-web/src/main/webapp/WEB-INF/content/uploadSuccess.jsp @@ -2,7 +2,7 @@ #%L ScmWebEditor %% - Copyright (C) 2009 - 2011 CodeLutin + Copyright (C) 2009 - 2015 CodeLutin %% This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -19,6 +19,7 @@ <http://www.gnu.org/licenses/lgpl-3.0.html>. #L% --%> + <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> <%@ taglib prefix="s" uri="/struts-tags" %> diff --git a/swe-ui-web/src/main/webapp/WEB-INF/web.xml b/swe-ui-web/src/main/webapp/WEB-INF/web.xml index 2963c3e..c67fef2 100644 --- a/swe-ui-web/src/main/webapp/WEB-INF/web.xml +++ b/swe-ui-web/src/main/webapp/WEB-INF/web.xml @@ -3,7 +3,7 @@ #%L ScmWebEditor %% - Copyright (C) 2009 - 2014 CodeLutin + Copyright (C) 2009 - 2015 CodeLutin %% This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.