Source Code Cross Referenced for UIEntity.java in  » ERP-CRM-Financial » SourceTap-CRM » com » sourcetap » sfa » ui » 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 » SourceTap CRM » com.sourcetap.sfa.ui 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * 
003:         * Copyright (c) 2004 SourceTap - www.sourcetap.com
004:         *
005:         *  The contents of this file are subject to the SourceTap Public License 
006:         * ("License"); You may not use this file except in compliance with the 
007:         * License. You may obtain a copy of the License at http://www.sourcetap.com/license.htm
008:         * Software distributed under the License is distributed on an  "AS IS"  basis,
009:         * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
010:         * the specific language governing rights and limitations under the License.
011:         *
012:         * The above copyright notice and this permission notice shall be included
013:         * in all copies or substantial portions of the Software.
014:         *
015:         */
016:
017:        package com.sourcetap.sfa.ui;
018:
019:        import java.util.ArrayList;
020:        import java.util.HashMap;
021:        import java.util.Iterator;
022:        import java.util.List;
023:
024:        import org.ofbiz.base.util.UtilTimer;
025:        import org.ofbiz.entity.GenericDelegator;
026:        import org.ofbiz.entity.GenericEntityException;
027:        import org.ofbiz.entity.GenericValue;
028:        import org.ofbiz.entity.model.ModelEntity;
029:
030:        /**
031:         * DOCUMENT ME!
032:         *
033:         */
034:        public class UIEntity {
035:            public static final String module = UIEntity.class.getName();
036:            private static final boolean TIMER = false;
037:            protected String entityId = "";
038:            protected String entityName = "";
039:            protected String tableName = "";
040:            protected String description = "";
041:            protected String extTableName = "";
042:            protected ModelEntity modelEntity = null;
043:            protected List primaryKeyFieldNames = null;
044:            protected GenericValue genericValue = null;
045:            protected ArrayList uiAttributeList = new ArrayList();
046:
047:            public UIEntity(GenericValue uiEntityGV,
048:                    GenericDelegator delegator, UICache uiCache)
049:                    throws GenericEntityException {
050:                UtilTimer timer = new UtilTimer();
051:
052:                if (TIMER) {
053:                    timer.timerString(5, "[UIEntity.UIEntity] Start");
054:                }
055:
056:                setGenericValue(uiEntityGV);
057:
058:                //		setDelegator(delegator);
059:                setEntityId(uiEntityGV.getString("entityId"));
060:                setEntityName(uiEntityGV.getString("entityName"));
061:                setTableName(uiEntityGV.getString("tableName"));
062:                setDescription(uiEntityGV.getString("description"));
063:                setExtTableName(uiEntityGV.getString("extTableName"));
064:
065:                if (TIMER) {
066:                    timer
067:                            .timerString(5,
068:                                    "[UIEntity.UIEntity] Finished setting UI entity attributes");
069:                }
070:
071:                setModelEntity(delegator.getModelEntity(getEntityName()));
072:                setPrimaryKeyFieldNames(getModelEntity().getPkFieldNames());
073:
074:                if (TIMER) {
075:                    timer
076:                            .timerString(5,
077:                                    "[UIEntity.UIEntity] Finished setting model entity");
078:                }
079:
080:                // Get info about the UI Attributes.
081:                HashMap findMap = new HashMap();
082:                findMap.put("entityId", getEntityId());
083:
084:                List uiAttributeL = delegator.findByAnd("UiAttribute", findMap,
085:                        null);
086:
087:                if (TIMER) {
088:                    timer
089:                            .timerString(5,
090:                                    "[UIEntity.UIEntity] Finished finding UI attributes");
091:                }
092:
093:                Iterator uiAttributeI = uiAttributeL.iterator();
094:
095:                while (uiAttributeI.hasNext()) {
096:                    // Get the UIAttribute object for this attribute.
097:                    GenericValue uiAttributeGV = (GenericValue) uiAttributeI
098:                            .next();
099:                    String attributeId = uiAttributeGV.getString("attributeId");
100:
101:                    if (TIMER) {
102:                        timer
103:                                .timerString(5,
104:                                        "[UIEntity.UIEntity] Looking for UIAttribute in cache.");
105:                    }
106:
107:                    UIAttribute uiAttribute = uiCache
108:                            .getUiAttribute(attributeId);
109:
110:                    if (uiAttribute == null) {
111:                        if (TIMER) {
112:                            timer
113:                                    .timerString(5,
114:                                            "[UIEntity.UIEntity] UIAttribute not found in cache. Creating a new one.");
115:                        }
116:
117:                        uiAttribute = new UIAttribute(uiAttributeGV, delegator,
118:                                this );
119:                        uiCache.putUiAttribute(attributeId, uiAttribute);
120:                    } else {
121:                        if (TIMER) {
122:                            timer
123:                                    .timerString(5,
124:                                            "[UIEntity.UIEntity] Found UIAttribute in cache.");
125:                        }
126:                    }
127:
128:                    getUiAttributeList().add(uiAttribute);
129:                }
130:
131:                if (TIMER) {
132:                    timer.timerString(5, "[UIEntity.UIEntity] End");
133:                }
134:
135:            }
136:
137:            /**
138:             * DOCUMENT ME!
139:             *
140:             * @param entityId_ 
141:             */
142:            public void setEntityId(String entityId_) {
143:                entityId = (entityId_ == null) ? "" : entityId_;
144:            }
145:
146:            /**
147:             * DOCUMENT ME!
148:             *
149:             * @return 
150:             */
151:            public String getEntityId() {
152:                return entityId;
153:            }
154:
155:            /**
156:             * DOCUMENT ME!
157:             *
158:             * @param entityName_ 
159:             */
160:            public void setEntityName(String entityName_) {
161:                entityName = (entityName_ == null) ? "" : entityName_;
162:            }
163:
164:            /**
165:             * DOCUMENT ME!
166:             *
167:             * @return 
168:             */
169:            public String getEntityName() {
170:                return entityName;
171:            }
172:
173:            /**
174:             * DOCUMENT ME!
175:             *
176:             * @param tableName_ 
177:             */
178:            public void setTableName(String tableName_) {
179:                tableName = (tableName_ == null) ? "" : tableName_;
180:            }
181:
182:            /**
183:             * DOCUMENT ME!
184:             *
185:             * @return 
186:             */
187:            public String getTableName() {
188:                return tableName;
189:            }
190:
191:            /**
192:             * DOCUMENT ME!
193:             *
194:             * @param description_ 
195:             */
196:            public void setDescription(String description_) {
197:                description = (description_ == null) ? "" : description_;
198:            }
199:
200:            /**
201:             * DOCUMENT ME!
202:             *
203:             * @return 
204:             */
205:            public String getDescription() {
206:                return description;
207:            }
208:
209:            /**
210:             * DOCUMENT ME!
211:             *
212:             * @param extTableName_ 
213:             */
214:            public void setExtTableName(String extTableName_) {
215:                extTableName = (extTableName_ == null) ? "" : extTableName_;
216:            }
217:
218:            /**
219:             * DOCUMENT ME!
220:             *
221:             * @return 
222:             */
223:            public String getExtTableName() {
224:                return extTableName;
225:            }
226:
227:            /**
228:             * DOCUMENT ME!
229:             *
230:             * @param modelEntity_ 
231:             */
232:            public void setModelEntity(ModelEntity modelEntity_) {
233:                modelEntity = modelEntity_;
234:            }
235:
236:            /**
237:             * DOCUMENT ME!
238:             *
239:             * @return 
240:             */
241:            public ModelEntity getModelEntity() {
242:                return modelEntity;
243:            }
244:
245:            /**
246:             * DOCUMENT ME!
247:             *
248:             * @param primaryKeyFieldNames_ 
249:             */
250:            public void setPrimaryKeyFieldNames(List primaryKeyFieldNames_) {
251:                primaryKeyFieldNames = primaryKeyFieldNames_;
252:            }
253:
254:            /**
255:             * DOCUMENT ME!
256:             *
257:             * @return 
258:             */
259:            public List getPrimaryKeyFieldNames() {
260:                return primaryKeyFieldNames;
261:            }
262:
263:            //	public GenericDelegator getDelegator() {
264:            //		return delegator;
265:            //	}
266:            //	public void setDelegator(GenericDelegator delegator_) {
267:            //		delegator = delegator_;
268:            //	}
269:            public void setGenericValue(GenericValue genericValue_) {
270:                genericValue = genericValue_;
271:            }
272:
273:            /**
274:             * DOCUMENT ME!
275:             *
276:             * @return 
277:             */
278:            public GenericValue getGenericValue() {
279:                return genericValue;
280:            }
281:
282:            //	public void setUiAttributeList(List uiAttributeList_) {
283:            //		uiAttributeList = uiAttributeList_;
284:            //	}
285:            public ArrayList getUiAttributeList() {
286:                return uiAttributeList;
287:            }
288:
289:            /**
290:             * DOCUMENT ME!
291:             *
292:             * @param attributeNumber 
293:             *
294:             * @return 
295:             */
296:            public UIAttribute getUiAttribute(int attributeNumber) {
297:                return (UIAttribute) uiAttributeList.get(attributeNumber);
298:            }
299:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.