| 1 package org.campware.cream.modules.screens; 2 3 42 43 import java.util.Date ; 44 import java.text.SimpleDateFormat ; 45 import java.text.DecimalFormat ; 46 import java.text.DecimalFormatSymbols ; 47 48 import org.apache.turbine.util.RunData; 49 50 import org.apache.torque.util.Criteria; 51 52 import org.apache.velocity.context.Context; 53 54 60 public class CreamUtil extends SecureScreen 61 { 62 63 private int defModuleType; 64 private String defModuleName=new String (); 65 66 protected void initScreen() 67 { 68 } 69 70 75 public void doBuildTemplate(RunData data, Context context) 76 { 77 try 78 { 79 initScreen(); 80 int entryId = data.getParameters().getInt("id"); 81 82 if (entryId>0) 83 { 84 Criteria criteria = new Criteria(); 85 getDetail(entryId, criteria, context); 86 87 context.put("mode", "update"); 88 } 89 90 context.put("df", new SimpleDateFormat ("dd.MM.yyyy")); 91 context.put("dtf", new SimpleDateFormat ("dd.MM.yyyy hh:mm:ss")); 92 93 DecimalFormatSymbols symb= new DecimalFormatSymbols (); 94 symb.setDecimalSeparator('.'); 95 96 context.put("af", new DecimalFormat ("0.00", symb)); 97 context.put("rf", new DecimalFormat ("0.000000", symb)); 98 context.put("today", new Date ()); 99 } 100 catch (Exception e) 101 { 102 } 104 } 105 106 protected boolean getDetail(int myId, Criteria criteria, Context context) 107 { 108 return false; 109 } 110 111 protected void setModuleName(String name) 112 { 113 defModuleName=name; 114 } 115 116 protected void setModuleType(int modtype) 117 { 118 defModuleType=modtype; 119 } 120 121 122 } 123 | Popular Tags |