Source Code Cross Referenced for AttributeHandler.java in  » Content-Management-System » webman » de » webman » content » attributs » 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 » Content Management System » webman » de.webman.content.attributs 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package de.webman.content.attributs;
002:
003:        import com.teamkonzept.field.db.*;
004:        import com.teamkonzept.webman.mainint.WebmanExceptionHandler;
005:        import com.teamkonzept.lib.TKHashtable;
006:        import java.sql.SQLException;
007:        import java.util.Hashtable;
008:        import java.util.Enumeration;
009:        import org.apache.log4j.Category;
010:
011:        /**
012:         verwaltet die Attribute einer Contentid
013:
014:         * @author  $Author: sebastian $
015:         * @version $Revision: 1.5 $
016:         */
017:
018:        public class AttributeHandler {
019:            /** enthält eine Liste der Attributclassen zum Content */
020:            private Hashtable attributes = new Hashtable();
021:
022:            /** for Logging */
023:            private static Category cat = Category
024:                    .getInstance(AttributeHandler.class);
025:
026:            /** initiert die einzelnen Attributklassen (@see AttributeInterface)
027:             *  @param contentId
028:             */
029:            public AttributeHandler(Integer contentId) {
030:                TKContentDBData cdata = new TKContentDBData();
031:                try {
032:                    // lade Attribute
033:                    cdata.content_id = contentId.intValue();
034:                    cdata.setIgnoreTable("CONTENT_VALUE", true);
035:                    cdata.setIgnoreTable("CONTENT_NODE", true);
036:                    TKContentDBInterface.Get(cdata);
037:                    // lade Attributklassen
038:                    if (cdata.content_attribute == null)
039:                        return;
040:
041:                    for (int i = 0; i < cdata.content_attribute.size(); i++) {
042:                        // gibt es diese Klasse schon im Cache ?
043:                        TKContentAttributeTableData table = (TKContentAttributeTableData) cdata.content_attribute
044:                                .elementAt(i);
045:
046:                        AttributeInterface attrclass = (AttributeInterface) attributes
047:                                .get(table.classname);
048:                        if (attrclass == null) {
049:                            // lade Klasse (classname)
050:                            try {
051:                                Class objectClass = Class
052:                                        .forName(table.classname);
053:                                attrclass = (AttributeInterface) objectClass
054:                                        .newInstance();
055:                            } catch (Exception e) {
056:                                cat
057:                                        .error("Fehler beim laden der Attributklasse : "
058:                                                + table.classname);
059:                                continue;
060:                            }
061:
062:                            // cache Klasse
063:                            attributes.put(table.classname, attrclass);
064:                        }
065:                        attrclass.putAttribute(new Attribute(table.name,
066:                                table.value, table.type));
067:                    }
068:                } catch (Throwable t) {
069:                    cat.error("Fehler beim laden der Attribute");
070:                    t.printStackTrace();
071:
072:                }
073:
074:            }
075:
076:            /** geht alle Attribute durch und gibt null zurück fals der Content generierbar ist,
077:            	wird der Klassenname des Attributes zurückgegeben, weswegen der Content nicht generierbar ist.
078:            
079:            @param options event. Generatoroptionen
080:            @return String - null falls gültige Version; sonst KlassenID des Attributes das
081:            die Version ungültig macht
082:             */
083:            public String getGeneratableStatus(TKHashtable options)
084:	{
085:		Enumeration enum = attributes.elements();
086:		Enumeration keys = attributes.keys();
087:		while (enum.hasMoreElements())
088:		{
089:			String key = (String)keys.nextElement();
090:			AttributeInterface attr = (AttributeInterface)enum.nextElement();
091:			if (! attr.isGeneratable(options))
092:				return key;
093:		}
094:		return null;
095:	}
096:
097:            /** 
098:            @return boolean - true if there are no Attributes false otherwise
099:             */
100:            public boolean isEmpty() {
101:                return attributes.isEmpty();
102:            }
103:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.