01: package com.teamkonzept.field;
02:
03: import com.teamkonzept.lib.*;
04: import com.teamkonzept.publishing.markups.*;
05: import com.teamkonzept.web.*;
06: import com.teamkonzept.field.db.*;
07:
08: public class TKAtomFieldShowIterator implements TKListIterator {
09:
10: TKListIterator oldIterator;
11: String listName;
12: TKVector valueList;
13:
14: public TKAtomFieldShowIterator(TKVector valueList,
15: TKListIterator oldIterator, String listName) {
16: this .oldIterator = oldIterator;
17: this .listName = listName;
18: this .valueList = valueList;
19: }
20:
21: public boolean apply(TKTemplate t, int i, String currListName) {
22: TKHTMLTemplate template = (TKHTMLTemplate) t;
23: if (currListName.equalsIgnoreCase(listName)) {
24: if (i >= valueList.size())
25: return false;
26: Object value = valueList.get(i);
27: template.set("SCOPE", listName);
28: template.set(listName + ".ITEM", value);
29: template.set(listName + ".IDX", String.valueOf(i + 1));
30: return true;
31: } else if (oldIterator != null) {
32: return oldIterator.apply(template, i, currListName);
33: } else {
34: return false;
35: }
36: }
37: }
|