diff options
author | tzefferer <tzefferer@gmail.com> | 2018-07-27 13:14:35 +0200 |
---|---|---|
committer | tzefferer <tzefferer@gmail.com> | 2018-07-27 13:14:35 +0200 |
commit | 84f5ffce2e66e52a07ef6bdcb802e268566168e0 (patch) | |
tree | 2c996d4d61511886804c83a9133b9d75ed635e48 /connector_lib/src/main/java/at/asitplus/eidas/specific/connector/gui/DefaultGUIBuilderImpl.java | |
parent | a3e019e87d78e17f24c170f7ef6a08d40ebfb232 (diff) | |
parent | 6d09f43225ba2e0f6d7b0583f843c858a1015807 (diff) | |
download | National_eIDAS_Gateway-84f5ffce2e66e52a07ef6bdcb802e268566168e0.tar.gz National_eIDAS_Gateway-84f5ffce2e66e52a07ef6bdcb802e268566168e0.tar.bz2 National_eIDAS_Gateway-84f5ffce2e66e52a07ef6bdcb802e268566168e0.zip |
Merge branch 'master' of gitlab.iaik.tugraz.at:egiz/eidas_at_proxy
# Conflicts:
# eidas_modules/authmodule-eIDAS-v2/src/test/java/at/asitplus/test/eidas/specific/modules/authmodule_eIDASv2/SZRClientTest.java
Diffstat (limited to 'connector_lib/src/main/java/at/asitplus/eidas/specific/connector/gui/DefaultGUIBuilderImpl.java')
-rw-r--r-- | connector_lib/src/main/java/at/asitplus/eidas/specific/connector/gui/DefaultGUIBuilderImpl.java | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/connector_lib/src/main/java/at/asitplus/eidas/specific/connector/gui/DefaultGUIBuilderImpl.java b/connector_lib/src/main/java/at/asitplus/eidas/specific/connector/gui/DefaultGUIBuilderImpl.java new file mode 100644 index 00000000..ed1ceb78 --- /dev/null +++ b/connector_lib/src/main/java/at/asitplus/eidas/specific/connector/gui/DefaultGUIBuilderImpl.java @@ -0,0 +1,43 @@ +package at.asitplus.eidas.specific.connector.gui; + +import java.io.InputStream; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +import at.gv.egiz.eaaf.core.api.gui.IGUIBuilderConfiguration; +import at.gv.egiz.eaaf.core.api.gui.IGUIFormBuilder; +import at.gv.egiz.eaaf.core.exceptions.GUIBuildException; +import at.gv.egiz.eaaf.core.impl.gui.AbstractGUIFormBuilderImpl; + +@Service("DefaultGUIBuilderImpl") +public class DefaultGUIBuilderImpl extends AbstractGUIFormBuilderImpl implements IGUIFormBuilder { + private static final Logger log = LoggerFactory.getLogger(DefaultGUIBuilderImpl.class); + + private static final String CLASSPATH_HTMLTEMPLATES_DIR = "templates/"; + + public DefaultGUIBuilderImpl() throws GUIBuildException { + super(); + + } + + @Override + protected InputStream getInternalTemplate(IGUIBuilderConfiguration config) throws GUIBuildException { + String viewName = config.getViewName(); + log.debug("GUI template:" + viewName + " is not found in configuration directory. " + + " Load template from project library ... "); + String pathLocation = getInternalClasspathTemplateDir(config, CLASSPATH_HTMLTEMPLATES_DIR) + viewName; + try { + InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(pathLocation); + return is; + + } catch (Exception e1) { + log.error("GUI template:" + pathLocation + " is NOT loadable from classpath!", e1); + throw new GUIBuildException("GUI template:" + pathLocation + " is NOT loadable from classpath!", e1); + + } + + } + +} |