1 package de.webman.generator; 2 3 import com.teamkonzept.lib.*; 4 import com.teamkonzept.webman.*; 5 import java.util.*; 6 7 12 public class SiteContentIntegrationStatics 13 { 14 15 18 private GeneratorContext context; 19 20 26 private TKHashtable selectionHash; 27 28 public SiteContentIntegrationStatics (GeneratorContext context) 29 { 30 this.context = context != null ? context : GeneratorContext.setup (); 31 this.selectionHash = null; 32 } 33 34 39 public String newSelection( String type, String data, int nodeId ) 40 { 41 String key = type + data + nodeId; 42 if( selectionHash.get( key ) == null ) { 43 TKVector conts = TKWMContentSelectorReg.select( type, data, nodeId ); 44 TKVector result = new TKVector( conts.size()+1 ); 45 Enumeration e = conts.elements(); 46 while( e.hasMoreElements() ) 47 { 48 Object siteContent = context.siteContents.getContent(((Integer )e.nextElement()).intValue()); 49 if (siteContent != null) { 53 result.addElement(siteContent); 54 } 55 } 56 selectionHash.put( key, result ); 57 } 58 return key; 59 } 60 61 65 public final TKVector getSelection( String key ) 66 { 67 return (TKVector) selectionHash.get( key ); 68 } 69 70 73 public final void initSelection() 74 { 75 selectionHash = new TKHashtable(); 76 } 77 } 78
| Popular Tags
|