001    /**
002     * Copyright 2005-2011 The Kuali Foundation
003     *
004     * Licensed under the Educational Community License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     * http://www.opensource.org/licenses/ecl2.php
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    package edu.sampleu.travel.web.form;
017    
018    import javax.servlet.http.HttpServletRequest;
019    
020    import org.apache.struts.action.ActionMapping;
021    import org.kuali.rice.kew.api.WorkflowDocument;
022    import org.kuali.rice.kns.web.struts.form.KualiTransactionalDocumentFormBase;
023    import org.kuali.rice.kns.web.ui.HeaderField;
024    
025    import edu.sampleu.travel.bo.TravelAccount;
026    import edu.sampleu.travel.document.TravelDocument2;
027    
028    public class TravelDocumentForm2 extends KualiTransactionalDocumentFormBase {
029    
030        @Override
031            public void populateHeaderFields(WorkflowDocument workflowDocument) {
032                    getDocInfo().clear();
033                    getDocInfo().addAll(getStandardHeaderFields(workflowDocument));
034                    getDocInfo().add(new HeaderField("DataDictionary.AttributeReferenceDummy.attributes.initiatorNetworkId", "Yahoo!"));
035                    getDocInfo().add(new HeaderField("DataDictionary.AttributeReferenceDummy.attributes.initiatorNetworkId", "Yahoo!"));
036            }
037    
038            private TravelAccount travelAccount = new TravelAccount();
039    
040        public TravelDocumentForm2() {
041            super();
042            this.setDocument(new TravelDocument2());
043        }
044    
045        /*
046         * Reset method - reset attributes of form retrieved from session otherwise
047         * we will always call docHandler action
048         * @param mapping
049         * @param request
050         */
051        public void reset(ActionMapping mapping, HttpServletRequest request) {
052            this.setMethodToCall(null);
053            this.setRefreshCaller(null);
054            this.setAnchor(null);
055            this.setCurrentTabIndex(0);
056        }
057    
058        public TravelAccount getTravelAccount() {
059            return travelAccount;
060        }
061    
062        public void setTravelAccount(TravelAccount travelAccount) {
063            this.travelAccount = travelAccount;
064        }
065    
066    }