001    /*
002     * Copyright 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 org.kuali.kfs.module.endow.document.web.struts;
017    
018    import org.apache.struts.upload.FormFile;
019    import org.kuali.kfs.module.endow.EndowParameterKeyConstants;
020    import org.kuali.kfs.module.endow.businessobject.EndowmentAccountingLine;
021    import org.kuali.kfs.module.endow.businessobject.SourceEndowmentAccountingLine;
022    import org.kuali.kfs.module.endow.businessobject.TargetEndowmentAccountingLine;
023    import org.kuali.kfs.module.endow.document.EndowmentAccountingLinesDocumentBase;
024    import org.kuali.kfs.sys.KFSConstants;
025    import org.kuali.kfs.sys.context.SpringContext;
026    import org.kuali.kfs.sys.service.impl.KfsParameterConstants;
027    import org.kuali.rice.kns.service.KualiConfigurationService;
028    import org.kuali.rice.kns.service.ParameterService;
029    
030    /**
031     * This class...
032     */
033    public abstract class EndowmentAccountingLinesDocumentFormBase extends EndowmentTransactionLinesDocumentFormBase {
034        protected FormFile sourceFile;
035        protected FormFile targetFile;
036    
037        protected EndowmentAccountingLine newSourceAccountingLine;
038        protected EndowmentAccountingLine newTargetAccountingLine;
039    
040        /**
041         * Constructs a EndowmentAccountingLinesDocumentFormBase.java.
042         */
043        public EndowmentAccountingLinesDocumentFormBase() {
044            super();
045            newSourceAccountingLine = new SourceEndowmentAccountingLine();
046            newTargetAccountingLine = new TargetEndowmentAccountingLine();
047        }
048    
049        /**
050         * Gets the EndowmentAccountingLinesDocumentBase.
051         * 
052         * @return EndowmentAccountingLinesDocumentBase
053         */
054        public EndowmentAccountingLinesDocumentBase getEndowmentAccountingLinesDocumentBase() {
055            return (EndowmentAccountingLinesDocumentBase) getDocument();
056        }
057    
058        /**
059         * Gets the newSourceAccountingLine.
060         * 
061         * @return newSourceAccountingLine
062         */
063        public EndowmentAccountingLine getNewSourceAccountingLine() {
064            return newSourceAccountingLine;
065        }
066    
067        /**
068         * Sets the newSourceAccountingLine.
069         * 
070         * @param newSourceAccountingLine
071         */
072        public void setNewSourceAccountingLine(EndowmentAccountingLine newSourceAccountingLine) {
073            this.newSourceAccountingLine = newSourceAccountingLine;
074        }
075    
076        /**
077         * Gets the newSourceAccountingLine.
078         * 
079         * @return newSourceAccountingLine
080         */
081        public EndowmentAccountingLine getNewTargetAccountingLine() {
082            return newTargetAccountingLine;
083        }
084    
085        /**
086         * Sets the newSourceAccountingLine.
087         * 
088         * @param newTargetAccountingLine
089         */
090        public void setNewTargetAccountingLine(EndowmentAccountingLine newTargetAccountingLine) {
091            this.newTargetAccountingLine = newTargetAccountingLine;
092        }
093    
094        /**
095         * Gets the sourceFile.
096         * 
097         * @return sourceFile
098         */
099        public FormFile getSourceFile() {
100            return sourceFile;
101        }
102    
103        /**
104         * Sets the sourceFile.
105         * 
106         * @param sourceFile
107         */
108        public void setSourceFile(FormFile sourceFile) {
109            this.sourceFile = sourceFile;
110        }
111    
112        /**
113         * Gets the targetFile.
114         * 
115         * @return targetFile
116         */
117        public FormFile getTargetFile() {
118            return targetFile;
119        }
120    
121        /**
122         * Sets the targetFile.
123         * 
124         * @param targetFile
125         */
126        public void setTargetFile(FormFile targetFile) {
127            this.targetFile = targetFile;
128        }
129        
130        /**
131         * @return the URL to the accounting line import instructions
132         */
133        public String getAccountingLineImportInstructionsUrl() {
134            return SpringContext.getBean(KualiConfigurationService.class).getPropertyString(KFSConstants.EXTERNALIZABLE_HELP_URL_KEY) + SpringContext.getBean(ParameterService.class).getParameterValue(KfsParameterConstants.ENDOWMENT_DOCUMENT.class, EndowParameterKeyConstants.ENDOWMENT_ACCOUNTING_LINE_IMPORT);
135        }
136    
137    }