2 * ============LICENSE_START====================================================
\r
4 * ===========================================================================
\r
5 * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
\r
6 * ===========================================================================
\r
7 * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * you may not use this file except in compliance with the License.
\r
9 * You may obtain a copy of the License at
\r
11 * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * Unless required by applicable law or agreed to in writing, software
\r
14 * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * See the License for the specific language governing permissions and
\r
17 * limitations under the License.
\r
18 * ============LICENSE_END====================================================
\r
22 package org.onap.aaf.misc.xgen.html;
\r
24 import java.io.Writer;
\r
26 import org.onap.aaf.misc.xgen.Mark;
\r
28 public class HTML4Gen extends HTMLGen {
\r
29 private final static String DOCTYPE =
\r
31 "<!DOCTYPE HTML PUBLIC " +
\r
32 "\"-//W3C//DTD HTML 4.01 Transitional//EN\" " +
\r
33 "\"http://www.w3.org/TR/html3/loose.dtd\">";
\r
34 "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"" +
\r
35 " \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
\r
37 "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"" +
\r
38 " \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">";
\r
40 public HTML4Gen(Writer w) {
\r
45 public HTMLGen html(String ... attrib) {
\r
46 forward.println(DOCTYPE);
\r
47 return incr("html","xmlns=http://www.w3.org/1999/xhtml","xml:lang=en","lang=en");
\r
52 public Mark head() {
\r
53 Mark head = new Mark("head");
\r
59 public Mark body(String ... attrs) {
\r
60 Mark body = new Mark("body");
\r
61 incr(body,"body",attrs);
\r
66 public HTML4Gen charset(String charset) {
\r
67 forward.append("<meta http-equiv=\"Content-type\" content=\"text.hml; charset=");
\r
68 forward.append(charset);
\r
69 forward.append("\">");
\r
75 public Mark header(String ... attribs) {
\r
76 String[] a = new String[attribs.length+1];
\r
78 System.arraycopy(attribs, 0, a, 1, attribs.length);
\r
83 public Mark footer(String ... attribs) {
\r
84 String[] a = new String[attribs.length+1];
\r
86 System.arraycopy(attribs, 0, a, 1, attribs.length);
\r
91 public Mark section(String ... attribs) {
\r
92 String[] a = new String[attribs.length+1];
\r
94 System.arraycopy(attribs, 0, a, 1, attribs.length);
\r
99 public Mark article(String ... attribs) {
\r
100 String[] a = new String[attribs.length+1];
\r
102 System.arraycopy(attribs, 0, a, 1, attribs.length);
\r
107 public Mark aside(String ... attribs) {
\r
108 String[] a = new String[attribs.length+1];
\r
110 System.arraycopy(attribs, 0, a, 1, attribs.length);
\r
115 public Mark nav(String ... attribs) {
\r
116 String[] a = new String[attribs.length+1];
\r
118 System.arraycopy(attribs, 0, a, 1, attribs.length);
\r
123 // protected void importCSS(Imports imports) {
\r
124 // if(imports.css.size()==1) {
\r
125 // cssInline(imports.css.get(0));
\r
127 // text("<style type=\"text/css\">");
\r
128 // prettyln(forward);
\r
130 // for(String str : imports.css) {
\r
131 // forward.print("@import url(\"");
\r
132 // forward.print(imports.themePath(null));
\r
133 // forward.print(str);
\r
134 // forward.print("\");");
\r
135 // prettyln(forward);
\r
138 // forward.print("</style>");
\r
139 // prettyln(forward);
\r