001 /* 002 * Copyright 2007 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 getDocInfo().add(new HeaderField("DataDictionary.AttributeReferenceDummy.attributes.initiatorNetworkId", "Yahoo!")); 037 } 038 039 private TravelAccount travelAccount = new TravelAccount(); 040 041 public TravelDocumentForm2() { 042 super(); 043 this.setDocument(new TravelDocument2()); 044 } 045 046 /* 047 * Reset method - reset attributes of form retrieved from session otherwise 048 * we will always call docHandler action 049 * @param mapping 050 * @param request 051 */ 052 public void reset(ActionMapping mapping, HttpServletRequest request) { 053 this.setMethodToCall(null); 054 this.setRefreshCaller(null); 055 this.setAnchor(null); 056 this.setCurrentTabIndex(0); 057 } 058 059 public TravelAccount getTravelAccount() { 060 return travelAccount; 061 } 062 063 public void setTravelAccount(TravelAccount travelAccount) { 064 this.travelAccount = travelAccount; 065 } 066 067 }