aboutsummaryrefslogtreecommitdiff
path: root/id/server/moa-id-frontend-resources/src/main/java/at/gv/egovernment/moa/id/auth/frontend/builder/DefaultGUIFormBuilderConfiguration.java
diff options
context:
space:
mode:
Diffstat (limited to 'id/server/moa-id-frontend-resources/src/main/java/at/gv/egovernment/moa/id/auth/frontend/builder/DefaultGUIFormBuilderConfiguration.java')
-rw-r--r--id/server/moa-id-frontend-resources/src/main/java/at/gv/egovernment/moa/id/auth/frontend/builder/DefaultGUIFormBuilderConfiguration.java120
1 files changed, 120 insertions, 0 deletions
diff --git a/id/server/moa-id-frontend-resources/src/main/java/at/gv/egovernment/moa/id/auth/frontend/builder/DefaultGUIFormBuilderConfiguration.java b/id/server/moa-id-frontend-resources/src/main/java/at/gv/egovernment/moa/id/auth/frontend/builder/DefaultGUIFormBuilderConfiguration.java
new file mode 100644
index 000000000..2c2792b84
--- /dev/null
+++ b/id/server/moa-id-frontend-resources/src/main/java/at/gv/egovernment/moa/id/auth/frontend/builder/DefaultGUIFormBuilderConfiguration.java
@@ -0,0 +1,120 @@
+/*
+ * Copyright 2014 Federal Chancellery Austria
+ * MOA-ID has been developed in a cooperation between BRZ, the Federal
+ * Chancellery Austria - ICT staff unit, and Graz University of Technology.
+ *
+ * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+ * the European Commission - subsequent versions of the EUPL (the "Licence");
+ * You may not use this work except in compliance with the Licence.
+ * You may obtain a copy of the Licence at:
+ * http://www.osor.eu/eupl/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the Licence is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the Licence for the specific language governing permissions and
+ * limitations under the Licence.
+ *
+ * This product combines work with different licenses. See the "NOTICE" text
+ * file for details on the various modules and licenses.
+ * The "NOTICE" text file is part of the distribution. Any derivative works
+ * that you distribute must include a readable copy of the "NOTICE" text file.
+ */
+package at.gv.egovernment.moa.id.auth.frontend.builder;
+
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+
+import at.gv.egovernment.moa.id.commons.api.IRequest;
+
+/**
+ * This class builds MOA-ID GUI forms from default resource paths
+ *
+ * @author tlenz
+ *
+ */
+public class DefaultGUIFormBuilderConfiguration extends AbstractGUIFormBuilderConfiguration {
+
+ public static final String VIEW_REDIRECT = "redirectForm.html";
+ public static final String VIEW_ERRORMESSAGE = "error_message.html";
+ public static final String VIEW_SINGLELOGOUT = "slo_template.html";
+ public static final String VIEW_SSO_SESSION_TRANSFER = "sso_transfer_template.html";
+
+ private IRequest pendingReq;
+ private Map<String, Object> customParameters = null;
+
+
+ /**
+ * @param authURL PublicURLPrefix of the IDP but never null
+ * @param viewName Name of the template (with suffix) but never null
+ * @param formSubmitEndpoint EndPoint on which the form should be submitted,
+ * or null if the form must not submitted
+ */
+ public DefaultGUIFormBuilderConfiguration(String authURL, String viewName, String formSubmitEndpoint) {
+ super(authURL, viewName, formSubmitEndpoint);
+ }
+
+ /**
+ * @param Current processed pending-request DAO but never null
+ * @param viewName Name of the template (with suffix) but never null
+ * @param formSubmitEndpoint EndPoint on which the form should be submitted,
+ * or null if the form must not submitted
+ */
+ public DefaultGUIFormBuilderConfiguration(IRequest pendingReq, String viewName, String formSubmitEndpoint) {
+ super(pendingReq.getAuthURL(), viewName, formSubmitEndpoint);
+ this.pendingReq = pendingReq;
+
+
+ }
+
+ public void putCustomParameter(String key, Object value) {
+ if (customParameters == null)
+ customParameters = new HashMap<String, Object>();
+
+ customParameters.put(key, value);
+ }
+
+ /* (non-Javadoc)
+ * @see at.gv.egovernment.moa.id.auth.frontend.builder.IGUIBuilderConfiguration#getViewParameters()
+ */
+ @Override
+ public Map<String, Object> getSpecificViewParameters() {
+ Map<String, Object> params = new HashMap<String, Object>();
+ if (pendingReq != null) {
+ params.put(PARAM_PENDINGREQUESTID, pendingReq.getRequestID());
+
+ }
+ if (customParameters != null)
+ params.putAll(customParameters);
+
+ return params;
+ }
+
+ /* (non-Javadoc)
+ * @see at.gv.egovernment.moa.id.auth.frontend.AbstractGUIFormBuilder#getTemplate(java.lang.String)
+ */
+ @Override
+ public InputStream getTemplate(String viewName) {
+ return null;
+
+ }
+
+ /* (non-Javadoc)
+ * @see at.gv.egovernment.moa.id.auth.frontend.AbstractGUIFormBuilder#getContentType()
+ */
+ @Override
+ public String getDefaultContentType() {
+ return null;
+
+ }
+
+ /* (non-Javadoc)
+ * @see at.gv.egovernment.moa.id.auth.frontend.AbstractGUIFormBuilder#getClasspathTemplateDir()
+ */
+ @Override
+ public String getClasspathTemplateDir() {
+ return null;
+
+ }
+}