001: //** Copyright Statement ***************************************************
002: //The Salmon Open Framework for Internet Applications (SOFIA)
003: // Copyright (C) 1999 - 2002, Salmon LLC
004: //
005: // This program is free software; you can redistribute it and/or
006: // modify it under the terms of the GNU General Public License version 2
007: // as published by the Free Software Foundation;
008: //
009: // This program is distributed in the hope that it will be useful,
010: // but WITHOUT ANY WARRANTY; without even the implied warranty of
011: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
012: // GNU General Public License for more details.
013: //
014: // You should have received a copy of the GNU General Public License
015: // along with this program; if not, write to the Free Software
016: // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
017: //
018: // For more information please visit http://www.salmonllc.com
019: //** End Copyright Statement ***************************************************
020: package com.salmonllc.jsp.tags;
021:
022: ////////////////////////////////////////////////////////////
023: //$Archive: /SOFIA/SourceCode/com/salmonllc/jsp/tags/BrandingImageTag.java $
024: //$Author: Srufle $
025: //$Revision: 10 $
026: //$Modtime: 4/15/03 1:56a $
027: ////////////////////////////////////////////////////////////
028:
029: import com.salmonllc.html.HtmlComponent;
030: import com.salmonllc.jsp.JspBrandingImage;
031: import com.salmonllc.util.Util;
032:
033: /**
034: * This tag is used to create a branding image
035: * @see com.salmonllc.jsp.JspBrandingImage
036: */
037: public class BrandingImageTag extends BaseEmptyTag {
038: private String _fTableName;
039: private String _fImageColumn;
040: private String _fImageAltColumn;
041: private String _fImageDir;
042:
043: /**
044: * This method is used to create the Branding Image, and set the appropriate
045: * parameters or values that are used in constructing this component.
046: */
047:
048: public HtmlComponent createComponent() {
049: BaseTagHelper h = getHelper();
050: JspBrandingImage ret = new JspBrandingImage(getName(), h
051: .getController());
052:
053: String tableName = getTablename();
054: if (tableName != null) {
055: ret.setTableName(tableName);
056: }
057:
058: String imageColumn = getImagecolumn();
059: if (imageColumn != null) {
060: ret.setImageColumn(imageColumn);
061: }
062:
063: String imageAltColumn = getImagealtcolumn();
064: if (imageAltColumn != null) {
065: ret.setImageAltColumn(imageAltColumn);
066: }
067:
068: String imageDir = getImagedir();
069: if (imageDir != null && !Util.isEmpty(imageDir)) {
070: ret.setImageDir(imageDir);
071: }
072:
073: return ret;
074: }
075:
076: /**
077: * This method is used to get the name of the DataBase Table column that
078: * stores the alt String for each image from the optional tag "imagealtcolumn".
079: * @return java.lang.String
080: */
081: public String getImagealtcolumn() {
082: return _fImageAltColumn;
083: }
084:
085: /**
086: * This method is used to get the name of the DataBase Table column that
087: * stores the names of the images from the optional tag "imagecolumn".
088: * @return java.lang.String
089: */
090: public String getImagecolumn() {
091: return _fImageColumn;
092: }
093:
094: /**
095: * This methos gets the directory in which images are stored on the filesystem
096: * from the optional tag "imagedir".
097: * @return java.lang.String
098: */
099: public java.lang.String getImagedir() {
100: return _fImageDir;
101: }
102:
103: /**
104: * This method gets the name of the DataBase Table from the optional tag
105: * "tablename".
106: * @return java.lang.String
107: */
108: public java.lang.String getTablename() {
109: return _fTableName;
110: }
111:
112: /**
113: * This method sets the name of the DataBase Table's column used to hold the
114: * alt String for each branding image by getting the value from the optional
115: * tag "imagealtcolumn".
116: * @param ImageColumn java.lang.String
117: */
118: public void setImagealtcolumn(String ImageAltColumn) {
119: _fImageAltColumn = ImageAltColumn;
120: }
121:
122: /**
123: * This method sets the name of the DataBase Table's column used to hold the
124: * names of the branding images by getting the value from the optional
125: * tag "imagecolumn".
126: * @param ImageColumn java.lang.String
127: */
128: public void setImagecolumn(String ImageColumn) {
129: _fImageColumn = ImageColumn;
130: }
131:
132: /**
133: * This method is used to set the directory of the images to the value in the
134: * optional tag "imagedir".
135: * @param newImageDir java.lang.String
136: */
137: public void setImagedir(java.lang.String newImageDir) {
138: _fImageDir = newImageDir;
139: }
140:
141: /**
142: * This method is used to set the DataBase Table Name from the value in
143: * the optional tag "tablename"
144: * @param TableName java.lang.String
145: */
146: public void setTablename(java.lang.String TableName) {
147: _fTableName = TableName;
148: }
149: }
|