Commit f8a3c834 by Tuomas Riihimäki

Random stuff

1 parent d5470a06
......@@ -5,7 +5,7 @@
xmlns:c="http://java.sun.com/jsp/jstl/core"
>
<f:view locale="#{sessionHandler.locale}">
<f:view locale="#{sessionHandler.locale}" >
<ui:insert name="metadata" />
<h:head>
......@@ -17,7 +17,7 @@
<link rel="stylesheet" type="text/css" href="#{request.contextPath}/resources/style/insomnia1/style.css" />
<ui:insert name="headerdata" />
</h:head>
<h:body>
<h:body >
<div id="wrapper">
......
......@@ -5,16 +5,19 @@
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:orgrole="http://java.sun.com/jsf/composite/cditools/orgrole"
xmlns:c="http://java.sun.com/jsp/jstl/core">
xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:p="http://primefaces.org/ui"
>
<h:body>
<ui:composition
template="/layout/#{sessionHandler.layout}/template.xhtml">
<ui:param name="thispage" value="page.orgrole.list" />
<f:metadata>
<f:event type="preRenderView"
listener="#{orgRoleView.permissionList()}" />
<f:event type="preRenderView" listener="#{orgRoleView.permissionList()}" />
</f:metadata>
<ui:define name="title">
<h1>#{i18n['foodwave.template.edit.title']}</h1>
</ui:define>
<ui:define name="content">
<orgrole:list />
</ui:define>
......
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.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:users="http://java.sun.com/jsf/composite/tools/user" xmlns:c="http://java.sun.com/jsp/jstl/core">
xmlns:c="http://java.sun.com/jsp/jstl/core">
<h:body>
<ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml">
<ui:param name="thispage" value="page.eventorg.edit" />
<ui:define name="content">
<ui:composition template="/resources/#{sessionHandler.layout}/template.xhtml">
<ui:define name="page">
#{sessionHandler.flushCache()}
<h:form>
<h:commandButton action="#{testView.resetMenu()}" value="Reset to newui menu" onclick="return confirm('THIS WILL RESET ALL MODIFICATIONS TO DEFAULT MENU!!\n Are you really sure?!');" />
<h:commandButton action="#{testView.resetOldMenu()}" value="Reset to old menu" onclick="return confirm('THIS WILL RESET ALL MODIFICATIONS TO DEFAULT MENU!!\n Are you really sure?!');" />
</h:form>
</ui:define>
</ui:composition>
......
......@@ -10,7 +10,6 @@ import java.util.TimeZone;
import javax.ejb.EJB;
import javax.enterprise.context.RequestScoped;
import javax.faces.context.FacesContext;
import javax.inject.Inject;
import javax.inject.Named;
import javax.servlet.http.HttpServletRequest;
......@@ -34,10 +33,10 @@ import fi.insomnia.bortal.model.LanEventPropertyKey;
public class SessionHandler {
private static final Logger logger = LoggerFactory.getLogger(SessionHandler.class);
@Inject
private HttpServletRequest httprequest;
//
// @Inject
// private HttpServletRequest httprequest;
//
@EJB
private RoleBeanLocal rolebean;
@EJB
......
......@@ -54,7 +54,7 @@ public abstract class GenericCDIView implements Serializable {
ret = requirePermissions(externalChecks);
}
if (!ret) {
logger.info("Permission required failed for {}", perm.getFullName());
logger.info("Permission required failed for {} Permission: {} (or extrachecks)", perm.getFullName(), perm);
}
......
......@@ -77,15 +77,15 @@ public class PollView extends GenericCDIView {
if (super.requirePermissions(PollPermission.ANSWER) && poll == null) {
thisPage = 1;
poll = pollBean.find(pollId);
if (super.requirePermissions(poll != null && poll.getQuestions() != null && !poll.getQuestions().isEmpty()))
logger.debug("Initializing poll with id {} , poll {}", pollId, poll);
if (!super.requirePermissions(poll != null && poll.getQuestions() != null && !poll.getQuestions().isEmpty()))
{
return;
}
logger.debug("initializing poll questions {}", poll.getQuestions());
pages = new HashMap<Integer, List<QuestionWrapper>>();
logger.info("initializing poll {}", poll);
for (PollQuestion q : getPoll().getQuestions()) {
for (PollQuestion q : poll.getQuestions()) {
if (!getPages().containsKey(q.getPage())) {
......
......@@ -38,11 +38,9 @@ public class AuthView extends GenericCDIView {
private HttpServletRequest getRequest() {
FacesContext facesContext = FacesContext.getCurrentInstance();
ExternalContext externalContext = facesContext.
getExternalContext();
ExternalContext externalContext = facesContext.getExternalContext();
Object request = externalContext.getRequest();
return request instanceof HttpServletRequest ?
(HttpServletRequest) request : null;
return request instanceof HttpServletRequest ? (HttpServletRequest) request : null;
}
public void executeLogout() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!