Source Code Cross Referenced for PropertyGroup.java in  » Content-Management-System » harmonise » org » openharmonise » rm » resources » metadata » properties » 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.properties 
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.properties;
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>PropertyGroup</code> represents a branch node of a property hierarchy,
033:         * that is an object that can be a parent to both other <code>PropertyGroup</code>s
034:         * and <code>Property</code>s.
035:         * 
036:         * @author Michael Bell
037:         * @version $Revision: 1.2 $
038:         *
039:         */
040:        public class PropertyGroup extends AbstractParentObject implements 
041:                Editable, DataStoreObject, Publishable, Cloneable {
042:
043:            /**
044:             * The <code>String</code> constant for the type field.
045:             */
046:            protected static String TYPE_PROPERTYGROUP = PropertyGroup.class
047:                    .getName();
048:            /**
049:             * List of allowable child class names
050:             */
051:            private static List CHILD_CLASS_NAMES = null;
052:
053:            //XML constants
054:            /**
055:             * The property group XML element name
056:             */
057:            public static final String TAG_PROPERTYGROUP = "PropertyGroup";
058:
059:            //DB constants
060:            /**
061:             * The property group database table name
062:             */
063:            private static final String TBL_PROPERTYGROUP = "prop_group";
064:
065:            //static initialiser block
066:            static {
067:                CHILD_CLASS_NAMES = new Vector();
068:                CHILD_CLASS_NAMES.add(Property.class.getName());
069:                CHILD_CLASS_NAMES.add(PropertyGroup.class.getName());
070:
071:                DatabaseInfo.getInstance().registerTableName(
072:                        PropertyGroup.class.getName(), TBL_PROPERTYGROUP);
073:
074:            }
075:
076:            /**
077:             * Constructs a new <code>PropertyGroup</code>.
078:             *
079:             */
080:            public PropertyGroup() {
081:                super ();
082:            }
083:
084:            /**
085:             * Constructs a new <code>PropertyGroup</code> with an interface to the data
086:             * store.
087:             * 
088:             * @param dbinterf the data store interface
089:             */
090:            public PropertyGroup(AbstractDataStoreInterface dbinterf) {
091:                super (dbinterf);
092:
093:            }
094:
095:            /**
096:             * Constructs a new <code>PropertyGroup</code> which may be historical with an 
097:             * interface to the data store.
098:             * 
099:             * @param dbinterf the data store interface
100:             * @param bHist <code>true</code> if the <code>PropertyGroup</code> is to be
101:             * a historical version
102:             */
103:            public PropertyGroup(AbstractDataStoreInterface dbinterf,
104:                    boolean bHist) {
105:                super (dbinterf);
106:                setHistorical(bHist);
107:            }
108:
109:            /**
110:             * Constructs an existing <code>PropertyGroup</code> with the specified id.
111:             * 
112:             * @param dbinterf the data store interface
113:             * @param nId the id of the <code>PropertyGroup</code>
114:             */
115:            public PropertyGroup(AbstractDataStoreInterface dbinterf, int nId) {
116:                super (dbinterf, nId);
117:
118:            }
119:
120:            /**
121:             * Constructs an existing <code>PropertyGroup</code> which may be historical.
122:             * 
123:             * @param dbinterf the data store interface
124:             * @param nId the id of the <code>PropertyGroup</code>
125:             * @param nKey the unique key for the version of the <code>PropertyGroup</code>
126:             * @param bHist <code>true</code> if the <code>PropertyGroup</code> is to be
127:             * a historical version 
128:             */
129:            public PropertyGroup(AbstractDataStoreInterface dbinterf, int nId,
130:                    int nKey, boolean bHist) {
131:                super (dbinterf, nId, nKey, bHist);
132:
133:            }
134:
135:            /**
136:             * Returns a list of all the top level, 'root', property groups.
137:             * 
138:             * @param dbinterf the data store interface
139:             * @return a list of all the top level, 'root', property groups
140:             * @throws DataAccessException 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 PropertyGroup());
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_PROPERTYGROUP;
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("Property") == true) {
182:                    sChildTableName = dbInfo.getTableName(Property.class
183:                            .getName());
184:                    sClassName = Property.class.getName();
185:                } else if (sObjectTag.equals("PropertyGroup") == true) {
186:                    sChildTableName = dbInfo.getTableName(PropertyGroup.class
187:                            .getName());
188:                    sClassName = PropertyGroup.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("Property") == true) {
203:                    joinConditions.addCondition(Property.getColumnRef(
204:                            sClassName, AbstractObject.ATTRIB_KEY, false),
205:                            childKeyCol);
206:                } else if (sObjectTag.equals("PropertyGroup") == true) {
207:                    joinConditions.addCondition(PropertyGroup.getColumnRef(
208:                            sClassName, 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:
220:                return TAG_PROPERTYGROUP;
221:            }
222:
223:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.