001: /**
002: * Copyright (c) 2004 Red Hat, Inc. All rights reserved.
003: *
004: * This library is free software; you can redistribute it and/or
005: * modify it under the terms of the GNU Lesser General Public
006: * License as published by the Free Software Foundation; either
007: * version 2.1 of the License, or any later version.
008: *
009: * This library 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 GNU
012: * Lesser General Public License for more details.
013: *
014: * You should have received a copy of the GNU Lesser General Public
015: * License along with this library; if not, write to the Free Software
016: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
017: * USA
018: *
019: * Component of: Red Hat Application Server
020: *
021: * Initial Developers: Aizaz Ahmed
022: * Vivek Lakshmanan
023: * Andrew Overholt
024: * Matthew Wringe
025: *
026: */package olstore.form;
027:
028: import java.util.Vector;
029:
030: import olstore.dto.PictureValue;
031: import olstore.dto.PropertyValue;
032:
033: public class CreateItemForm extends DemoBaseForm {
034:
035: private String ItemId = null;
036: private String Name = null;
037: private String Price = null;
038: private String ShortDesc = null;
039: private String LongDesc = null;
040: private String TypeId = null;
041: private Boolean MainPage = new Boolean(false);
042: private Boolean SpecialOffer = new Boolean(false);
043:
044: private String NumPics = null;
045: private String NumProps = null;
046: private String Submit = null;
047:
048: private Vector Properties = new Vector();
049: private Vector Pictures = new Vector();
050:
051: public String getItemId() {
052: return this .ItemId;
053: }
054:
055: public void setItemId(String itemId) {
056: this .ItemId = itemId;
057: }
058:
059: public String getName() {
060: return this .Name;
061: }
062:
063: public void setName(String name) {
064: this .Name = name;
065: }
066:
067: public String getPrice() {
068: return this .Price;
069: }
070:
071: public void setPrice(String price) {
072: this .Price = price;
073: }
074:
075: public String getShortDesc() {
076: return this .ShortDesc;
077: }
078:
079: public void setShortDesc(String shortDesc) {
080: this .ShortDesc = shortDesc;
081: }
082:
083: public String getLongDesc() {
084: return this .LongDesc;
085: }
086:
087: public void setLongDesc(String longDesc) {
088: this .LongDesc = longDesc;
089: }
090:
091: public String getTypeId() {
092: return this .TypeId;
093: }
094:
095: public void setTypeId(String typeId) {
096: this .TypeId = typeId;
097: }
098:
099: public Boolean getMainPage() {
100: return this .MainPage;
101: }
102:
103: public void setMainPage(Boolean mainPage) {
104: this .MainPage = mainPage;
105: }
106:
107: public Boolean getSpecialOffer() {
108: return this .SpecialOffer;
109: }
110:
111: public void setSpecialOffer(Boolean specialOffer) {
112: this .SpecialOffer = specialOffer;
113: }
114:
115: /**
116: * This autoincrements the size of the vector, so will not return null
117: * . This is necessary as the struts auto-populater expects
118: * non-null to be retured, and we don't know how many it will
119: * request.
120: * TODO: CAN LIKELY NOW CHANGE THIS TO NOT HAVE TO RETURN
121: * A CUMBERSOME ARRAY
122: */
123: public PropertyValue getProp(int index) {
124: if (index >= Properties.size()) {
125: int size = Properties.size();
126: for (int i = 0; i < (index - size) + 1; i++) {
127: Properties.add(new PropertyValue());
128: }
129: }
130: return (PropertyValue) Properties.get(index);
131: }
132:
133: public void setProp(int index, PropertyValue property) {
134: Properties.set(index, property);
135: }
136:
137: /**
138: * Returns a reference to the internal Properties, use wisely
139: */
140: public Vector getProperties() {
141: return Properties;
142: }
143:
144: public void setProperties(Vector props) {
145: Properties = props;
146: }
147:
148: /**
149: * This autoincrements the size of the vector, so will not return null
150: * . This is necessary as the struts auto-populater expects
151: * non-null to be retured, and we don't know how many it will
152: * request.
153: * TODO: CAN LIKELY NOW CHANGE THIS TO NOT HAVE TO RETURN
154: * A CUMBERSOME ARRAY
155: */
156: public PictureValue getPic(int index) {
157: if (index >= Pictures.size()) {
158: int size = Pictures.size();
159: for (int i = 0; i < (index - size) + 1; i++) {
160: Pictures.add(new PictureValue());
161: }
162: }
163: return (PictureValue) Pictures.get(index);
164: }
165:
166: public void setPic(int index, PictureValue picture) {
167: Pictures.set(index, picture);
168: }
169:
170: /**
171: * Returns a reference to the internal Pictures, use wisely
172: */
173: public Vector getPictures() {
174: return Pictures;
175: }
176:
177: public void setPictures(Vector pics) {
178: Pictures = pics;
179: }
180:
181: // Presentation specific fields
182: public String getNumPics() {
183: return this .NumPics;
184: }
185:
186: public void setNumPics(String numPics) {
187: this .NumPics = numPics;
188: }
189:
190: public String getNumProps() {
191: return this .NumProps;
192: }
193:
194: public void setNumProps(String numProps) {
195: this .NumProps = numProps;
196: }
197:
198: public String getSubmitType() {
199: return this .Submit;
200: }
201:
202: public void setSubmitType(String submit) {
203: this.Submit = submit;
204: }
205:
206: }
|