001: // license-header java merge-point
002: package org.andromda.samples.carrental.admins.web.main;
003:
004: import org.apache.struts.action.ActionMapping;
005:
006: import javax.servlet.http.HttpServletRequest;
007: import javax.servlet.http.HttpServletResponse;
008:
009: /**
010: * @see org.andromda.samples.carrental.admins.web.main.AdministrationController
011: */
012: public class AdministrationControllerImpl extends
013: AdministrationController {
014: /**
015: * @see org.andromda.samples.carrental.admins.web.main.AdministrationController#loadCarAndCarTypes(org.apache.struts.action.ActionMapping, org.andromda.samples.carrental.admins.web.main.LoadCarAndCarTypesForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
016: */
017: public final void loadCarAndCarTypes(
018: ActionMapping mapping,
019: org.andromda.samples.carrental.admins.web.main.LoadCarAndCarTypesForm form,
020: HttpServletRequest request, HttpServletResponse response)
021: throws Exception {
022: // populating the table with a dummy list
023: form.setCars(carsDummyList);
024: // populating the table with a dummy list
025: form.setCarTypes(carTypesDummyList);
026: }
027:
028: /**
029: * This dummy variable is used to populate the "cars" table.
030: * You may delete it when you add you own code in this controller.
031: */
032: private static final java.util.Collection carsDummyList = java.util.Arrays
033: .asList(new Object[] {
034: new CarsDummy("inventoryNo-1", "registrationNo-1",
035: "id-1"),
036: new CarsDummy("inventoryNo-2", "registrationNo-2",
037: "id-2"),
038: new CarsDummy("inventoryNo-3", "registrationNo-3",
039: "id-3"),
040: new CarsDummy("inventoryNo-4", "registrationNo-4",
041: "id-4"),
042: new CarsDummy("inventoryNo-5", "registrationNo-5",
043: "id-5") });
044:
045: /**
046: * This inner class is used in the dummy implementation in order to get the web application
047: * running without any manual programming.
048: * You may delete this class when you add you own code in this controller.
049: */
050: public static final class CarsDummy implements java.io.Serializable {
051: private String inventoryNo = null;
052: private String registrationNo = null;
053: private String id = null;
054:
055: public CarsDummy(String inventoryNo, String registrationNo,
056: String id) {
057: this .inventoryNo = inventoryNo;
058: this .registrationNo = registrationNo;
059: this .id = id;
060: }
061:
062: public void setInventoryNo(String inventoryNo) {
063: this .inventoryNo = inventoryNo;
064: }
065:
066: public String getInventoryNo() {
067: return this .inventoryNo;
068: }
069:
070: public void setRegistrationNo(String registrationNo) {
071: this .registrationNo = registrationNo;
072: }
073:
074: public String getRegistrationNo() {
075: return this .registrationNo;
076: }
077:
078: public void setId(String id) {
079: this .id = id;
080: }
081:
082: public String getId() {
083: return this .id;
084: }
085:
086: }
087:
088: /**
089: * This dummy variable is used to populate the "carTypes" table.
090: * You may delete it when you add you own code in this controller.
091: */
092: private static final java.util.Collection carTypesDummyList = java.util.Arrays
093: .asList(new Object[] {
094: new CarTypesDummy("comfortClass-1", "identifier-1",
095: "manufacter-1", "id-1"),
096: new CarTypesDummy("comfortClass-2", "identifier-2",
097: "manufacter-2", "id-2"),
098: new CarTypesDummy("comfortClass-3", "identifier-3",
099: "manufacter-3", "id-3"),
100: new CarTypesDummy("comfortClass-4", "identifier-4",
101: "manufacter-4", "id-4"),
102: new CarTypesDummy("comfortClass-5", "identifier-5",
103: "manufacter-5", "id-5") });
104:
105: /**
106: * This inner class is used in the dummy implementation in order to get the web application
107: * running without any manual programming.
108: * You may delete this class when you add you own code in this controller.
109: */
110: public static final class CarTypesDummy implements
111: java.io.Serializable {
112: private String comfortClass = null;
113: private String identifier = null;
114: private String manufacter = null;
115: private String id = null;
116:
117: public CarTypesDummy(String comfortClass, String identifier,
118: String manufacter, String id) {
119: this .comfortClass = comfortClass;
120: this .identifier = identifier;
121: this .manufacter = manufacter;
122: this .id = id;
123: }
124:
125: public void setComfortClass(String comfortClass) {
126: this .comfortClass = comfortClass;
127: }
128:
129: public String getComfortClass() {
130: return this .comfortClass;
131: }
132:
133: public void setIdentifier(String identifier) {
134: this .identifier = identifier;
135: }
136:
137: public String getIdentifier() {
138: return this .identifier;
139: }
140:
141: public void setManufacter(String manufacter) {
142: this .manufacter = manufacter;
143: }
144:
145: public String getManufacter() {
146: return this .manufacter;
147: }
148:
149: public void setId(String id) {
150: this .id = id;
151: }
152:
153: public String getId() {
154: return this.id;
155: }
156:
157: }
158: }
|