/******************************************************************************* * 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. ******************************************************************************/ /* * Copyright 2003 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.builder; import at.gv.egovernment.moa.id.auth.exception.BuildException; /** * Builder for HTML form requesting a security layer request * * @author Peter Danner * @version $Id: GetIdentityLinkFormBuilder.java 769 2007-01-10 15:37:52Z peter.danner $ */ public class GetVerifyAuthBlockFormBuilder extends Builder { /** private static String NL contains the NewLine representation in Java*/ private static final String nl = "\n"; /** special tag in the HTML template to be substituted for the BKU URL */ private static final String BKU_TAG = ""; /** special tag in the HTML template to be substituted for the XML request */ private static final String XMLREQUEST_TAG = ""; /** special tag in the HTML template to be substituted for the data URL */ private static final String DATAURL_TAG = ""; /** special tag in the HTML template to be substituted for the infoboxes to be pushed from the BKU */ private static final String PUSHINFOBOX_TAG = ""; /** private static int all contains the representation to replace all tags*/ private static final int ALL = -1; /** default HTML template */ private static final String DEFAULT_HTML_TEMPLATE = "" + nl + " " + nl + " " + nl + " Signatur der Anmeldedaten" + nl + " " + nl + " " + nl + " " + nl + "
" + nl + " " + nl + " " + nl + " " + nl + " " + nl + "
" + nl + " " + nl + ""; /** * Constructor for GetVerifyAuthBlockFormBuilder. */ public GetVerifyAuthBlockFormBuilder() { super(); } /** * Builds the HTML form, including XML Request and data URL as parameters. * * @param htmlTemplate template to be used for the HTML form; * may be null, in this case a default layout will be produced * @param xmlRequest XML Request to be sent as a parameter in the form * @param bkuURL URL of the "Bürgerkartenumgebung" the form will be submitted to; * may be null, in this case the default URL will be used * @param dataURL DataURL to be sent as a parameter in the form */ public String build( String htmlTemplate, String bkuURL, String xmlRequest, String dataURL, String pushInfobox) throws BuildException { String htmlForm = htmlTemplate == null ? DEFAULT_HTML_TEMPLATE : htmlTemplate; htmlForm = replaceTag(htmlForm, BKU_TAG, bkuURL, true, ALL); htmlForm = replaceTag(htmlForm, XMLREQUEST_TAG, GetIdentityLinkFormBuilder.encodeParameter(xmlRequest), true, ALL); htmlForm = replaceTag(htmlForm, DATAURL_TAG, dataURL, true, ALL); if (null==pushInfobox) pushInfobox=""; htmlForm = replaceTag(htmlForm, PUSHINFOBOX_TAG, pushInfobox, false, ALL); return htmlForm; } }