Source Code Cross Referenced for EncumbranceLookupableHelperServiceImpl.java in  » ERP-CRM-Financial » Kuali-Financial-System » org » kuali » module » gl » web » lookupable » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » ERP CRM Financial » Kuali Financial System » org.kuali.module.gl.web.lookupable 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2006-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.gl.web.lookupable;
017:
018:        import java.util.ArrayList;
019:        import java.util.Collection;
020:        import java.util.Iterator;
021:        import java.util.List;
022:        import java.util.Map;
023:
024:        import org.kuali.core.bo.BusinessObject;
025:        import org.kuali.kfs.KFSConstants;
026:        import org.kuali.kfs.bo.GeneralLedgerPendingEntry;
027:        import org.kuali.module.gl.batch.poster.EncumbranceCalculator;
028:        import org.kuali.module.gl.bo.Encumbrance;
029:        import org.kuali.module.gl.service.EncumbranceService;
030:        import org.kuali.module.gl.util.BusinessObjectFieldConverter;
031:        import org.kuali.module.gl.util.OJBUtility;
032:        import org.kuali.module.gl.web.inquirable.EncumbranceInquirableImpl;
033:        import org.springframework.transaction.annotation.Transactional;
034:
035:        /**
036:         * An extension of KualiLookupableImpl to support encumbrance lookups
037:         */
038:        @Transactional
039:        public class EncumbranceLookupableHelperServiceImpl extends
040:                AbstractGLLookupableHelperServiceImpl {
041:
042:            private EncumbranceCalculator postEncumbrance;
043:            private EncumbranceService encumbranceService;
044:
045:            /**
046:             * Returns the url for any drill down links within the lookup
047:             * @param bo the business object with a property being drilled down on
048:             * @param propertyName the name of the property being drilled down on
049:             * @return a String with the URL of the property
050:             * @see org.kuali.core.lookup.Lookupable#getInquiryUrl(org.kuali.core.bo.BusinessObject, java.lang.String)
051:             */
052:            @Override
053:            public String getInquiryUrl(BusinessObject businessObject,
054:                    String propertyName) {
055:                return (new EncumbranceInquirableImpl()).getInquiryUrl(
056:                        businessObject, propertyName);
057:            }
058:
059:            /**
060:             * Generates the list of search results for this inquiry
061:             * @param fieldValues the field values of the query to carry out
062:             * @return List the search results returned by the lookup
063:             * @see org.kuali.core.lookup.Lookupable#getSearchResults(java.util.Map)
064:             */
065:            @Override
066:            public List getSearchResults(Map fieldValues) {
067:                setBackLocation((String) fieldValues
068:                        .get(KFSConstants.BACK_LOCATION));
069:                setDocFormKey((String) fieldValues
070:                        .get(KFSConstants.DOC_FORM_KEY));
071:
072:                // get the pending entry option. This method must be prior to the get search results
073:                String pendingEntryOption = this 
074:                        .getSelectedPendingEntryOption(fieldValues);
075:
076:                // get the search result collection
077:                Iterator encumbranceIterator = encumbranceService
078:                        .findOpenEncumbrance(fieldValues);
079:                Collection searchResultsCollection = this 
080:                        .buildEncumbranceCollection(encumbranceIterator);
081:
082:                // update search results according to the selected pending entry option
083:                updateByPendingLedgerEntry(searchResultsCollection,
084:                        fieldValues, pendingEntryOption, false, false);
085:
086:                // get the actual size of all qualified search results
087:                Integer recordCount = encumbranceService
088:                        .getOpenEncumbranceRecordCount(fieldValues);
089:                Long actualSize = OJBUtility.getResultActualSize(
090:                        searchResultsCollection, recordCount, fieldValues,
091:                        new Encumbrance());
092:
093:                return this .buildSearchResultList(searchResultsCollection,
094:                        actualSize);
095:            }
096:
097:            /**
098:             * Updates pending entries before their results are included in the lookup results
099:             * 
100:             * @param entryCollection a collection of balance entries
101:             * @param fieldValues the map containing the search fields and values
102:             * @param isApproved flag whether the approved entries or all entries will be processed
103:             * @param isConsolidated flag whether the results are consolidated or not
104:             * @param isCostShareExcluded flag whether the user selects to see the results with cost share subaccount
105:             * @see org.kuali.module.gl.web.lookupable.AbstractGLLookupableImpl#updateEntryCollection(java.util.Collection, java.util.Map,
106:             *      boolean, boolean, boolean)
107:             */
108:            @Override
109:            protected void updateEntryCollection(Collection entryCollection,
110:                    Map fieldValues, boolean isApproved,
111:                    boolean isConsolidated, boolean isCostShareInclusive) {
112:
113:                // convert the field names of balance object into corresponding ones of pending entry object
114:                Map pendingEntryFieldValues = BusinessObjectFieldConverter
115:                        .convertToTransactionFieldValues(fieldValues);
116:
117:                // go through the pending entries to update the encumbrance collection
118:                Iterator pendingEntryIterator = getGeneralLedgerPendingEntryService()
119:                        .findPendingLedgerEntriesForEncumbrance(
120:                                pendingEntryFieldValues, isApproved);
121:                while (pendingEntryIterator.hasNext()) {
122:                    GeneralLedgerPendingEntry pendingEntry = (GeneralLedgerPendingEntry) pendingEntryIterator
123:                            .next();
124:                    Encumbrance encumbrance = postEncumbrance.findEncumbrance(
125:                            entryCollection, pendingEntry);
126:                    postEncumbrance
127:                            .updateEncumbrance(pendingEntry, encumbrance);
128:                }
129:            }
130:
131:            /**
132:             * go through the given iterator to get encumbrances and put them into a collection
133:             * @param iterator an iterator of encumbrances
134:             * @return a collection of those encumbrances
135:             */
136:            private Collection buildEncumbranceCollection(Iterator iterator) {
137:                Collection encumbranceCollection = new ArrayList();
138:
139:                while (iterator.hasNext()) {
140:                    Encumbrance encumrbance = (Encumbrance) iterator.next();
141:                    encumbranceCollection.add(encumrbance);
142:                }
143:                return encumbranceCollection;
144:            }
145:
146:            /**
147:             * Sets the postEncumbrance attribute value.
148:             * 
149:             * @param postEncumbrance The postEncumbrance to set.
150:             */
151:            public void setPostEncumbrance(EncumbranceCalculator postEncumbrance) {
152:                this .postEncumbrance = postEncumbrance;
153:            }
154:
155:            /**
156:             * Sets the encumbranceService attribute value.
157:             * 
158:             * @param encumbranceService The encumbranceService to set.
159:             */
160:            public void setEncumbranceService(
161:                    EncumbranceService encumbranceService) {
162:                this.encumbranceService = encumbranceService;
163:            }
164:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.