01: /*
02: * Copyright 2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.kuali.kfs.batch;
17:
18: import org.kuali.core.bo.user.UniversalUser;
19:
20: /**
21: * Declares methods that must be implemented for batch input file type classes, which provides functionaliy needed to manage files
22: * of a certain batch type.
23: */
24: public interface BatchInputFileType extends BatchInputType {
25:
26: /**
27: * Returns the unique identifier (Spring bean id) for the batch input type.
28: */
29: public String getFileTypeIdentifer();
30:
31: /**
32: * Gives the name of the directory for which batch files of a given type are stored.
33: */
34: public String getDirectoryPath();
35:
36: /**
37: * Constructs a file name using the name given by the user and file contents if necessary. Returned name should not contain file
38: * extension.
39: *
40: * @param user - user who is uploading the file
41: * @param parsedFileContents - object populated with the uploaded file contents
42: * @param fileUserIdentifer - file identifier given by user through the batch upload UI
43: */
44: public String getFileName(UniversalUser user,
45: Object parsedFileContents, String fileUserIdentifer);
46:
47: /**
48: * Returns file extension for the batch input type.
49: */
50: public String getFileExtension();
51:
52: /**
53: * Performs specific validation on the parsed file contents. If errors were found, method will return false and
54: * GlobalVariables.errorMap will contain the error message. If no errors were encountered the method will return true.
55: *
56: * @param parsedFileContents - object populated with the uploaded file contents
57: */
58: public boolean validate(Object parsedFileContents);
59:
60: /**
61: * Returns the name with path for the digestor rules file that tells the digestor how to parse files of this type.
62: */
63: public String getDigestorRulesFileName();
64:
65: /**
66: * Returns the schema classpath location for this batch type.
67: */
68: public String getSchemaLocation();
69: }
|