001 /** 002 * Copyright 2012 The Kuali Foundation 003 * 004 * Licensed under the the Educational Community License, Version 1.0 005 * (the "License"); you may not use this file except in compliance 006 * with the License. You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl1.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 package org.kuali.student.contract.model.util; 017 018 import java.io.PrintStream; 019 020 import org.kuali.student.contract.writer.HtmlWriter; 021 022 /** 023 * @author ocleirig 024 * 025 */ 026 public class VersionLinesUtility { 027 028 /** 029 * 030 */ 031 public VersionLinesUtility() { 032 // TODO Auto-generated constructor stub 033 } 034 035 public static void writeVersionTag(HtmlWriter writer, String homeLink, String otherHomeLink, String projectVersion, String formattedDate) { 036 writeVersionTag(writer.getOut(), homeLink, otherHomeLink, projectVersion, formattedDate); 037 038 } 039 040 public static void writeVersionTag(PrintStream writer, String homeLink, String otherHomeLink, String projectVersion, String formattedDate) { 041 042 StringBuilder builder = new StringBuilder(); 043 044 builder.append("<style type=\"text/css\">"); 045 046 builder.append("ul.horizontal-list { display: inline; list-style-type: none; margin: 0; }"); 047 builder.append("ul.horizontal-list li { display: inline; list-style-type: none; padding-right: 1em; }"); 048 049 050 builder.append("</style>"); 051 052 builder.append("<ul class=\"horizontal-list\">"); 053 054 builder.append("<li>"); 055 builder.append(homeLink); 056 builder.append("</li>"); 057 058 builder.append("<li>"); 059 builder.append(otherHomeLink); 060 builder.append("</li>"); 061 062 builder.append("<li><b>Maven Release: </b>"); 063 builder.append(projectVersion); 064 065 builder.append("</li><li><b>Page Generated: </b>"); 066 builder.append(formattedDate); 067 068 builder.append("</li></ul>"); 069 070 writer.println(builder.toString()); 071 } 072 }