01: package com.salmonllc.jsp.tags;
02:
03: /////////////////////////
04: //$Archive: /SOFIA/SourceCode/com/salmonllc/jsp/tags/DataSourceBucketTag.java $
05: //$Author: Srufle $
06: //$Revision: 6 $
07: //$Modtime: 4/15/03 1:56a $
08: /////////////////////////
09: import com.salmonllc.sql.DataStoreBuffer;
10:
11: /**
12: * Implements the bucket tag.
13: */
14: public class DataSourceBucketTag extends BaseEmptyTag {
15: String _dataType, _format;
16:
17: /**
18: * 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.
19: */
20: public com.salmonllc.html.HtmlComponent createComponent() {
21: BaseTagHelper h = getHelper();
22: DataStoreBuffer buf = h.getDataSourceObject();
23:
24: String name = getName();
25: buf.addBucket(name, DataSourceFieldTag
26: .translateDataType(_dataType));
27: try {
28: if (_format != null)
29: buf.setFormat(name, _format);
30: } catch (Exception e) {
31: }
32:
33: return null;
34: }
35:
36: /**
37: * Returns CONV_DONT_CONVERT
38: */
39: public int getTagConvertType() {
40: return CONV_DONT_CONVERT;
41: }
42:
43: /**
44: * Release resources used by the tag.
45: */
46: public void release() {
47: super .release();
48:
49: _dataType = null;
50: _format = null;
51:
52: }
53:
54: /**
55: * Sets the fieldname attribute.
56: */
57: public void setDatatype(String value) {
58: _dataType = value;
59: }
60:
61: /**
62: * Sets the format attribute.
63: */
64: public void setFormat(String value) {
65: _format = value;
66: }
67: }
|