01: package com.salmonllc.jsp.tags;
02:
03: /////////////////////////
04: //$Archive: /JADE/SourceCode/com/salmonllc/jsp/tags/DataSourceSelectionTag.java $
05: //$Author: Srufle $
06: //$Revision: 7 $
07: //$Modtime: 7/31/02 6:11p $
08: /////////////////////////
09:
10: import com.salmonllc.sql.AutoRetrieveCriteria;
11: import com.salmonllc.sql.DataStoreBuffer;
12: import com.salmonllc.sql.DataStore;
13:
14: /**
15: * Implements the selection tag.
16: */
17: public class DataSourceSelectionTag extends DataSourceNestedTag {
18: AutoRetrieveCriteria _crit;
19:
20: /**
21: * This method can be used by tags that need to change a datastore after all the sub tags have been initialized.
22: */
23: public void afterInit(DataStoreBuffer comp) {
24: if (comp instanceof DataStore) {
25: for (int i = 0; i < _crit.getCriteriaCount(); i++)
26: _crit.setColumn(i, ((DataStore) comp)
27: .computeTableAndFieldName(_crit.getColumn(i)));
28: }
29: comp.setAutoRetrieveCriteria(_crit);
30:
31: }
32:
33: /**
34: * This method must be implemented by each subclass of this tag. Each tag except NestedTags has an Html or Jsp Component associated with it. This method must be implemented to insure that the correct component gets created.
35: */
36: public com.salmonllc.html.HtmlComponent createComponent() {
37: _crit = new AutoRetrieveCriteria();
38: return null;
39: }
40:
41: /**
42: * Returns the object AutoRetrieveCriteria Object
43: */
44: public AutoRetrieveCriteria getAutoRetrieveCriteria() {
45: return _crit;
46: }
47:
48: /**
49: * Returns CONV_DONT_CONVERT
50: */
51: public int getTagConvertType() {
52: return CONV_DONT_CONVERT;
53: }
54:
55: /**
56: * Release resources used by the tag.
57: */
58: public void release() {
59: super.release();
60: _crit = null;
61:
62: }
63: }
|