Source Code Cross Referenced for ObjectCodeGlobalMaintainableImpl.java in  » ERP-CRM-Financial » Kuali-Financial-System » org » kuali » module » chart » maintenance » 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.chart.maintenance 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


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.chart.maintenance;
017:
018:        import java.util.ArrayList;
019:        import java.util.List;
020:        import java.util.Map;
021:
022:        import org.kuali.core.document.MaintenanceDocument;
023:        import org.kuali.core.document.MaintenanceLock;
024:        import org.kuali.core.maintenance.KualiGlobalMaintainableImpl;
025:        import org.kuali.kfs.KFSConstants;
026:        import org.kuali.module.chart.bo.ObjectCode;
027:        import org.kuali.module.chart.bo.ObjectCodeGlobal;
028:        import org.kuali.module.chart.bo.ObjectCodeGlobalDetail;
029:
030:        /**
031:         * This class provides some specific functionality for the {@link ObjectCodeGlobal} maintenance document refresh - sets the current
032:         * fiscal year from the {@link ObjectCodeGlobalDetail} prepareGlobalsForSave - sets the object code on each detail object in the
033:         * collection generateMaintenanceLocks - generates the appropriate maintenance locks for the {@link ObjectCode}
034:         */
035:        public class ObjectCodeGlobalMaintainableImpl extends
036:                KualiGlobalMaintainableImpl {
037:            private static String CHANGE_DETAIL_COLLECTION = "objectCodeGlobalDetails";
038:
039:            /**
040:             * This method sets the current fiscal year from the {@link ObjectCodeGlobalDetail} on the {@link ObjectCodeGlobal}
041:             * 
042:             * @see org.kuali.core.maintenance.KualiMaintainableImpl#refresh(java.lang.String, java.util.Map,
043:             *      org.kuali.core.document.MaintenanceDocument)
044:             */
045:            @Override
046:            public void refresh(String refreshCaller, Map fieldValues,
047:                    MaintenanceDocument document) {
048:                // if our detail objects have a null fiscal year we need to fill these in with the "addLine" fiscal year
049:                // otherwise we leave it alone, these should only be null when coming back from a multiple value lookup
050:                if (refreshCaller != null
051:                        && refreshCaller.equals(KFSConstants.MULTIPLE_VALUE)) {
052:                    ObjectCodeGlobal objectCodeGlobal = (ObjectCodeGlobal) document
053:                            .getDocumentBusinessObject();
054:                    ObjectCodeGlobalDetail addLineDetail = (ObjectCodeGlobalDetail) newCollectionLines
055:                            .get(CHANGE_DETAIL_COLLECTION);
056:                    int fiscalYear = addLineDetail.getUniversityFiscalYear();
057:                    for (ObjectCodeGlobalDetail detail : objectCodeGlobal
058:                            .getObjectCodeGlobalDetails()) {
059:                        if (detail.getUniversityFiscalYear() == null) {
060:
061:                            detail.setUniversityFiscalYear(fiscalYear);
062:                        }
063:                    }
064:                }
065:
066:                super .refresh(refreshCaller, fieldValues, document);
067:            }
068:
069:            //
070:            // @Override
071:            // protected List<String> getMultiValueIdentifierList(Collection maintCollection) {
072:            // List<String> identifierList = new ArrayList<String>();
073:            // for (ObjectCodeGlobalDetail bo : (Collection<ObjectCodeGlobalDetail>)maintCollection) {
074:            // identifierList.add(bo.getChartOfAccountsCode());
075:            // }
076:            // return identifierList;
077:            // }
078:
079:            // @Override
080:            // protected boolean hasBusinessObjectExistedInLookupResult(BusinessObject bo, List<String> existingIdentifierList) {
081:            // // default implementation does nothing
082:            // if (existingIdentifierList.contains(((ObjectCodeGlobalDetail)bo).getChartOfAccountsCode())) {
083:            // return true;
084:            // }
085:            // else {
086:            // return false;
087:            // }
088:            // }
089:
090:            /**
091:             * This method sets the object code on each detail object in the collection
092:             */
093:            @Override
094:            protected void prepareGlobalsForSave() {
095:                // copy the object code down from the header into the details
096:                ObjectCodeGlobal objectCodeGlobal = (ObjectCodeGlobal) getBusinessObject();
097:
098:                for (ObjectCodeGlobalDetail detail : objectCodeGlobal
099:                        .getObjectCodeGlobalDetails()) {
100:                    detail.setFinancialObjectCode(objectCodeGlobal
101:                            .getFinancialObjectCode());
102:                }
103:                super .prepareGlobalsForSave();
104:            }
105:
106:            /**
107:             * This generates the appropriate maintenance locks for the {@link ObjectCode}
108:             * 
109:             * @see org.kuali.core.maintenance.Maintainable#generateMaintenanceLocks()
110:             */
111:            @Override
112:            public List<MaintenanceLock> generateMaintenanceLocks() {
113:                ObjectCodeGlobal objectCodeGlobal = (ObjectCodeGlobal) getBusinessObject();
114:                List<MaintenanceLock> maintenanceLocks = new ArrayList();
115:
116:                for (ObjectCodeGlobalDetail detail : objectCodeGlobal
117:                        .getObjectCodeGlobalDetails()) {
118:                    MaintenanceLock maintenanceLock = new MaintenanceLock();
119:                    StringBuffer lockrep = new StringBuffer();
120:
121:                    lockrep.append(ObjectCode.class.getName()
122:                            + KFSConstants.Maintenance.AFTER_CLASS_DELIM);
123:                    lockrep.append("universityFiscalYear"
124:                            + KFSConstants.Maintenance.AFTER_FIELDNAME_DELIM);
125:                    lockrep.append(detail.getUniversityFiscalYear()
126:                            + KFSConstants.Maintenance.AFTER_VALUE_DELIM);
127:                    lockrep.append("chartOfAccountsCode"
128:                            + KFSConstants.Maintenance.AFTER_FIELDNAME_DELIM);
129:                    lockrep.append(detail.getChartOfAccountsCode()
130:                            + KFSConstants.Maintenance.AFTER_VALUE_DELIM);
131:                    lockrep.append("financialObjectCode"
132:                            + KFSConstants.Maintenance.AFTER_FIELDNAME_DELIM);
133:                    lockrep.append(detail.getFinancialObjectCode());
134:
135:                    maintenanceLock.setDocumentNumber(objectCodeGlobal
136:                            .getDocumentNumber());
137:                    maintenanceLock
138:                            .setLockingRepresentation(lockrep.toString());
139:                    maintenanceLocks.add(maintenanceLock);
140:                }
141:                return maintenanceLocks;
142:            }
143:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.