001: /*
002: * Copyright 2007 The Kuali Foundation.
003: *
004: * Licensed under the Educational Community License, Version 1.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/ecl1.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.module.labor.service;
017:
018: import java.io.BufferedOutputStream;
019: import java.sql.Date;
020: import java.util.Collection;
021: import java.util.Iterator;
022: import java.util.List;
023: import java.util.Map;
024:
025: import org.kuali.module.gl.bo.OriginEntryGroup;
026: import org.kuali.module.gl.util.LedgerEntryHolder;
027: import org.kuali.module.gl.util.OriginEntryStatistics;
028: import org.kuali.module.gl.util.PosterOutputSummaryEntry;
029: import org.kuali.module.labor.bo.LaborOriginEntry;
030: import org.kuali.module.labor.bo.LaborTransaction;
031:
032: /**
033: * Defines methods that must be implemented by classes providing a LaborOriginEntryServiceImpl.
034: */
035: public interface LaborOriginEntryService {
036:
037: /**
038: * Get statistics from a group
039: */
040: public OriginEntryStatistics getStatistics(Integer groupId);
041:
042: /**
043: * Copy a set of entries into a new group
044: */
045: public OriginEntryGroup copyEntries(Date date, String sourceCode,
046: boolean valid, boolean process, boolean scrub,
047: Collection<LaborOriginEntry> entries);
048:
049: /**
050: * Copy a set of entries into a new group
051: */
052: public OriginEntryGroup copyEntries(Date date, String sourceCode,
053: boolean valid, boolean process, boolean scrub,
054: Iterator<LaborOriginEntry> entries);
055:
056: /**
057: * Delete entry
058: *
059: * @param oe Entry to delete
060: */
061: public void delete(LaborOriginEntry oe);
062:
063: /**
064: * Return all documents in a group
065: *
066: * @param oeg Group used to select documents
067: * @return Collection to all documents
068: */
069: public Collection<LaborOriginEntry> getDocumentsByGroup(
070: OriginEntryGroup oeg);
071:
072: /**
073: * Return all entries for a group sorted by account number for the error
074: *
075: * @param oeg
076: * @return
077: */
078: public Iterator<LaborOriginEntry> getEntriesByGroupAccountOrder(
079: OriginEntryGroup oeg);
080:
081: /**
082: * Return all entries for a group sorted for display on the pending entry report.
083: *
084: * @param oeg
085: * @return
086: */
087: public Iterator<LaborOriginEntry> getEntriesByGroupReportOrder(
088: OriginEntryGroup oeg);
089:
090: /**
091: * Return all entries for a group sorted across the columns in report from left to right.
092: *
093: * @param oeg
094: * @return
095: */
096: public Iterator<LaborOriginEntry> getEntriesByGroupListingReportOrder(
097: OriginEntryGroup oeg);
098:
099: /**
100: * Return all entries for the groups where the balance type is empty
101: *
102: * @param groups
103: * @return
104: */
105: public Iterator<LaborOriginEntry> getBadBalanceEntries(
106: Collection groups);
107:
108: /**
109: * Return all the entries for a specific document in a specific group
110: *
111: * @param oeg Group selection
112: * @param documentNumber Document number selection
113: * @param documentTypeCode Document type selection
114: * @param originCode Origin Code selection
115: * @return iterator to all the entries
116: */
117: public Collection<LaborOriginEntry> getEntriesByDocument(
118: OriginEntryGroup oeg, String documentNumber,
119: String documentTypeCode, String originCode);
120:
121: /**
122: * Take a generic transaction and save it as an origin entry in a specific group
123: *
124: * @param tran transaction to save
125: * @param group group to save the transaction
126: */
127: public void createEntry(LaborTransaction laborTran,
128: OriginEntryGroup group);
129:
130: /**
131: * Save an laborOrigin entry
132: *
133: * @param entry
134: */
135: public void save(LaborOriginEntry entry);
136:
137: /**
138: * Export all origin entries in a group to a flat text file
139: *
140: * @param filename Filename to save the text
141: * @param groupId Group to save
142: */
143: public void exportFlatFile(String filename, Integer groupId);
144:
145: /**
146: * Load a flat file of transations into the origin entry table
147: *
148: * @param filename Filename with the text
149: * @param groupSourceCode Source of the new group
150: * @param valid Valid flag for new group
151: * @param processed Process flag for new group
152: * @param scrub Scrub flag for new group
153: */
154: public void loadFlatFile(String filename, String groupSourceCode,
155: boolean valid, boolean processed, boolean scrub);
156:
157: /**
158: * Send data to an output stream
159: *
160: * @param groupId
161: * @param bw
162: */
163: public void flatFile(Integer groupId, BufferedOutputStream bw);
164:
165: /**
166: * Return all entries by searchCriteria
167: *
168: * @param searchCriteria
169: */
170: public Collection getMatchingEntriesByCollection(Map searchCriteria);
171:
172: /**
173: * Return a matched entry with entryId
174: *
175: * @param entryId
176: */
177: public LaborOriginEntry getExactMatchingEntry(Integer entryId);
178:
179: /**
180: * Get origin entries that belong to the given group
181: *
182: * @param group the given origin entry group
183: * @return origin entries that belong to the given group
184: */
185: public Iterator<LaborOriginEntry> getEntriesByGroup(
186: OriginEntryGroup group);
187:
188: /**
189: * Get origin entries that belong to the given group
190: *
191: * @param group the given origin entry group
192: * @return origin entries that belong to the given group
193: */
194: public Collection<LaborOriginEntry> getEntryCollectionByGroup(
195: OriginEntryGroup group);
196:
197: /**
198: * Get origin entries that belong to the given groups
199: *
200: * @param groups the given origin entry groups
201: * @return origin entries that belong to the given groups
202: */
203: public Iterator<LaborOriginEntry> getEntriesByGroups(
204: Collection<OriginEntryGroup> groups);
205:
206: /**
207: * Get the origin entries that belong to the given group in either the consolidation manner or not
208: *
209: * @param group the given group
210: * @param isConsolidated the flag that indicates if return origin entries in either the consolidation manner or not
211: * @return the origin entries that belong to the given group in either the consolidation manner or not
212: */
213: public Iterator<LaborOriginEntry> getEntriesByGroup(
214: OriginEntryGroup group, boolean isConsolidated);
215:
216: /**
217: * Get the origin entries that belong to the given group in either the consolidation manner or not
218: *
219: * @param group the given group
220: * @param isConsolidated the flag that indicates if return origin entries in either the consolidation manner or not
221: * @return the origin entries that belong to the given group in either the consolidation manner or not
222: */
223: public Collection<LaborOriginEntry> getConsolidatedEntryCollectionByGroup(
224: OriginEntryGroup group);
225:
226: /**
227: * get the summarized information of the entries that belong to the given entry groups
228: *
229: * @param groups the origin entry groups
230: * @return a set of summarized information of the entries within the specified groups
231: */
232: public LedgerEntryHolder getSummariedEntriesByGroups(
233: Collection<OriginEntryGroup> groups);
234:
235: /**
236: * get the summarized information of poster input entries that belong to the given entry groups
237: *
238: * @param groups the origin entry groups
239: * @return a map of summarized information of poster input entries within the specified groups
240: */
241: public Map<String, PosterOutputSummaryEntry> getPosterOutputSummaryByGroups(
242: Collection<OriginEntryGroup> groups);
243:
244: /**
245: * get the count of the origin entry collection in the given groups
246: *
247: * @param groups the given groups
248: * @return the count of the origin entry collection in the given group
249: */
250: public int getCountOfEntriesInGroups(
251: Collection<OriginEntryGroup> groups);
252:
253: /**
254: * get all entries with groupId
255: *
256: * @param groupId
257: */
258: public List<LaborOriginEntry> getEntriesByGroupId(Integer groupId);
259:
260: /**
261: * get the summarized information of the entries that belong to the entry groups with the given group id list
262: *
263: * @param groupIdList the origin entry groups
264: * @return a set of summarized information of the entries within the specified group
265: */
266: public LedgerEntryHolder getSummaryByGroupId(Collection groupIdList);
267:
268: /**
269: * get the count of the origin entry collection in the given group
270: *
271: * @param group the given group
272: * @return the count of the origin entry collection in the given group
273: */
274: public int getCountOfEntriesInSingleGroup(OriginEntryGroup group);
275:
276: }
|