Commit 09b40709 authored by Timothée Collard's avatar Timothée Collard
Browse files

[EVSCLT-872][LAST COMMIT] Fix refresh on ref edit refresh / Fix safehtml on...

[EVSCLT-872][LAST COMMIT] Fix refresh on ref edit refresh / Fix safehtml on valService / Work on revalidate
parent 9d72dcac
Pipeline #277362 failed with stages
in 4 minutes and 46 seconds
......@@ -102,6 +102,7 @@ public class ServiceConfDaoImpl implements ServiceConfDao {
public ReferencedStandard merge(ReferencedStandard selectedReferencedStandard) {
EntityManager entityManager = entityManagerFactory.createEntityManager();
selectedReferencedStandard = entityManager.merge(selectedReferencedStandard);
entityManager.flush();
return selectedReferencedStandard;
}
......
......@@ -102,7 +102,6 @@ public class ReferencedStandardBeanGui {
}
public String save() {
// FIXME not immediately refreshed after edit
selectedReferencedStandard = serviceConfManager.merge(selectedReferencedStandard);
EVSMenu.forceUpdate();
FacesMessages.instance()
......
......@@ -23,6 +23,7 @@ import org.jboss.seam.international.StatusMessage;
import org.richfaces.event.FileUploadEvent;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.*;
......@@ -182,6 +183,7 @@ public class ValidationBeanGui extends AbstractProcessingBeanGui<Validation> {
this.validationDone = validationDone;
}
// FIXME refactor > 2nd validator will be an extension
private List<String> getAllSelectedValidators() {
List<String> selectedValidators = new ArrayList<>();
if(selectedModelBasedValidatorName != null){
......@@ -195,12 +197,20 @@ public class ValidationBeanGui extends AbstractProcessingBeanGui<Validation> {
}
public void validate() {
// FIXME should be callable with an already-create validation & replace it (without calling oidGenerator)
/* FIXME should be callable with an already-created validation & replace it (without calling create & oidGenerator)
pass the query param oid to facade? Do not call create if oid != null, instead query the validation and overwrite it*/
// create validation data
HandledObject object = new HandledObject(super.getUploadedFileContent(), super.getUploadedFileName());
EVSCallerMetadata caller = super.getEvsCallerMetadata();
OwnerMetadata owner = super.getOwnerMetadata();
HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
String url = request.getRequestURL().toString();
String uri = request.getRequestURI();
final Map<String, String> urlParams = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
// FIXME query param not available at this moment
String validationOid = urlParams.get(QueryParamEvs.PROCESSING_OID);
// get all SelectedValidator
List<String> selectedValidators = getAllSelectedValidators();
for (String selectedValidator : selectedValidators) {
......@@ -210,7 +220,7 @@ public class ValidationBeanGui extends AbstractProcessingBeanGui<Validation> {
validation.setReferencedStandard(referencedStandard.getId());
validation.setValidationType(ValidationType.valueOf(referencedStandard.getValidatorType().name()));
// FIXME if more than 1 validation (ex. schematron + model-based)?
// FIXME if more than 1 validation (ex. schematron + model-based)? > extension
selectedObject = validation;
} catch (Exception e) {
FacesMessagesGenerator.logMessage(StatusMessage.Severity.ERROR, "Failed to validate with " + selectedValidator + " validator.");
......
......@@ -59,7 +59,7 @@ public class ValidationResultBeanGui extends AbstractProcessingBeanGui<Validatio
private Validation validationSelected;
private Template selectedTemplate;
private Boolean showTemplates = Boolean.FALSE;
private boolean showTemplates;
private DetailedResult detailedResult;
private final ValidationServiceFacade<Validation> validationServiceFacade;
private ValidationResultDto validationResultDto;
......@@ -77,7 +77,7 @@ public class ValidationResultBeanGui extends AbstractProcessingBeanGui<Validatio
this.validationResultDto = validationResultDto;
selectedObject = validationResultDto.getValidation();
showTemplates = Boolean.FALSE;
showTemplates = false;
selectedTemplate = null;
if(validationResultDto.isValidationDone()) {
if (selectedObject != null && StringUtils.isNotEmpty(validationResultDto.getValidatorType())) {
......
......@@ -60,7 +60,9 @@
</g:column>
<g:column filterBy="#{'description'}">
<ui:define name="header">#{messages['gazelle.evs.client.Description']}</ui:define>
<h:outputText value="#{valService.description}"/>
<span>
<g:safehtml value="#{valService.description}"/>
</span>
</g:column>
<g:column>
<ui:define name="header">#{messages['net.ihe.gazelle.evs.TargetEndpointOrPathToBinary']}</ui:define>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment