Changeset 31962
- Timestamp:
- 2017-09-12T17:19:04+12:00 (7 years ago)
- Location:
- other-projects/the-macronizer/trunk
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/the-macronizer/trunk/build.xml
-
Property svn:mime-type
changed from
application/xml
totext/xml
r30063 r31962 9 9 <property name="build.dir.exp" location="web" /> 10 10 <property name="lib.dir.exp" location="web/WEB-INF/lib" /> 11 <property name="webinf.dir" location="web/WEB-INF" /> 11 12 12 13 <!-- … … 40 41 </target> 41 42 42 <target depends="init" name="build">43 <target name="build" depends="init"> 43 44 <javac source="${javac.source}" target="${javac.target}" debug="${javac.debug}" 44 45 encoding="utf-8" … … 49 50 <path refid="classpath.exp"/> 50 51 <pathelement location="src/jars/servlet-api.jar"/> 51 <pathelement path="src/java"/> 52 <pathelement path="src/java"/> 53 <pathelement path="webinf.dir"/> 52 54 </classpath> 53 55 </javac> 56 57 <!-- http://ant.apache.org/manual/Tasks/copy.html 58 By default, files are only copied if the source file is newer than the destination file, 59 or when the destination file does not exist. However, you can explicitly overwrite files 60 with the overwrite attribute.--> 61 <copy file="${build.dir.exp}/log4j.properties.in" tofile="/greenstone/greenstone3/web/WEB-INF/classes/log4j.properties"/> 62 63 <!-- mkdir Creates a directory. Also non-existent parent directories are created, 64 when necessary. Does nothing if the directory already exist. --> 65 <mkdir dir="${build.dir.exp}/logs"/> 54 66 </target> 55 67 56 68 57 <target depends="build" name="war">69 <target name="war" depends="build"> 58 70 <jar destfile="${dist.filename.exp}"> 59 71 <fileset dir="${build.dir.exp}" /> -
Property svn:mime-type
changed from
-
other-projects/the-macronizer/trunk/src/java/web/servlets/DirectInput.java
r30061 r31962 23 23 import monogram.plugin.PluginConfiguration; 24 24 import monogram.plugin.PluginManager; 25 import org.apache.log4j.*; 25 26 26 27 /** … … 32 33 private final String UNEXPECTED_ERROR = "An unexpected error has occurred. Please try again or contact the web administrator if the problem persists."; 33 34 private final String UTF8_ENCODING = "utf-8"; 34 public static boolean DI; // This will be used in a test in the mongramRestorer to add html to highlig ththe changes on the webpage output.35 public static boolean DI; // This will be used in a test in the mongramRestorer to add html to highlight the changes on the webpage output. 35 36 private File tmpdir; 37 //Create an instance of the Logger object created for this class in log4j.properties 38 static Logger logger = Logger.getLogger(web.servlets.DirectInput.class.getName()); 36 39 37 40 @Override … … 86 89 File file = File.createTempFile("mi-tmp-", ".txt", tmpdir); 87 90 write(file, "utf-8", fragment); 88 91 89 92 //Create a fileview 90 93 PluginConfiguration configuration = new PluginConfiguration(); … … 107 110 RequestDispatcher dispatcher = this.getServletContext().getRequestDispatcher(path + "/main.jsp"); 108 111 dispatcher.forward(request, response); 112 //Generate an "info" level logger message including the input('fragment') and output('restoredFragment') 113 logger.info("Input:"+fragment+"Output: "+restoredFragment); 109 114 } catch (Exception e) { 110 115 request.setAttribute("errorMessage", UNEXPECTED_ERROR); 111 116 forward(path + "/error.jsp", request, response); 112 117 } finally { 113 114 115 restoredFile.delete();116 118 file.delete(); 119 if (restoredFile != null) { 120 restoredFile.delete(); 121 } 117 122 } 118 123 } -
other-projects/the-macronizer/trunk/src/java/web/servlets/FileUpload.java
r30062 r31962 1 1 package web.servlets; 2 2 3 import java.io.BufferedReader; 3 4 import java.io.File; 5 import java.io.FileReader; 4 6 import java.io.IOException; 7 import java.lang.StringBuilder; 5 8 import java.util.List; 6 9 import javax.servlet.RequestDispatcher; … … 16 19 import util.FileUtil; 17 20 import monogram.plugin.PluginManager; 21 import org.apache.log4j.*; 18 22 19 23 /** … … 25 29 26 30 private File tmpdir; 31 32 //Create an instance of the Logger object created for this class in log4j.properties 33 static Logger logger = Logger.getLogger(web.servlets.DirectInput.class.getName()); 27 34 28 35 @Override … … 77 84 request.setAttribute("options", properties.getOptions()); 78 85 forward(address + "/main.jsp", request, response); 86 String outputText = stringFromFile(restoredFile); 87 logger.error("Output:"+outputText); 79 88 } catch (UnsupportedOperationException e) { 80 89 FileUtil.deleteFile(restoredFile); … … 126 135 requestData.setFile(file); 127 136 requestData.setFilename(item.getName()); 137 String logText=stringFromFile(file); 138 logger.error("Input:"+logText); 128 139 } 129 140 } … … 133 144 return requestData; 134 145 } 135 146 147 private String stringFromFile(File file)throws IOException{ 148 BufferedReader reader = new BufferedReader(new FileReader(file)); 149 String line = null; 150 StringBuilder sb = new StringBuilder(); 151 try{ 152 while((line=reader.readLine())!=null){ 153 sb.append(line); 154 } 155 return sb.toString(); 156 } 157 catch (Exception e){ 158 e.printStackTrace(); 159 } 160 finally{ 161 reader.close(); 162 } 163 } 164 136 165 private PluginConfiguration configure(Properties properties) { 137 166 final File file = properties.getFile(); -
other-projects/the-macronizer/trunk/web/index.jsp
r29855 r31962 5 5 --%> 6 6 7 <%@page contentType="text/html" pageEncoding="UTF-8"%> 8 <!DOCTYPE html> 9 <html> 10 <head> 11 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 12 <title>JSP test Page</title> 13 </head> 14 <body> 15 <h1>Hello World!</h1> 16 </body> 17 </html> 7 <% response.sendRedirect("jsp/mi/main.jsp"); %> -
other-projects/the-macronizer/trunk/web/jsp/en/footer.jsp
r29855 r31962 21 21 </div> 22 22 <div id="copyright"> 23 <p>This website collects simple usage logs which will be used for development purposes only. No details which could be used to identify individuals will be collected and the data will be kept securely at the University of Waikato. If you do not wish for your activity to be included, click <a href="mailto:[email protected]">here</a> to notify Dr. Te Taka Keegan. </p> 23 24 <p class="note">Copyright © 2014 University of Waikato</p> 24 25 </div> -
other-projects/the-macronizer/trunk/web/jsp/mi/footer.jsp
r29855 r31962 21 21 </div> 22 22 <div id="copyright"> 23 <p>This website collects simple usage logs which will be used for development purposes only. No details which could be used to identify individuals will be collected and the data will be kept securely at the University of Waikato. If you do not wish for your activity to be included, click <a href="mailto:[email protected]">here</a> to notify Dr. Te Taka Keegan.</p> 23 24 <p class="note">ManatÄrua © 2011 nÄ John Cocks</p> 24 25 </div>
Note:
See TracChangeset
for help on using the changeset viewer.