You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2015/10/23 17:53:02 UTC
isis git commit: ISIS-1210: also show the ticket reference on the
error page if available.
Repository: isis
Updated Branches:
refs/heads/master 714dd129e -> 397e60612
ISIS-1210: also show the ticket reference on the error page if available.
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/397e6061
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/397e6061
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/397e6061
Branch: refs/heads/master
Commit: 397e606120739913f23decef4d6673e8a49cf4ec
Parents: 714dd12
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Fri Oct 23 16:52:18 2015 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Fri Oct 23 16:52:18 2015 +0100
----------------------------------------------------------------------
.../ui/errors/ExceptionStackTracePanel.html | 9 ++++--
.../ui/errors/ExceptionStackTracePanel.java | 31 ++++++++++++++------
2 files changed, 28 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/397e6061/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/errors/ExceptionStackTracePanel.html
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/errors/ExceptionStackTracePanel.html b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/errors/ExceptionStackTracePanel.html
index 4277658..7b649be 100644
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/errors/ExceptionStackTracePanel.html
+++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/errors/ExceptionStackTracePanel.html
@@ -38,12 +38,15 @@
<span wicket:id="mainMessage">[main message text]</span>
</h2>
</div>
- <div class="panel-body" wicket:id="userDetail">
- <h3><span wicket:id="details">details</span></h3>
+ <div class="panel-body" wicket:id="ticketDetailsDiv">
+ <h3><span wicket:id="ticketDetails">[ticket details]</span></h3>
+ </div>
+ <div class="panel-body" wicket:id="ticketReferenceDiv">
+ <h4>Please quote reference: <span wicket:id="ticketReference">[ticket reference]</span></h4>
</div>
</div>
<br/>
- <div class="errorDetail panel panel-default" wicket:id="exceptionDetail">
+ <div class="errorDetail panel panel-default" wicket:id="exceptionDetailDiv">
<div class="heading panel-heading">
<a class="btn btn-primary" href="#" role="button">Exception details</a>
<span class="panel-title"></span>
http://git-wip-us.apache.org/repos/asf/isis/blob/397e6061/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/errors/ExceptionStackTracePanel.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/errors/ExceptionStackTracePanel.java b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/errors/ExceptionStackTracePanel.java
index fb81315..a5e9526 100644
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/errors/ExceptionStackTracePanel.java
+++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/errors/ExceptionStackTracePanel.java
@@ -38,9 +38,13 @@ public class ExceptionStackTracePanel extends Panel {
private static final String ID_MAIN_MESSAGE = "mainMessage";
- private static final String ID_USER_DETAIL = "userDetail";
- private static final String ID_DETAILS = "details";
- private static final String ID_EXCEPTION_DETAIL = "exceptionDetail";
+ private static final String ID_TICKET_DETAILS_DIV = "ticketDetailsDiv";
+ private static final String ID_TICKET_DETAILS = "ticketDetails";
+
+ private static final String ID_TICKET_REFERENCE_DIV = "ticketReferenceDiv";
+ private static final String ID_TICKET_REFERENCE = "ticketReference";
+
+ private static final String ID_EXCEPTION_DETAIL_DIV = "exceptionDetailDiv";
private static final String ID_STACK_TRACE_ELEMENT = "stackTraceElement";
private static final String ID_LINE = "stackTraceElementLine";
@@ -61,25 +65,34 @@ public class ExceptionStackTracePanel extends Panel {
// to avoid potential XSS attacks, no longer escape model strings
// (risk is low but could just happen: error message being rendered might accidentally or deliberately contain rogue Javascript)
// label.setEscapeModelStrings(false);
-
add(label);
final String ticketDetail = ticket != null ? ticket.getDetails(): null;
if(ticketDetail == null) {
- Components.permanentlyHide(this, ID_USER_DETAIL);
+ Components.permanentlyHide(this, ID_TICKET_DETAILS_DIV);
} else {
- final WebMarkupContainer panel = new WebMarkupContainer(ID_USER_DETAIL);
- final MultiLineLabel details = new MultiLineLabel(ID_DETAILS, Model.of(ticketDetail));
+ final WebMarkupContainer panel = new WebMarkupContainer(ID_TICKET_DETAILS_DIV);
+ final MultiLineLabel details = new MultiLineLabel(ID_TICKET_DETAILS, Model.of(ticketDetail));
panel.add(details);
add(panel);
}
+ final String ticketReference = ticket != null ? ticket.getReference(): null;
+ if(ticketReference == null) {
+ Components.permanentlyHide(this, ID_TICKET_REFERENCE_DIV);
+ } else {
+ final WebMarkupContainer panel = new WebMarkupContainer(ID_TICKET_REFERENCE_DIV);
+ final Label reference = new Label(ID_TICKET_REFERENCE, Model.of(ticketReference));
+ panel.add(reference);
+ add(panel);
+ }
+
final boolean suppressExceptionDetail = exceptionModel.isAuthorizationException() || exceptionModel.isRecognized();
if(suppressExceptionDetail) {
- Components.permanentlyHide(this, ID_EXCEPTION_DETAIL);
+ Components.permanentlyHide(this, ID_EXCEPTION_DETAIL_DIV);
} else {
- MarkupContainer container = new WebMarkupContainer(ID_EXCEPTION_DETAIL) {
+ MarkupContainer container = new WebMarkupContainer(ID_EXCEPTION_DETAIL_DIV) {
private static final long serialVersionUID = 1L;
@Override
public void renderHead(IHeaderResponse response) {