Source Code Cross Referenced for Section.java in  » Content-Management-System » harmonise » org » openharmonise » rm » resources » content » 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.content 
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.content;
020:
021:        import java.util.*;
022:        import java.util.logging.*;
023:
024:        import org.openharmonise.commons.dsi.*;
025:        import org.openharmonise.commons.dsi.dml.JoinConditions;
026:        import org.openharmonise.rm.DataAccessException;
027:        import org.openharmonise.rm.dsi.*;
028:        import org.openharmonise.rm.metadata.Profile;
029:        import org.openharmonise.rm.publishing.Publishable;
030:        import org.openharmonise.rm.resources.*;
031:        import org.openharmonise.rm.resources.lifecycle.Editable;
032:
033:        /**
034:         * Parent object to allow hierarchies of <code>Document</code> and 
035:         * <code>Asset</code> objects.
036:         * 
037:         * @author Michael Bell
038:         * @version $Revision: 1.3 $
039:         *
040:         */
041:        public class Section extends AbstractParentObject implements 
042:                DataStoreObject, Publishable, Editable, Cloneable, Comparable {
043:
044:            //DB constants
045:            /**
046:             * The <code>Section</code> database table name
047:             */
048:            private static final String TBL_SECTION = "section";
049:
050:            //XML constants
051:            /**
052:             * The <code>Section</code> XML tag name
053:             */
054:            public static final String TAG_SECTION = "Section";
055:
056:            //member variables
057:            /**
058:             * List of allowable child class names
059:             */
060:            private static List CHILD_CLASS_NAMES = null;
061:
062:            /**
063:             * Logger for this class
064:             */
065:            private static final Logger m_logger = Logger
066:                    .getLogger(Section.class.getName());
067:
068:            //static initialiser block
069:            static {
070:                DatabaseInfo.getInstance().registerTableName(
071:                        Section.class.getName(), TBL_SECTION);
072:
073:                try {
074:                    CHILD_CLASS_NAMES = new Vector();
075:                    CHILD_CLASS_NAMES.add(Document.class.getName());
076:                    CHILD_CLASS_NAMES.add(Asset.class.getName());
077:                    CHILD_CLASS_NAMES.add(Section.class.getName());
078:
079:                } catch (Exception e) {
080:                    throw new RuntimeException(e.getMessage());
081:                }
082:            }
083:
084:            /** 
085:             * Contructs a new instance with no data store interface
086:             */
087:            public Section() {
088:                super ();
089:
090:            }
091:
092:            /** 
093:             * Constructs a new or anonymous resource.
094:             *
095:             * @param dbintrf the data store to register
096:             */
097:            public Section(AbstractDataStoreInterface dbintrf) {
098:                super (dbintrf);
099:
100:            }
101:
102:            /** 
103:             * Constructs a known resource.
104:             *
105:             * @param dbintrf the data store to register
106:             * @param nId the id of this resource
107:             */
108:            public Section(AbstractDataStoreInterface dbintrf, int nId) {
109:                super (dbintrf, nId);
110:
111:            }
112:
113:            /**
114:             * Constructs a known resource which may be historical.
115:             * 
116:             * @param dbintrf the data store interface
117:             * @param nId the resource identifier
118:             * @param nKey the resource unique key
119:             * @param bIsHist <code>true</code> if the version of the resoure is historical, otherwise <code>false</code>
120:             */
121:            public Section(AbstractDataStoreInterface dbintrf, int nId,
122:                    int nKey, boolean bIsHist) {
123:                super (dbintrf, nId, nKey, bIsHist);
124:            }
125:
126:            /**
127:             * Constructs a new or anonymous resource which 
128:             * may be historical.
129:             * 
130:             * @param dbintrf the data store interface
131:             * @param bIsHist <code>true</code> if the resoure is historical, otherwise <code>false</code>
132:             */
133:            public Section(AbstractDataStoreInterface dbintrf, boolean bIsHist) {
134:                super (dbintrf);
135:                setHistorical(bIsHist);
136:            }
137:
138:            /* (non-Javadoc)
139:             * @see java.lang.Object#toString()
140:             */
141:            public String toString() {
142:                StringBuffer strBuff = new StringBuffer();
143:
144:                try {
145:                    strBuff.append("Section Title:[" + m_sName + "] ").append(
146:                            "Section Summary:[" + m_sSummary + "] ").append(
147:                            "Section ID:[" + m_nId + "] ").append(
148:                            "Section status:[" + getStatus().getIntValue()
149:                                    + "] ");
150:
151:                    Profile prof = getProfile();
152:
153:                    if (prof != null) {
154:                        strBuff.append("Profile:" + prof.toString());
155:                    }
156:
157:                } catch (DataAccessException e) {
158:                    m_logger.log(Level.WARNING, e.getLocalizedMessage(), e);
159:                }
160:
161:                return strBuff.toString();
162:            }
163:
164:            /* (non-Javadoc)
165:             * @see org.openharmonise.rm.resources.AbstractChildObject#getParentObjectClassName()
166:             */
167:            public String getParentObjectClassName() {
168:                return getClass().getName();
169:            }
170:
171:            /* (non-Javadoc)
172:             * @see org.openharmonise.rm.dsi.DataStoreObject#getDBTableName()
173:             */
174:            public String getDBTableName() {
175:                return TBL_SECTION;
176:            }
177:
178:            /* (non-Javadoc)
179:             * @see org.openharmonise.rm.dsi.DataStoreObject#getInstanceJoinConditions(java.lang.String, boolean)
180:             */
181:            public JoinConditions getInstanceJoinConditions(String sObjectTag,
182:                    boolean bIsOuter) throws DataStoreException {
183:                JoinConditions joinConditions = new JoinConditions();
184:                DatabaseInfo dbInfo = DatabaseInfo.getInstance();
185:                String sChildTableName = null;
186:                String sClassName = null;
187:
188:                if (sObjectTag.equals("Document") == true) {
189:                    sChildTableName = dbInfo.getTableName(Document.class
190:                            .getName());
191:                    sClassName = Document.class.getName();
192:                } else if (sObjectTag.equals("Asset") == true) {
193:                    sChildTableName = dbInfo
194:                            .getTableName(Asset.class.getName());
195:                    sClassName = Asset.class.getName();
196:                } else if (sObjectTag.equals("Section") == true) {
197:                    sChildTableName = dbInfo.getTableName(Section.class
198:                            .getName());
199:                    sClassName = Section.class.getName();
200:                } else {
201:                    throw new DataStoreException("Invalid child object.");
202:                }
203:
204:                // get the child and parent keys from the join table
205:                ColumnRef childKeyCol = getGroupChildJoinColumnRef(
206:                        sChildTableName, CLMN_CHILD_KEY);
207:                ColumnRef parentKeyCol = getGroupChildJoinColumnRef(
208:                        sChildTableName, CLMN_PARENT_KEY);
209:
210:                joinConditions.addCondition(getInstanceColumnRef(
211:                        AbstractObject.ATTRIB_KEY, false), parentKeyCol);
212:
213:                if (sObjectTag.equals("Document") == true) {
214:                    joinConditions.addCondition(Document.getColumnRef(
215:                            sClassName, AbstractObject.ATTRIB_KEY, false),
216:                            childKeyCol);
217:                } else if (sObjectTag.equals("Asset") == true) {
218:                    joinConditions.addCondition(Asset.getColumnRef(sClassName,
219:                            AbstractObject.ATTRIB_KEY, false), childKeyCol);
220:                } else if (sObjectTag.equals("Section") == true) {
221:                    joinConditions.addCondition(getColumnRef(sClassName,
222:                            AbstractObject.ATTRIB_KEY, false), childKeyCol);
223:                }
224:
225:                return joinConditions;
226:            }
227:
228:            /* (non-Javadoc)
229:             * @see org.openharmonise.rm.publishing.Publishable#getTagName()
230:             */
231:            public String getTagName() {
232:
233:                return TAG_SECTION;
234:            }
235:
236:            /* (non-Javadoc)
237:             * @see org.openharmonise.rm.resources.AbstractParentObject#getChildClassNames()
238:             */
239:            public List getChildClassNames() {
240:                return CHILD_CLASS_NAMES;
241:            }
242:
243:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.