View Javadoc

1   /**
2    * Copyright 2012 The Kuali Foundation
3    *
4    * Licensed under the the Educational Community License, Version 1.0
5    * (the "License"); you may not use this file except in compliance
6    * with the License.  You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl1.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.student.contract.model.util;
17  
18  import java.io.PrintStream;
19  
20  import org.kuali.student.contract.writer.HtmlWriter;
21  
22  /**
23   * @author ocleirig
24   *
25   */
26  public class VersionLinesUtility {
27  
28  	/**
29  	 * 
30  	 */
31  	public VersionLinesUtility() {
32  		// TODO Auto-generated constructor stub
33  	}
34  
35  	public static void writeVersionTag(HtmlWriter writer, String homeLink, String otherHomeLink, String projectVersion, String formattedDate) {
36  		writeVersionTag(writer.getOut(), homeLink, otherHomeLink, projectVersion, formattedDate);
37  		
38  	}
39  	
40  	public static void writeVersionTag(PrintStream writer, String homeLink, String otherHomeLink, String projectVersion, String formattedDate) {
41  		
42  		StringBuilder builder = new StringBuilder();
43  		
44  		builder.append("<style type=\"text/css\">");
45  		
46  		builder.append("ul.horizontal-list { display: inline; list-style-type: none; margin: 0; }");
47  		builder.append("ul.horizontal-list li { display: inline; list-style-type: none; padding-right: 1em; }");
48  
49  	
50  		builder.append("</style>");
51  		
52  		builder.append("<ul class=\"horizontal-list\">");
53  		
54  		builder.append("<li>");
55  		builder.append(homeLink);
56  		builder.append("</li>");
57  		
58  		builder.append("<li>");
59  		builder.append(otherHomeLink);
60  		builder.append("</li>");
61  		
62  		builder.append("<li><b>Maven Release: </b>");
63  		builder.append(projectVersion);
64  		
65  		builder.append("</li><li><b>Contract Docs Plugin Version: </b>");
66  		
67  		String contractDocMavenVersion = VersionLinesUtility.class.getPackage().getImplementationVersion();
68  		
69          builder.append(contractDocMavenVersion);
70          
71  		builder.append("</li><li><b>Page Generated: </b>");
72  		builder.append(formattedDate);
73  		
74  		builder.append("</li></ul>");
75  		
76  		writer.println(builder.toString());
77  	}
78  }