Source Code Cross Referenced for Template.java in  » Content-Management-System » harmonise » org » openharmonise » rm » resources » publishing » 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.publishing 
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.publishing;
020:
021:        import org.openharmonise.commons.dsi.AbstractDataStoreInterface;
022:        import org.openharmonise.commons.xml.XMLDocument;
023:        import org.openharmonise.rm.*;
024:        import org.openharmonise.rm.publishing.*;
025:        import org.openharmonise.rm.resources.lifecycle.Editable;
026:        import org.openharmonise.rm.resources.xml.XMLResource;
027:        import org.w3c.dom.Element;
028:
029:        /**
030:         * Extension of <code>XMLResource</code> which adds functionality for handling the 
031:         * XML content as a template with which a <code>Publishable</code> object may
032:         * be published.
033:         * 
034:         * @author Michael Bell
035:         * @version $Revision: 1.3.2.1 $
036:         *
037:         */
038:        public class Template extends XMLResource implements  Editable {
039:
040:            //XML constants
041:            public static final String ATTRIB_TEMPLATEID = "templateId";
042:            public static final String TAG_TEMPLATE = "Template";
043:
044:            //DB constants
045:            private static final String TBL_TEMPLATEGROUP = "template";
046:
047:            /**
048:             * Basic constructor.
049:             */
050:            public Template() {
051:                super ();
052:            }
053:
054:            /**
055:             * Constructor for a template with an interface to the DB.
056:             * 
057:             * @param con
058:             */
059:            public Template(AbstractDataStoreInterface con) {
060:                super (con);
061:            }
062:
063:            /**
064:             * Standard constructor for a known template.
065:             * 
066:             * @param con
067:             * @param nId
068:             */
069:            public Template(AbstractDataStoreInterface con, int nId) {
070:                super (con, nId);
071:            }
072:
073:            /**
074:             * Standard constructor for a known template that may be historical.
075:             * 
076:             * @param con
077:             * @param nId
078:             * @param bIsHistorical
079:             */
080:            public Template(AbstractDataStoreInterface con, int nId, int nKey,
081:                    boolean bIsHistorical) {
082:                super (con, nId, nKey, bIsHistorical);
083:            }
084:
085:            /** 
086:             * Publishes the <code>Publishable</code> object using this template and the
087:             * <code>State</code>.
088:             *
089:             * @exception Exception General exception
090:             * @param pubObj XML to publish object with
091:             * @param output XML Document to publish to
092:             * @param state
093:             * @return XML output
094:             */
095:            public Element publishObjectToElement(Publishable pubObj,
096:                    HarmoniseOutput output, State state)
097:                    throws PublishException {
098:                Element rootEl;
099:                try {
100:                    rootEl = getTemplateRootElement();
101:                } catch (DataAccessException e) {
102:                    throw new PublishException(
103:                            "Error occurred getting template element", e);
104:                }
105:
106:                Element el = pubObj.publish(rootEl, (HarmoniseOutput) output,
107:                        (State) state);
108:
109:                return el;
110:            }
111:
112:            /**
113:             * Returns the root element of this template.
114:             * 
115:             * @return
116:             * @throws DataAccessException
117:             */
118:            public Element getTemplateRootElement() throws DataAccessException {
119:                if (isPopulated() == false) {
120:                    try {
121:                        populateFromDatabase();
122:                    } catch (PopulateException e) {
123:                        throw new DataAccessException(
124:                                "Error occured populating object", e);
125:                    }
126:                }
127:
128:                XMLDocument xml = getXIncludeResolvedDocument();
129:
130:                Element root = xml.getDocumentElement();
131:
132:                if (root == null) {
133:                    throw new DataAccessException(
134:                            "No Document Element present in template "
135:                                    + this .m_nId);
136:                }
137:                return (root);
138:            }
139:
140:            /* (non-Javadoc)
141:             * @see org.openharmonise.rm.dsi.DataStoreObject#getDBTableName()
142:             */
143:            public String getDBTableName() {
144:                return TBL_TEMPLATEGROUP;
145:            }
146:
147:            /* (non-Javadoc)
148:             * @see org.openharmonise.rm.resources.AbstractChildObject#getParentObjectClassName()
149:             */
150:            public String getParentObjectClassName() {
151:
152:                return TemplateGroup.class.getName();
153:            }
154:
155:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.