1 31 32 package org.opencms.report; 33 34 import java.util.Locale ; 35 36 48 public class CmsShellReport extends A_CmsReport { 49 50 55 public CmsShellReport(Locale locale) { 56 57 init(locale, null); 58 } 59 60 63 public synchronized String getReportUpdate() { 64 65 return ""; 66 } 67 68 71 public synchronized void print(String value, int format) { 72 73 StringBuffer buf; 74 switch (format) { 75 case FORMAT_HEADLINE: 76 buf = new StringBuffer (); 77 buf.append("------ "); 78 buf.append(value); 79 System.out.print(buf); 80 break; 81 case FORMAT_WARNING: 82 buf = new StringBuffer (); 83 buf.append("!!! "); 84 buf.append(value); 85 System.out.print(buf); 86 addWarning(value); 87 break; 88 case FORMAT_ERROR: 89 buf = new StringBuffer (); 90 buf.append("!!! "); 91 buf.append(value); 92 System.out.print(buf); 93 addError(value); 94 break; 95 case FORMAT_NOTE: 96 case FORMAT_OK: 97 case FORMAT_DEFAULT: 98 default: 99 System.out.print(value); 100 } 101 } 102 103 106 public synchronized void println() { 107 108 System.out.println(); 109 } 110 111 114 public synchronized void println(Throwable t) { 115 116 StringBuffer buf = new StringBuffer (); 117 buf.append(getMessages().key(Messages.RPT_EXCEPTION_0)); 118 buf.append(t.getMessage()); 119 this.println(new String (buf), FORMAT_ERROR); 120 t.printStackTrace(System.out); 121 } 122 } | Popular Tags |