summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas <>2021-12-07 20:42:41 +0100
committerThomas <>2021-12-07 20:42:41 +0100
commitdb1cde4eb42c98c4661ec5dcf12b970ece477fcc (patch)
tree63b1043dde9b44202962c77542d470b96ddd37e6
parent92b244746fbd459ba68057af919a0d8ee5c4518a (diff)
downloadEAAF-Components-db1cde4eb42c98c4661ec5dcf12b970ece477fcc.tar.gz
EAAF-Components-db1cde4eb42c98c4661ec5dcf12b970ece477fcc.tar.bz2
EAAF-Components-db1cde4eb42c98c4661ec5dcf12b970ece477fcc.zip
change IGuiFormBuilder interface to enable pre-evaluation of response contentType without rendering
-rw-r--r--eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/gui/DummyGuiFormBuilder.java7
-rw-r--r--eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/gui/DummyVelocityGuiFormBuilder.java12
-rw-r--r--eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/gui/IGuiFormBuilder.java22
3 files changed, 33 insertions, 8 deletions
diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/gui/DummyGuiFormBuilder.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/gui/DummyGuiFormBuilder.java
index bd81169d..5e12e7bc 100644
--- a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/gui/DummyGuiFormBuilder.java
+++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/gui/DummyGuiFormBuilder.java
@@ -34,4 +34,11 @@ public class DummyGuiFormBuilder implements IGuiFormBuilder {
}
+ @Override
+ public String evaluateResponseContentType(HttpServletRequest httpReq, IGuiBuilderConfiguration config,
+ String loggerName) throws GuiBuildException {
+ return null;
+
+ }
+
}
diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/gui/DummyVelocityGuiFormBuilder.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/gui/DummyVelocityGuiFormBuilder.java
index e2cdd1ee..8fe9e2eb 100644
--- a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/gui/DummyVelocityGuiFormBuilder.java
+++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/module/gui/DummyVelocityGuiFormBuilder.java
@@ -2,6 +2,11 @@ package at.gv.egiz.eaaf.core.impl.idp.module.gui;
import java.io.InputStream;
+import javax.servlet.http.HttpServletRequest;
+
+import org.springframework.http.MediaType;
+
+import at.gv.egiz.eaaf.core.api.gui.IGuiBuilderConfiguration;
import at.gv.egiz.eaaf.core.api.gui.IVelocityGuiBuilderConfiguration;
import at.gv.egiz.eaaf.core.exceptions.GuiBuildException;
import at.gv.egiz.eaaf.core.impl.gui.AbstractVelocityGuiFormBuilderImpl;
@@ -30,6 +35,13 @@ public class DummyVelocityGuiFormBuilder extends AbstractVelocityGuiFormBuilderI
this.internalTemplate = internalTemplate;
}
+ @Override
+ public String evaluateResponseContentType(HttpServletRequest httpReq, IGuiBuilderConfiguration config,
+ String loggerName) throws GuiBuildException {
+ return MediaType.TEXT_XML_VALUE;
+
+ }
+
diff --git a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/gui/IGuiFormBuilder.java b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/gui/IGuiFormBuilder.java
index d376d17b..09c4a8b3 100644
--- a/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/gui/IGuiFormBuilder.java
+++ b/eaaf_core_api/src/main/java/at/gv/egiz/eaaf/core/api/gui/IGuiFormBuilder.java
@@ -35,10 +35,7 @@ public interface IGuiFormBuilder {
/**
* Parse a GUI template, with parameters into a http servlet-response and use
* the default http-response content-type. <br>
- * <br>
- * The parser use the <code>VelocityEngine</code> as internal template
- * evaluator.
- *
+ *
* @param httpReq http-request object
* @param httpResp http-response object
* @param config Configuration object
@@ -51,10 +48,7 @@ public interface IGuiFormBuilder {
/**
* Parse a GUI template, with parameters into a http servlet-response. <br>
- * <br>
- * The parser use the <code>VelocityEngine</code> as internal template
- * evaluator.
- *
+ *
* @param httpReq http-request object
* @param httpResp http-response object
* @param config Configuration object
@@ -66,4 +60,16 @@ public interface IGuiFormBuilder {
void build(HttpServletRequest httpReq, HttpServletResponse httpResp, IGuiBuilderConfiguration config,
String contentType, String loggerName) throws GuiBuildException;
+ /**
+ * Analyze GUI template and HTTP request to evaluate ContentType of HTTP response generated by this builder.
+ *
+ * @param httpReq http-request object
+ * @param config Configuration object
+ * @param loggerName String, which should be used from logger
+ * @return ContentType of HTTP response
+ * @throws GuiBuildException in case of an error
+ */
+ String evaluateResponseContentType(HttpServletRequest httpReq, IGuiBuilderConfiguration config,
+ String loggerName) throws GuiBuildException;
+
}