001: // license-header java merge-point
002: package org.andromda.samples.carrental.contracts.web.handOut;
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.contracts.web.handOut.HandOutCarController
011: */
012: public class HandOutCarControllerImpl extends HandOutCarController {
013: /**
014: * @see org.andromda.samples.carrental.contracts.web.handOut.HandOutCarController#loadAvailableCars(org.apache.struts.action.ActionMapping, org.andromda.samples.carrental.contracts.web.handOut.LoadAvailableCarsForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
015: */
016: public final java.lang.String loadAvailableCars(
017: ActionMapping mapping,
018: org.andromda.samples.carrental.contracts.web.handOut.LoadAvailableCarsForm form,
019: HttpServletRequest request, HttpServletResponse response)
020: throws Exception {
021: // populating the table with a dummy list
022: form.setAvailableCars(availableCarsDummyList);
023: // this property receives a default value, just to have the application running on dummy data
024: form.setIdReservation("idReservation-test");
025: return null;
026: }
027:
028: /**
029: * @see org.andromda.samples.carrental.contracts.web.handOut.HandOutCarController#searchForReservationsOfCustomer(org.apache.struts.action.ActionMapping, org.andromda.samples.carrental.contracts.web.handOut.SearchForReservationsOfCustomerForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
030: */
031: public final void searchForReservationsOfCustomer(
032: ActionMapping mapping,
033: org.andromda.samples.carrental.contracts.web.handOut.SearchForReservationsOfCustomerForm form,
034: HttpServletRequest request, HttpServletResponse response)
035: throws Exception {
036: // populating the table with a dummy list
037: form.setCustomerReservations(customerReservationsDummyList);
038: }
039:
040: /**
041: * @see org.andromda.samples.carrental.contracts.web.handOut.HandOutCarController#saveSelectedCar(org.apache.struts.action.ActionMapping, org.andromda.samples.carrental.contracts.web.handOut.SaveSelectedCarForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
042: */
043: public final void saveSelectedCar(
044: ActionMapping mapping,
045: org.andromda.samples.carrental.contracts.web.handOut.SaveSelectedCarForm form,
046: HttpServletRequest request, HttpServletResponse response)
047: throws Exception {
048: // this property receives a default value, just to have the application running on dummy data
049: form.setId("id-test");
050: }
051:
052: /**
053: * This dummy variable is used to populate the "availableCars" table.
054: * You may delete it when you add you own code in this controller.
055: */
056: private static final java.util.Collection availableCarsDummyList = java.util.Arrays
057: .asList(new Object[] {
058: new AvailableCarsDummy("inventoryNo-1",
059: "registrationNo-1", "id-1"),
060: new AvailableCarsDummy("inventoryNo-2",
061: "registrationNo-2", "id-2"),
062: new AvailableCarsDummy("inventoryNo-3",
063: "registrationNo-3", "id-3"),
064: new AvailableCarsDummy("inventoryNo-4",
065: "registrationNo-4", "id-4"),
066: new AvailableCarsDummy("inventoryNo-5",
067: "registrationNo-5", "id-5") });
068:
069: /**
070: * This inner class is used in the dummy implementation in order to get the web application
071: * running without any manual programming.
072: * You may delete this class when you add you own code in this controller.
073: */
074: public static final class AvailableCarsDummy implements
075: java.io.Serializable {
076: private String inventoryNo = null;
077: private String registrationNo = null;
078: private String id = null;
079:
080: public AvailableCarsDummy(String inventoryNo,
081: String registrationNo, String id) {
082: this .inventoryNo = inventoryNo;
083: this .registrationNo = registrationNo;
084: this .id = id;
085: }
086:
087: public void setInventoryNo(String inventoryNo) {
088: this .inventoryNo = inventoryNo;
089: }
090:
091: public String getInventoryNo() {
092: return this .inventoryNo;
093: }
094:
095: public void setRegistrationNo(String registrationNo) {
096: this .registrationNo = registrationNo;
097: }
098:
099: public String getRegistrationNo() {
100: return this .registrationNo;
101: }
102:
103: public void setId(String id) {
104: this .id = id;
105: }
106:
107: public String getId() {
108: return this .id;
109: }
110:
111: }
112:
113: /**
114: * This dummy variable is used to populate the "customerReservations" table.
115: * You may delete it when you add you own code in this controller.
116: */
117: private static final java.util.Collection customerReservationsDummyList = java.util.Arrays
118: .asList(new Object[] {
119: new CustomerReservationsDummy("comfortClass-1",
120: "reservationDate-1", "idReservation-1"),
121: new CustomerReservationsDummy("comfortClass-2",
122: "reservationDate-2", "idReservation-2"),
123: new CustomerReservationsDummy("comfortClass-3",
124: "reservationDate-3", "idReservation-3"),
125: new CustomerReservationsDummy("comfortClass-4",
126: "reservationDate-4", "idReservation-4"),
127: new CustomerReservationsDummy("comfortClass-5",
128: "reservationDate-5", "idReservation-5") });
129:
130: /**
131: * This inner class is used in the dummy implementation in order to get the web application
132: * running without any manual programming.
133: * You may delete this class when you add you own code in this controller.
134: */
135: public static final class CustomerReservationsDummy implements
136: java.io.Serializable {
137: private String comfortClass = null;
138: private String reservationDate = null;
139: private String idReservation = null;
140:
141: public CustomerReservationsDummy(String comfortClass,
142: String reservationDate, String idReservation) {
143: this .comfortClass = comfortClass;
144: this .reservationDate = reservationDate;
145: this .idReservation = idReservation;
146: }
147:
148: public void setComfortClass(String comfortClass) {
149: this .comfortClass = comfortClass;
150: }
151:
152: public String getComfortClass() {
153: return this .comfortClass;
154: }
155:
156: public void setReservationDate(String reservationDate) {
157: this .reservationDate = reservationDate;
158: }
159:
160: public String getReservationDate() {
161: return this .reservationDate;
162: }
163:
164: public void setIdReservation(String idReservation) {
165: this .idReservation = idReservation;
166: }
167:
168: public String getIdReservation() {
169: return this.idReservation;
170: }
171:
172: }
173: }
|