1 package de.webman.content.attributs; 2 3 4 import com.teamkonzept.field.db.TKContentAttributeTableData; 5 import com.teamkonzept.lib.TKHashtable; 6 7 import java.util.Vector ; 8 import java.util.Date ; 9 10 11 17 18 public class ValidAttributes implements AttributeInterface 19 { 20 private Vector attributes; 21 22 public ValidAttributes() 23 { 24 attributes = new Vector (); 25 } 26 27 public void putAttribute(Attribute attr) 28 { 29 attributes.add(attr); 30 } 31 32 public boolean isGeneratable(TKHashtable options) 33 { 34 Date aktdate = new Date (); 35 36 for (int i = 0; i < attributes.size();i++) 37 { 38 Attribute attr = (Attribute) attributes.elementAt(i); 39 Date date = TKContentAttributeTableData.dateScanFormat.parse(attr.value, new java.text.ParsePosition (0)); 40 41 if (attr.name.equalsIgnoreCase("Gültig von")) 42 { 43 44 if (aktdate.before(date)) 45 return false; 46 } 47 else 48 { 49 50 if (aktdate.after(date)) 51 return false; 52 } 53 } 54 55 return true; 56 } 57 58 } | Popular Tags |