r147 - in trunk/src/main: java/org/nuiton/scmwebeditor webapp
Author: kcardineaud Date: 2011-06-29 18:06:17 +0200 (Wed, 29 Jun 2011) New Revision: 147 Url: http://nuiton.org/repositories/revision/scmwebeditor/147 Log: Remove some useless files Removed: trunk/src/main/java/org/nuiton/scmwebeditor/PreviewServlet.java trunk/src/main/java/org/nuiton/scmwebeditor/PrivateSvnServlet.java trunk/src/main/webapp/GereFormSize.js trunk/src/main/webapp/fileSearch.js Modified: trunk/src/main/webapp/OutConnection.jsp Deleted: trunk/src/main/java/org/nuiton/scmwebeditor/PreviewServlet.java =================================================================== --- trunk/src/main/java/org/nuiton/scmwebeditor/PreviewServlet.java 2011-06-29 16:05:03 UTC (rev 146) +++ trunk/src/main/java/org/nuiton/scmwebeditor/PreviewServlet.java 2011-06-29 16:06:17 UTC (rev 147) @@ -1,96 +0,0 @@ -/* - * #%L - * Nuiton-ScmWebEditor - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2009 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ -package org.nuiton.scmwebeditor; - -import org.apache.commons.io.FileUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.nuiton.jrst.JRST; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -import java.io.File; -import java.io.IOException; -import java.io.PrintWriter; - -/** - * @author geoffroy lorieux - */ -public class PreviewServlet extends ScmWebEditorBaseAction { - - private static final long serialVersionUID = 1L; - - private static final Log log = LogFactory.getLog(PreviewServlet.class); - - /** - * Processes requests for <code>POST</code> method. - * - * @param request servlet request - * @param response servlet response - * @throws ServletException if a servlet-specific error occurs - * @throws IOException if an I/O error occurs - */ - protected void doPost(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { - log.debug("je suis dans la previewservlet"); - HttpSession httpSession = request.getSession(true); - File tmp_dir = getTempDir(httpSession); - log.debug("Le tmp dir est :" + tmp_dir); - log.debug("Le content type est : " + request.getContentType()); -// Text recuperation - String myData = request.getParameter(PARAMETER_TEXT); -// Text formating and tempfile creating - String myDataWithoutcrlf = myData.replace("\r", ""); - File file_in_dir_copy = new File(tmp_dir, "copy" + httpSession.getId() + ".rst"); - File http_file = new File(tmp_dir, "preview" + httpSession.getId() + ".html"); - file_in_dir_copy.createNewFile(); - http_file.createNewFile(); - FileUtils.writeStringToFile(file_in_dir_copy, myDataWithoutcrlf); - - convertToUnicode(file_in_dir_copy); - - File copy = new File(tmp_dir, "copy" + httpSession.getId() + ".rst"); -// Using jrst for generate html document - try { - JRST.generate(JRST.TYPE_HTML, copy, http_file, JRST.Overwrite.ALLTIME); - log.debug("generate okai"); - } catch (Exception eee) { - log.debug("Bad RST file"); - response.setStatus(406); - return; - } - copy.delete(); -// Sending html content to pop-up preview page - response.setCharacterEncoding("UTF-8"); - response.setContentType("text/html"); - PrintWriter ret = response.getWriter(); - - ret.print(FileUtils.readFileToString(http_file)); - http_file.delete(); - } -} - Deleted: trunk/src/main/java/org/nuiton/scmwebeditor/PrivateSvnServlet.java =================================================================== --- trunk/src/main/java/org/nuiton/scmwebeditor/PrivateSvnServlet.java 2011-06-29 16:05:03 UTC (rev 146) +++ trunk/src/main/java/org/nuiton/scmwebeditor/PrivateSvnServlet.java 2011-06-29 16:06:17 UTC (rev 147) @@ -1,73 +0,0 @@ -/* - * #%L - * Nuiton-ScmWebEditor - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2009 - 2010 CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. - * #L% - */ -package org.nuiton.scmwebeditor; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -import java.io.IOException; -import java.io.PrintWriter; - -/** - * @author geoffroy lorieux - */ -public class PrivateSvnServlet extends ScmWebEditorBaseAction { - - private static final long serialVersionUID = 1L; - - private static final Log log = LogFactory.getLog(PrivateSvnServlet.class); - - - protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - if (log.isDebugEnabled()) { - log.debug("New Log setting"); - } - HttpSession httpSession = request.getSession(true); - //FIXME-TC20091124 why doing this at each request ?, this is weird :) - System.setProperty("file.encoding", "UTF-8"); - PrintWriter out = response.getWriter(); - SvnSession svnSess = getSvnSession(httpSession); - - // Resetting User Information - svnSess.updateAuthentication(request.getParameter(PARAMETER_USERNAME), request.getParameter(PARAMETER_PW)); - //FIXME-TC20091124 : why repush the object already in session, I don't see the point... - setSvnSession(httpSession, svnSess); - // Recalling helloservlet with user information stock on session - String url = getRedirectUrl(svnSess); - if (log.isDebugEnabled()) { - log.debug("redirect url = " + url); - } - request.setAttribute(ATTRIBUTE_REDIRECT_URL, url); - //redirect(request, response, "/Recall.jsp"); - - out.close(); - } - - -} Deleted: trunk/src/main/webapp/GereFormSize.js =================================================================== --- trunk/src/main/webapp/GereFormSize.js 2011-06-29 16:05:03 UTC (rev 146) +++ trunk/src/main/webapp/GereFormSize.js 2011-06-29 16:06:17 UTC (rev 147) @@ -1,43 +0,0 @@ -/** - * @author geoffroy lorieux - */ - - -function countLines(strtocount, cols) - { - var hard_lines = 1; - var last = 0; - while ( true ) - { - last = strtocount.indexOf("\n", last+1); - hard_lines ++; - if ( last == -1 ) - { - break; - } - } - var soft_lines = Math.round(strtocount.length / (cols-1)); - var hard = eval("hard_lines " + unescape("%3e") + "soft_lines;"); - if ( hard ) - { - soft_lines = hard_lines; - } - return soft_lines; - } -function cleanForm() - { - var the_form = document.forms[0]; - for ( var x in the_form ) - { - if ( ! the_form[x] ) - { - continue; - } - if( typeof the_form[x].rows != "number" ) - { - continue; - } - the_form[x].rows = countLines(the_form[x].value,the_form[x].cols) +1; - } - setTimeout("cleanForm();", 300); - } \ No newline at end of file Modified: trunk/src/main/webapp/OutConnection.jsp =================================================================== --- trunk/src/main/webapp/OutConnection.jsp 2011-06-29 16:05:03 UTC (rev 146) +++ trunk/src/main/webapp/OutConnection.jsp 2011-06-29 16:06:17 UTC (rev 147) @@ -15,7 +15,6 @@ <title>SCM Web Editor</title> </head> <body> -<script src="fileSearch.js" type="text/javascript"></script> <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> Deleted: trunk/src/main/webapp/fileSearch.js =================================================================== --- trunk/src/main/webapp/fileSearch.js 2011-06-29 16:05:03 UTC (rev 146) +++ trunk/src/main/webapp/fileSearch.js 2011-06-29 16:06:17 UTC (rev 147) @@ -1,50 +0,0 @@ -function createRequestObject() -{ - var req; - if(window.XMLHttpRequest) - { - //For Firefox, Safari, Opera - req = new XMLHttpRequest(); - } - else if(window.ActiveXObject) - { - //For IE 5+ - req = new ActiveXObject("Microsoft.XMLHTTP"); - } - else - { - //Error for an old browser - alert('Your browser is not IE 5 or higher, or Firefox or Safari or Opera'); - } - return req; -} - -//Make the XMLHttpRequest Object -var http= createRequestObject(); - -function sendRequestToFileSearchAction(scmPath, searchUrl) -{ - http.open("POST", searchUrl, true); - http.onreadystatechange = handleResponseFromFileSearchAction; - http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); - http.send("address="+scmPath.value); -} - -function handleResponseFromFileSearchAction() -{ - if(http.readyState == 4 && http.status != 401){ - alert("Can find file Continue"); - var response = http.responseText; - alert(response); - - - } else if (http.readyState == 4 && http.status == 401){ - alert("Cannot find files please recheck Scm path."); - } -} - -function fileSearch(scmPath) -{ - alert(scmPath.value); - sendRequestToFileSearchAction(scmPath, "search.action"); -}
participants (1)
-
kcardineaud@users.nuiton.org