Commit f7f04f68 by Juho Salli

Merge branch 'keepalivetime' into 'master'

Conversation keepalive prettifying

on javascript keepalive error give javascript alert() message instead of just reloading the page. When updating the server reload goes to glassfish on nginx 404 page, which is not nice.

See merge request !279
2 parents 21ce7f4b d4fbb11c
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<link rel="stylesheet" type="text/css" href="#{request.contextPath}/resources/templates/primelayout/css/skinning.css" /> <link rel="stylesheet" type="text/css" href="#{request.contextPath}/resources/templates/primelayout/css/skinning.css" />
<link rel="stylesheet" type="text/css" href="#{request.contextPath}/resources/templates/primelayout/css/structual.css" /> <link rel="stylesheet" type="text/css" href="#{request.contextPath}/resources/templates/primelayout/css/structual.css" />
<link rel="stylesheet" type="text/css" href="#{request.contextPath}/resources/templates/custom_components.css" /> <link rel="stylesheet" type="text/css" href="#{request.contextPath}/resources/templates/custom_components.css" />
<script type="text/javascript" src="#{request.contextPath}/resources/script/prime_calendar.js" ></script> <script type="text/javascript" src="#{request.contextPath}/resources/script/prime_calendar.js"></script>
<ui:insert name="headerdata" /> <ui:insert name="headerdata" />
...@@ -41,9 +41,8 @@ ...@@ -41,9 +41,8 @@
<h:body> <h:body>
<!-- Javascript-lokalisaatiolippupuljausta --> <!-- Javascript-lokalisaatiolippupuljausta -->
<h:form id="conversationKeepaliver"> <h:form id="conversationKeepaliver">
<p:remoteCommand name="cdiKeepalive" onerror="location.reload();" update=":cdiloop" actionListener="#{conversationKeepaliveView.ping()}" /> <p:remoteCommand name="cdiKeepalive" onerror="alert('#{i18n['template.keepaliveError']}'); location.reload();" update=":cdiloop" actionListener="#{conversationKeepaliveView.ping()}" />
</h:form> </h:form>
<h:outputText id="cdiloop" value="#{conversationKeepaliveView.value}" />
<script type="text/javascript"> <script type="text/javascript">
$(document) $(document)
...@@ -93,9 +92,7 @@ ...@@ -93,9 +92,7 @@
<c:otherwise> <c:otherwise>
<p:graphicImage id="eventlogo" rendered="#{layoutView.headerIsImage}" value="#{layoutView.headerimage}" /> <p:graphicImage id="eventlogo" rendered="#{layoutView.headerIsImage}" value="#{layoutView.headerimage}" />
<ui:fragment rendered="#{!layoutView.headerIsImage}"> <ui:fragment rendered="#{!layoutView.headerIsImage}">
<h1> <h1><h:outputText value="#{layoutView.headertext}" /></h1>
<h:outputText value="#{layoutView.headertext}" />
</h1>
</ui:fragment> </ui:fragment>
</c:otherwise> </c:otherwise>
</c:choose> </c:choose>
...@@ -213,10 +210,15 @@ ...@@ -213,10 +210,15 @@
<f:param name="pagename" value="#{layoutView.pagepath}:bottom" /> <f:param name="pagename" value="#{layoutView.pagepath}:bottom" />
</h:link> </h:link>
<footer class="bgColor1"> </footer>
</p:layoutUnit> </p:layoutUnit>
<p:layoutUnit position="south" size="30">
<footer class="bgColor1">
<h:outputText id="cdiloop" value="#{conversationKeepaliveView.date}">
<f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
</h:outputText>
</footer>
</p:layoutUnit>
</p:layout> </p:layout>
...@@ -252,8 +254,6 @@ ...@@ -252,8 +254,6 @@
} }
}); });
</script> </script>
<c:if test="#{sessionHandler.isInDevelopmentMode()}"> <c:if test="#{sessionHandler.isInDevelopmentMode()}">
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
package fi.codecrew.moya.web; package fi.codecrew.moya.web;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date;
import javax.enterprise.context.ConversationScoped; import javax.enterprise.context.ConversationScoped;
import javax.inject.Named; import javax.inject.Named;
...@@ -35,12 +36,10 @@ public class ConversationKeepaliveView implements Serializable { ...@@ -35,12 +36,10 @@ public class ConversationKeepaliveView implements Serializable {
*/ */
private static final long serialVersionUID = -3393159401702699270L; private static final long serialVersionUID = -3393159401702699270L;
private int value = 0; private int value = 0;
private static final Logger logger = LoggerFactory.getLogger(ConversationKeepaliveView.class); private static final Logger logger = LoggerFactory.getLogger(ConversationKeepaliveView.class);
public int ping() { public int ping() {
return ++value; return ++value;
} }
...@@ -53,5 +52,8 @@ public class ConversationKeepaliveView implements Serializable { ...@@ -53,5 +52,8 @@ public class ConversationKeepaliveView implements Serializable {
this.value = value; this.value = value;
} }
public Date getDate() {
return new Date();
}
} }
\ No newline at end of file
...@@ -1406,6 +1406,7 @@ svm.pending.successMessage = Payment pending. You will receive email after payme ...@@ -1406,6 +1406,7 @@ svm.pending.successMessage = Payment pending. You will receive email after payme
svm.success.errorMessage = Payment could not be verified! svm.success.errorMessage = Payment could not be verified!
svm.success.successMessage = Payment was successfull. svm.success.successMessage = Payment was successfull.
template.keepaliveError = Page has expired. Please refresh the page.
template.loggedInAs = Logged in as template.loggedInAs = Logged in as
topmenu.admin = Admin View topmenu.admin = Admin View
......
...@@ -1391,6 +1391,7 @@ svm.pending.successMessage = Maksukuittausta odotetaan. Kuittauksesta l\u00E4het ...@@ -1391,6 +1391,7 @@ svm.pending.successMessage = Maksukuittausta odotetaan. Kuittauksesta l\u00E4het
svm.success.errorMessage = Verkkomaksua ei voitu verifioida! Virheest\u00E4 on raportoitu eteenp\u00E4in. svm.success.errorMessage = Verkkomaksua ei voitu verifioida! Virheest\u00E4 on raportoitu eteenp\u00E4in.
svm.success.successMessage = Verkkomaksu onnistui. svm.success.successMessage = Verkkomaksu onnistui.
template.keepaliveError = Sivu on vanhentunut. Ole hyv\u00E4 ja p\u00E4ivit\u00E4 sivu.
template.loggedInAs = Kirjautunut tunnuksella template.loggedInAs = Kirjautunut tunnuksella
topmenu.admin = Yll\u00E4piton\u00E4kym\u00E4 topmenu.admin = Yll\u00E4piton\u00E4kym\u00E4
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!