From 82efa7f7b2f4b1079d01d0f9c0a2b4ca43e9a24d Mon Sep 17 00:00:00 2001 From: Instrumental Date: Mon, 26 Mar 2018 11:37:12 -0700 Subject: Remove Code from inno, it is now in authz Issue-ID: AAF-193 Change-Id: I5b80daa8344559bc86c82cbaa85c29e0eea54ebb Signed-off-by: Instrumental --- .../main/java/org/onap/aaf/xgen/html/HTMLGen.java | 241 --------------------- 1 file changed, 241 deletions(-) delete mode 100644 xgen/src/main/java/org/onap/aaf/xgen/html/HTMLGen.java (limited to 'xgen/src/main/java/org/onap/aaf/xgen/html/HTMLGen.java') diff --git a/xgen/src/main/java/org/onap/aaf/xgen/html/HTMLGen.java b/xgen/src/main/java/org/onap/aaf/xgen/html/HTMLGen.java deleted file mode 100644 index 1f4bffd..0000000 --- a/xgen/src/main/java/org/onap/aaf/xgen/html/HTMLGen.java +++ /dev/null @@ -1,241 +0,0 @@ -/******************************************************************************* - * ============LICENSE_START==================================================== - * * org.onap.aaf - * * =========================================================================== - * * Copyright © 2017 AT&T Intellectual Property. All rights reserved. - * * =========================================================================== - * * Licensed under the Apache License, Version 2.0 (the "License"); - * * you may not use this file except in compliance with the License. - * * You may obtain a copy of the License at - * * - * * http://www.apache.org/licenses/LICENSE-2.0 - * * - * * Unless required by applicable law or agreed to in writing, software - * * distributed under the License is distributed on an "AS IS" BASIS, - * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * * See the License for the specific language governing permissions and - * * limitations under the License. - * * ============LICENSE_END==================================================== - * * - * * ECOMP is a trademark and service mark of AT&T Intellectual Property. - * * - ******************************************************************************/ -package org.onap.aaf.xgen.html; - -import java.io.Writer; - -import org.onap.aaf.xgen.Mark; -import org.onap.aaf.xgen.XGen; - -public abstract class HTMLGen extends XGen { - public static final String A = "a"; - public static final String P = "p"; - public static final String LI = "li"; - public static final String OL = "ol"; - public static final String UL = "ul"; - - - public static final String TABLE = "table"; - public static final String THEAD = "thead"; - public static final String TBODY = "tbody"; - public static final String TR = "tr"; - public static final String TH = "th"; - public static final String TD = "td"; - - public static final String TITLE = "title"; - public static final String H1 = "h1"; - public static final String H2 = "h2"; - public static final String H3 = "h3"; - public static final String H4 = "h4"; - public static final String H5 = "h5"; - - - - // --------------------------- HTML Version Specific ----------------------- - public abstract HTMLGen html(String ... attributes); - public abstract HTMLGen charset(String charset); - public abstract Mark head(); - public abstract Mark body(String ... attribs); - - - // HTML 5 has simplified sectioning - public abstract Mark header(String ... attribs); - public abstract Mark footer(String ... attribs); - public abstract Mark section(String ... attribs); - public abstract Mark article(String ... attribs); - public abstract Mark aside(String ... attribs); - public abstract Mark nav(String ... attribs); - - // --------------------------- HTML Version Specific ----------------------- - - public HTMLGen imports(Imports imports) { - //this.imports=imports; - for(String str : imports.css) { - forward.print(""); - } - - for(String str : imports.js) { - forward.print(""); - } - return this; - } - - public HTMLGen jsVars(String ... attrs) { - forward.println(""); - return this; - } - - public HTMLGen(Writer w) { - super(w); - } - - /** - * Use "directive" to handle non-ended HTML tags like and - * @param tag - * @param attrs - * @return - */ - public HTMLGen directive(String tag, String ... attrs) { - forward.append('<'); - forward.append(tag); - addAttrs(attrs); - forward.append('>'); - if(pretty) { - forward.println(); - } - return this; - } - - public Mark divID(String ... attrs) { - Mark div; - if(attrs.length>0) { - div = new Mark(attrs[0]); - attrs[0]="id="+attrs[0]; - } else { - div = new Mark(); - } - incr(div, "div", attrs); - return div; - } - - public HTMLGen img(String ... attrs) { - return tagOnly("img", attrs); - } - - /** - * Input Cheesecake... creates a Label and Field in the form of Table Rows. - * Make sure you create a table first, ie. incr(HTMLGen.TABLE); - * - * Setting Required to "true" will add required Attribute to both Label and Field. In HTML5, "required" in the input will - * validate there is data in the fields before submitting. "required" does nothing for label, but allows for - * easy CSS coding... "label[required] { ... }", so that colors can be changed - * - * @param id - * @param label - * @param required - * @param attrs - * @return - */ - public HTMLGen input(String id, String label, boolean required, String ... attrs) { - Mark mtr = new Mark(TR); - Mark mtd = new Mark(TD); - incr(mtr); - incr(mtd); - incr("label",true, "for="+id,required?"required":null).text(label).end(); - end(mtd); - String nattrs[] = new String[attrs.length+(required?3:2)]; - nattrs[0]="id="+id; - nattrs[1]="name="+id; - System.arraycopy(attrs, 0, nattrs, 2, attrs.length); - if(required) { - nattrs[nattrs.length-1]="required"; - } - incr(mtd); - tagOnly("input",nattrs); - end(mtr); - return this; - } - - // Common tags that do not have standard endings. These are here to help people who don't know to pick directive - public HTMLGen br() { - forward.append("
"); - if(pretty) { - forward.println(); - } - return this; - } - - public HTMLGen p(String ... text) { - forward.append("

"); - for(String s : text) { - forward.append(s); - } - if(pretty) { - forward.println(); - } - return this; - } - - public HTMLGen hr() { - forward.append("


"); - if(pretty) { - forward.println(); - } - return this; - } - - public JSGen js(Mark mark) { - return new JSGen(mark, this); - } - - public JSGen js() { - return js(null); - } -// -// protected void cssInline(String filename) { -// File file = new File(imports.webDir,filename); -// try { -// String line; -// BufferedReader br = new BufferedReader(new FileReader(file)); -// try { -// forward.print(""); -// prettyln(forward); -// br.close(); -// } -// } catch (IOException e) { -// e.printStackTrace(); -// // Can't read, suffice to import normally? -// // for now, just skip -// } -// } - -} -- cgit 1.2.3-korg