Source Code Cross Referenced for AbstractNodeManager.java in  » Database-ORM » MMBase » org » mmbase » bridge » util » 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 » Database ORM » MMBase » org.mmbase.bridge.util 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:
003:        This software is OSI Certified Open Source Software.
004:        OSI Certified is a certification mark of the Open Source Initiative.
005:
006:        The license (Mozilla version 1.0) can be read at the MMBase site.
007:        See http://www.MMBase.org/license
008:
009:         */
010:
011:        package org.mmbase.bridge.util;
012:
013:        import java.util.*;
014:
015:        import javax.servlet.ServletRequest;
016:        import javax.servlet.ServletResponse;
017:
018:        import org.mmbase.bridge.*;
019:        import org.mmbase.bridge.implementation.BasicFieldList;
020:        import org.mmbase.util.functions.Function;
021:
022:        /**
023:         * Abstract implementation of NodeManager, to minimalize the implementation of a virtual one. Must
024:         * methods throw UnsupportOperationException (like in {@link
025:         * org.mmbase.bridge.implementation.VirtualNodeManager}.
026:         *
027:         * @author Michiel Meeuwissen
028:         * @version $Id: AbstractNodeManager.java,v 1.9 2008/02/03 17:33:56 nklasens Exp $
029:         * @see org.mmbase.bridge.NodeManager
030:         * @since MMBase-1.8
031:         */
032:        public abstract class AbstractNodeManager extends AbstractNode
033:                implements  NodeManager {
034:
035:            protected Map<String, Object> values = new HashMap<String, Object>();
036:            protected final Cloud cloud;
037:
038:            protected AbstractNodeManager(Cloud c) {
039:                cloud = c;
040:            }
041:
042:            @Override
043:            protected void setValueWithoutChecks(String fieldName, Object value) {
044:                values.put(fieldName, value);
045:            }
046:
047:            public Object getValueWithoutProcess(String fieldName) {
048:                return values.get(fieldName);
049:            }
050:
051:            protected void edit(int action) {
052:                // go ahead
053:            }
054:
055:            @Override
056:            protected void setSize(String fieldName, long size) {
057:                // never mind
058:            }
059:
060:            public long getSize(String fieldName) {
061:                // never mind
062:                return 2;
063:            }
064:
065:            public NodeManager getNodeManager() {
066:                return cloud.getNodeManager("typedef");
067:            }
068:
069:            public Cloud getCloud() {
070:                return cloud;
071:            }
072:
073:            public Node createNode() {
074:                throw new UnsupportedOperationException();
075:            }
076:
077:            public NodeList getList(String where, String sorted,
078:                    boolean direction) {
079:                throw new UnsupportedOperationException();
080:            }
081:
082:            public NodeList getList(String where, String sorted,
083:                    String direction) {
084:                throw new UnsupportedOperationException();
085:            }
086:
087:            public FieldList createFieldList() {
088:                return new BasicFieldList(Collections.emptyList(), this );
089:            }
090:
091:            public NodeList createNodeList() {
092:                return new CollectionNodeList(Collections.emptyList(), this );
093:            }
094:
095:            public RelationList createRelationList() {
096:                return new CollectionRelationList(Collections.emptyList(), this );
097:            }
098:
099:            public boolean mayCreateNode() {
100:                return false;
101:            }
102:
103:            public NodeList getList(NodeQuery query) {
104:                throw new UnsupportedOperationException();
105:            }
106:
107:            public NodeQuery createQuery() {
108:                throw new UnsupportedOperationException();
109:            }
110:
111:            public NodeList getList(String command, Map parameters,
112:                    ServletRequest req, ServletResponse resp) {
113:                throw new UnsupportedOperationException();
114:            }
115:
116:            public NodeList getList(String command, Map parameters) {
117:                throw new UnsupportedOperationException();
118:            }
119:
120:            public RelationManagerList getAllowedRelations() {
121:                return BridgeCollections.EMPTY_RELATIONMANAGERLIST;
122:            }
123:
124:            public RelationManagerList getAllowedRelations(String nodeManager,
125:                    String role, String direction) {
126:                return BridgeCollections.EMPTY_RELATIONMANAGERLIST;
127:            }
128:
129:            public RelationManagerList getAllowedRelations(
130:                    NodeManager nodeManager, String role, String direction) {
131:                return BridgeCollections.EMPTY_RELATIONMANAGERLIST;
132:            }
133:
134:            public String getInfo(String command) {
135:                return getInfo(command, null, null);
136:            }
137:
138:            public String getInfo(String command, ServletRequest req,
139:                    ServletResponse resp) {
140:                throw new UnsupportedOperationException();
141:            }
142:
143:            protected abstract Map<String, Field> getFieldTypes();
144:
145:            public boolean hasField(String fieldName) {
146:                Map fieldTypes = getFieldTypes();
147:                return fieldTypes.isEmpty()
148:                        || fieldTypes.containsKey(fieldName);
149:            }
150:
151:            public final FieldList getFields() {
152:                return getFields(NodeManager.ORDER_NONE);
153:            }
154:
155:            public final FieldList getFields(int order) {
156:                return new BasicFieldList(getFieldTypes().values(), this );
157:            }
158:
159:            public Field getField(String fieldName) throws NotFoundException {
160:                Field f = getFieldTypes().get(fieldName);
161:                if (f == null)
162:                    throw new NotFoundException("Field '" + fieldName
163:                            + "' does not exist in NodeManager '" + getName()
164:                            + "'.(" + getFieldTypes() + ")");
165:                return f;
166:            }
167:
168:            public String getGUIName() {
169:                return getGUIName(NodeManager.GUI_SINGULAR);
170:            }
171:
172:            public String getGUIName(int plurality) {
173:                return getGUIName(plurality, null);
174:            }
175:
176:            public String getGUIName(int plurality, Locale locale) {
177:                return getName();
178:            }
179:
180:            public String getName() {
181:                return "virtual_manager";
182:            }
183:
184:            public String getDescription() {
185:                return getDescription(null);
186:            }
187:
188:            public String getDescription(Locale locale) {
189:                return "";
190:            }
191:
192:            public NodeManager getParent() {
193:                return null;
194:            }
195:
196:            public String getProperty(String name) {
197:                return null;
198:            }
199:
200:            public Map<String, String> getProperties() {
201:                return Collections.emptyMap();
202:            }
203:
204:            public NodeManagerList getDescendants() {
205:                return BridgeCollections.EMPTY_NODEMANAGERLIST;
206:            }
207:
208:            public Collection<Function<?>> getFunctions() {
209:                return Collections.emptyList();
210:            }
211:
212:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.