Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 53dc98e3 authored by Guillaume Thomazon's avatar Guillaume Thomazon
Browse files

PROXY-88

git-svn-id: https://scm.gforge.inria.fr/authscm/ycadoret/svn/gazelle/Maven/gazelle-proxy/trunk@44823 356b4b1a-1d2b-0410-8bf1-ffa24008f01e
parent aa93850f
No related branches found
No related tags found
No related merge requests found
......@@ -87,21 +87,44 @@
<br />
<gdk:spacer width="10" />
<h:form>
<h:commandLink
action="#{messageBean.validate()}"
target="_blank">
<h:commandLink action="#{messageBean.validate()}" target="_blank">
<h:graphicImage value="/img/validate.gif"
title="#{messages['net.ihe.gazelle.proxy.ValidateUsingEVSClient']}"
width="25" height="25" />
</h:commandLink>
</h:form>
<br />
<gdk:spacer width="10" />
<h:form id="insertButtonForm">
<a4j:commandButton value="Display in text"
styleClass="commandButton"
action="#{messageBean.setDisplayInText(true)}"
render="insertForm,insertButtonForm"
rendered="#{!messageBean.isDisplayInText()}" />
<a4j:commandButton value="Display hexdump"
styleClass="commandButton"
action="#{messageBean.setDisplayInText(false)}"
render="insertForm,insertButtonForm"
rendered="#{messageBean.isDisplayInText()}" />
</h:form>
</h:panelGrid>
<gdk:spacer height="10" />
<div style="font-family: monospace;">
<gdk:insert rendered="#{messageBean.shouldDisplayMessageContent()}"
content="#{messageBean.message.getMessageReceivedAsString()}"
highlight="xml" />
</div>
<h:form id="insertForm">
<div style="font-family: monospace;">
<gdk:insert rendered="#{messageBean.shouldDisplayMessageContent()}"
content="#{messageBean.message.getMessageReceivedAsString()}"
highlight="xml" />
<gdk:insert
rendered="#{messageBean.shouldDisplayDicomMessageContent()}"
content="#{messageBean.message.getDicomMessageReceivedAsString()}" />
<h:outputText id="text"
value="#{messageBean.message.getDumpInText()}"
rendered="#{messageBean.isDisplayInText()}" />
<gdk:insert
rendered="#{messageBean.shouldDisplayRawMessageContent()}"
content="#{messageBean.message.getRawMessageReceivedAsString()}" />
</div>
</h:form>
</rich:panel>
<br />
<br />
......
......@@ -78,6 +78,16 @@ public class MessageBean implements Serializable {
private String validatorUrl;
private boolean displayInText;
public boolean isDisplayInText() {
return displayInText;
}
public void setDisplayInText(boolean displayInText) {
this.displayInText = displayInText;
}
public AbstractMessage getMessage() {
return message;
}
......@@ -327,6 +337,26 @@ public class MessageBean implements Serializable {
return false;
}
public Boolean shouldDisplayDicomMessageContent() {
if (message instanceof DicomMessage) {
DicomMessage dicomMessage = (DicomMessage) message;
if (dicomMessage.getDicomMessageReceivedAsString() != null) {
return true;
}
}
return false;
}
public Boolean shouldDisplayRawMessageContent() {
if (message instanceof RawMessage && !isDisplayInText()) {
RawMessage rawMessage = (RawMessage) message;
if (rawMessage.getRawMessageReceivedAsString() != null) {
return true;
}
}
return false;
}
public Boolean isDownloadable() {
if (message == null || message.getMessageReceived() == null)
return false;
......@@ -357,7 +387,8 @@ public class MessageBean implements Serializable {
.instance();
String evsClientUrl = manager.getEvsClientUrl();
String toolOid = manager.getProxyOid();
EVSClientServletConnector.sendToValidation(message, extCtx, evsClientUrl, toolOid);
EVSClientServletConnector.sendToValidation(message, extCtx,
evsClientUrl, toolOid);
}
public void intResult() {
......@@ -374,7 +405,8 @@ public class MessageBean implements Serializable {
if (!(resultOidList.contains(oid))) {
resultOidList.add(oid);
message.setResultOid(resultOidList);
EntityManager entityManager = (EntityManager) Component.getInstance("entityManager");
EntityManager entityManager = (EntityManager) Component
.getInstance("entityManager");
message = entityManager.merge(message);
entityManager.flush();
} else {
......@@ -411,7 +443,8 @@ public class MessageBean implements Serializable {
}
public String getValidationPermanentLink(String oid) {
return EVSClientResults.getValidationPermanentLink(oid, getValidatorUrl());
return EVSClientResults.getValidationPermanentLink(oid,
getValidatorUrl());
}
public void redirectToMessage(AbstractMessage message) {
......@@ -496,7 +529,8 @@ public class MessageBean implements Serializable {
private String getValidatorUrl() {
if (this.validatorUrl == null) {
this.validatorUrl = ApplicationConfigurationManager.instance().getEvsClientUrl();
this.validatorUrl = ApplicationConfigurationManager.instance()
.getEvsClientUrl();
}
return this.validatorUrl;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment