Source Code Cross Referenced for ValueGroup.java in  » Content-Management-System » harmonise » org » openharmonise » rm » resources » metadata » values » 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 » harmonise » org.openharmonise.rm.resources.metadata.values 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * The contents of this file are subject to the 
003:         * Mozilla Public License Version 1.1 (the "License"); 
004:         * you may not use this file except in compliance with the License. 
005:         * You may obtain a copy of the License at http://www.mozilla.org/MPL/
006:         *
007:         * Software distributed under the License is distributed on an "AS IS"
008:         * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. 
009:         * See the License for the specific language governing rights and 
010:         * limitations under the License.
011:         *
012:         * The Initial Developer of the Original Code is Simulacra Media Ltd.
013:         * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
014:         *
015:         * All Rights Reserved.
016:         *
017:         * Contributor(s):
018:         */
019:        package org.openharmonise.rm.resources.metadata.values;
020:
021:        import java.util.*;
022:
023:        import org.openharmonise.commons.dsi.*;
024:        import org.openharmonise.commons.dsi.dml.JoinConditions;
025:        import org.openharmonise.rm.DataAccessException;
026:        import org.openharmonise.rm.dsi.*;
027:        import org.openharmonise.rm.publishing.Publishable;
028:        import org.openharmonise.rm.resources.*;
029:        import org.openharmonise.rm.resources.lifecycle.Editable;
030:
031:        /**
032:         * A <code>ValueGroup</code> represents a branch node of a property hierarchy,
033:         * that is an object that can be a parent to both other <code>ValueGroup</code>s
034:         * and <code>Value</code>s.
035:         *   
036:         * @author Michael Bell
037:         * @version $Revision: 1.2 $
038:         *
039:         */
040:        public class ValueGroup extends AbstractParentObject implements 
041:                DataStoreObject, Editable, Publishable {
042:
043:            /**
044:             * The <code>String</code> constant for the type field
045:             */
046:            protected static String TYPE_VALUEGROUP = ValueGroup.class
047:                    .getName();
048:
049:            /**
050:             * List of allowable child class names
051:             */
052:            private static List CHILD_CLASS_NAMES = null;
053:
054:            //XML constants
055:            /**
056:             * The value group XML element name
057:             */
058:            public static final String TAG_VALUEGROUP = "ValueGroup";
059:
060:            //DB constants
061:            /**
062:             * The value group database table name
063:             */
064:            private static final String TBL_VALUEGROUP = "value_group";
065:
066:            //static initiaiser block
067:            static {
068:                CHILD_CLASS_NAMES = new Vector();
069:                CHILD_CLASS_NAMES.add(Value.class.getName());
070:                CHILD_CLASS_NAMES.add(ValueGroup.class.getName());
071:
072:                DatabaseInfo.getInstance().registerTableName(
073:                        ValueGroup.class.getName(), TBL_VALUEGROUP);
074:
075:            }
076:
077:            /** 
078:             * Constructs a new <code>ValueGroup</code>.
079:             *
080:             */
081:            public ValueGroup() {
082:                super ();
083:
084:            }
085:
086:            /** 
087:             * Constructs a new <code>ValueGroup</code> with a data store interface.
088:             *
089:             * @param dbintrf the data store interface
090:             */
091:            public ValueGroup(AbstractDataStoreInterface dbintrf) {
092:                super (dbintrf);
093:
094:            }
095:
096:            /**
097:             * Constructs an existing <code>ValueGroup</code> identified by its id.
098:             *
099:             * @param dbintrf the data store interface
100:             * @param nId the id of this object
101:             */
102:            public ValueGroup(AbstractDataStoreInterface dbintrf, int nId) {
103:                super (dbintrf, nId);
104:
105:            }
106:
107:            /**
108:             * Constructs an existing <code>ValueGroup</code> which may be historical.
109:             *
110:             * @param dbintrf the data store interface
111:             * @param nId the id of this object
112:             * @param nKey the unique key of the resource 
113:             * @param bIsHist <code>true</code> if the version of the <code>Value</code> 
114:             * is historical  
115:             */
116:            public ValueGroup(AbstractDataStoreInterface dbintrf, int nId,
117:                    int nKey, boolean bIsHist) {
118:                super (dbintrf, nId, nKey, bIsHist);
119:
120:            }
121:
122:            /** 
123:             * Constructs a new <code>ValueGroup</code> which may be historical.
124:             *
125:             * @param dbintrf the data store interface
126:             * @param bIsHist <code>true</code> if the version of the <code>Value</code> 
127:             * is historical  
128:             */
129:            public ValueGroup(AbstractDataStoreInterface dbintrf,
130:                    boolean bIsHist) {
131:                super (dbintrf);
132:
133:            }
134:
135:            /**
136:             * Returns a list of all the top level, 'root', value groups.
137:             * 
138:             * @param dbinterf the data store interface
139:             * @return a list of all the top level, 'root', value groups
140:             * @throws  if there is any errors building the 
141:             * list of objects
142:             */
143:            public static List getTopLevelGroups(
144:                    AbstractDataStoreInterface dbinterf)
145:                    throws DataAccessException {
146:                return AbstractParentObject.getTopLevelGroups(dbinterf,
147:                        new ValueGroup());
148:            }
149:
150:            /* (non-Javadoc)
151:             * @see org.openharmonise.rm.resources.AbstractParentObject#getChildClassNames()
152:             */
153:            public List getChildClassNames() {
154:                return CHILD_CLASS_NAMES;
155:            }
156:
157:            /* (non-Javadoc)
158:             * @see org.openharmonise.rm.resources.AbstractChildObject#getParentObjectClassName()
159:             */
160:            public String getParentObjectClassName() {
161:                return getClass().getName();
162:            }
163:
164:            /* (non-Javadoc)
165:             * @see org.openharmonise.rm.dsi.DataStoreObject#getDBTableName()
166:             */
167:            public String getDBTableName() {
168:                return TBL_VALUEGROUP;
169:            }
170:
171:            /* (non-Javadoc)
172:             * @see org.openharmonise.rm.dsi.DataStoreObject#getInstanceJoinConditions(java.lang.String, boolean)
173:             */
174:            public JoinConditions getInstanceJoinConditions(String sObjectTag,
175:                    boolean bIsOuter) throws DataStoreException {
176:                JoinConditions joinConditions = new JoinConditions();
177:                DatabaseInfo dbInfo = DatabaseInfo.getInstance();
178:                String sChildTableName = null;
179:                String sClassName = null;
180:
181:                if (sObjectTag.equals("Value") == true) {
182:                    sChildTableName = dbInfo
183:                            .getTableName(Value.class.getName());
184:                    sClassName = Value.class.getName();
185:                } else if (sObjectTag.equals("ValueGroup") == true) {
186:                    sChildTableName = dbInfo.getTableName(ValueGroup.class
187:                            .getName());
188:                    sClassName = ValueGroup.class.getName();
189:                } else {
190:                    throw new DataStoreException("Invalid child object");
191:                }
192:
193:                // get the child and parent keys from the join table
194:                ColumnRef childKeyCol = getGroupChildJoinColumnRef(
195:                        sChildTableName, CLMN_CHILD_KEY);
196:                ColumnRef parentKeyCol = getGroupChildJoinColumnRef(
197:                        sChildTableName, CLMN_PARENT_KEY);
198:
199:                joinConditions.addCondition(getInstanceColumnRef(
200:                        AbstractObject.ATTRIB_KEY, false), parentKeyCol);
201:
202:                if (sObjectTag.equals("Value") == true) {
203:                    joinConditions.addCondition(Value.getColumnRef(Value.class
204:                            .getName(), AbstractObject.ATTRIB_KEY, false),
205:                            childKeyCol);
206:                } else if (sObjectTag.equals("ValueGroup") == true) {
207:                    joinConditions.addCondition(getColumnRef(Value.class
208:                            .getName(), AbstractObject.ATTRIB_KEY, false),
209:                            childKeyCol);
210:                }
211:
212:                return joinConditions;
213:            }
214:
215:            /* (non-Javadoc)
216:             * @see org.openharmonise.rm.publishing.Publishable#getTagName()
217:             */
218:            public String getTagName() {
219:                return TAG_VALUEGROUP;
220:            }
221:
222:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.