Commit 9f1a002e by Tuukka Kivilahti, TKffTK

Merge branch 'master' of codecrew.fi:bortal

2 parents 4b2a13bc 8e814fa4
...@@ -27,6 +27,10 @@ ...@@ -27,6 +27,10 @@
<welcome-file>index.jsp</welcome-file> <welcome-file>index.jsp</welcome-file>
<welcome-file>index.wtf</welcome-file> <welcome-file>index.wtf</welcome-file>
</welcome-file-list> </welcome-file-list>
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/error.jsf</location>
</error-page>
<servlet> <servlet>
<servlet-name>Faces Servlet</servlet-name> <servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jsp/jstl/core">
<h:head>
<title></title>
</h:head>
<h:body>
<br/>
<center>
<img src="#{request.contextPath}/resources/media/error.jpg" />
<h1>LOL, ERROR!</h1>
<br/>
<c:if test="#{sessionHandler.isInDevelopmentMode() eq false}">
<h:outputText escape="false" style="color: red;" value="ERR##{errorPageView.time}" />
</c:if>
<br/><br/>
</center>
<c:when test="#{sessionHandler.isInDevelopmentMode()}">
<h:outputText escape="false" value="#{errorPageView.stackTrace}" />
</c:when>
</h:body>
</html>
\ No newline at end of file
package fi.insomnia.bortal.web;
import javax.enterprise.context.RequestScoped;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import javax.inject.Inject;
import javax.inject.Named;
import fi.insomnia.bortal.beans.CardPrintBeanLocal;
import fi.insomnia.bortal.model.EventUser;
import fi.insomnia.bortal.web.cdiview.user.UserCartView;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.Serializable;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.Map;
@Named
@RequestScoped
public class ErrorPageView {
String trace;
public String getStackTrace() {
FacesContext context = FacesContext.getCurrentInstance();
Map requestMap = context.getExternalContext().getRequestMap();
Throwable ex =
(Throwable) requestMap.get("javax.servlet.error.exception");
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
ex.printStackTrace(pw);
trace = sw.toString();
return trace;
}
public Long getTime(){
return Calendar.getInstance().getTimeInMillis();
}
}
\ No newline at end of file
#!/bin/bash
epoc=$(date +%s)
# katotaan kaikki käännetyt
awk '{print $1}' ./LanBortalWeb/src/fi/insomnia/bortal/resources/i18n.properties > /tmp/${epoc}lokalisoidut
# Haetaan kaikki rivit missä on jotain käännettävää
find . -name \*.xhtml | xargs grep "i18n" > /tmp/${epoc}lista
# grepataan kaikki lokalisoimattomat
for i in $(cat /tmp/${epoc}lokalisoidut); do egrep -v "('|\")$i('|\")" /tmp/${epoc}lista ; done > /tmp/${epoc}isolista
# sit otetaan pois duplikaattirivit
sort /tmp/${epoc}isolista | uniq
# siivotaan
rm /tmp/${epoc}isolista /tmp/${epoc}lista /tmp/${epoc}lokalisoidut
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!