Source Code Cross Referenced for CmsUpdateDBContentTables.java in  » Content-Management-System » opencms » org » opencms » setup » update6to7 » oracle » 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 » opencms » org.opencms.setup.update6to7.oracle 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * File   : $Source: /usr/local/cvs/opencms/src-setup/org/opencms/setup/update6to7/oracle/CmsUpdateDBContentTables.java,v $
003:         * Date   : $Date: 2008-02-27 12:05:48 $
004:         * Version: $Revision: 1.2 $
005:         *
006:         * This library is part of OpenCms -
007:         * the Open Source Content Management System
008:         *
009:         * Copyright (c) 2002 - 2008 Alkacon Software GmbH (http://www.alkacon.com)
010:         *
011:         * This library is free software; you can redistribute it and/or
012:         * modify it under the terms of the GNU Lesser General Public
013:         * License as published by the Free Software Foundation; either
014:         * version 2.1 of the License, or (at your option) any later version.
015:         *
016:         * This library is distributed in the hope that it will be useful,
017:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
018:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
019:         * Lesser General Public License for more details.
020:         *
021:         * For further information about Alkacon Software GmbH, please see the
022:         * company website: http://www.alkacon.com
023:         *
024:         * For further information about OpenCms, please see the
025:         * project website: http://www.opencms.org
026:         * 
027:         * You should have received a copy of the GNU Lesser General Public
028:         * License along with this library; if not, write to the Free Software
029:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
030:         */
031:
032:        package org.opencms.setup.update6to7.oracle;
033:
034:        import org.opencms.setup.CmsSetupDb;
035:
036:        import java.io.IOException;
037:        import java.sql.SQLException;
038:        import java.util.Collections;
039:        import java.util.HashMap;
040:        import java.util.Map;
041:
042:        /**
043:         * Oracle implementation of the generic update of the contents tables.<p>
044:         * 
045:         * @author Roland Metzler
046:         * @author Peter Bonrad
047:         *
048:         * @version $Revision: 1.2 $
049:         * 
050:         * @since 7.0.0
051:         */
052:        public class CmsUpdateDBContentTables extends
053:                org.opencms.setup.update6to7.generic.CmsUpdateDBContentTables {
054:
055:            /** Constant for the sql query to transfer the online contents.<p> */
056:            protected static final String QUERY_UPDATE_ONLINE_CONTENTS_PUBLISH_TAG_FROM = "Q_UPDATE_ONLINE_CONTENTS_PUBLISH_TAG_FROM";
057:
058:            /** Constant for the sql query to transfer the online contents.<p> */
059:            protected static final String QUERY_UPDATE_ONLINE_CONTENTS_PUBLISH_TAG_FROM2 = "Q_UPDATE_ONLINE_CONTENTS_PUBLISH_TAG_FROM2";
060:
061:            /** Constant for the sql query to transfer the online contents.<p> */
062:            protected static final String QUERY_UPDATE_ONLINE_CONTENTS_PUBLISH_TAG_TO = "Q_UPDATE_ONLINE_CONTENTS_PUBLISH_TAG_TO";
063:
064:            /** Constant for the SQL query properties.<p> */
065:            private static final String QUERY_PROPERTY_FILE = "oracle/cms_content_table_queries.properties";
066:
067:            /** Constant for the replacement in the sql query. */
068:            private static final String REPLACEMENT_TABLEINDEX_SPACE = "${indexTablespace}";
069:
070:            /**
071:             * Constructor.<p>
072:             * 
073:             * @throws IOException if the sql queries properties file could not be read
074:             */
075:            public CmsUpdateDBContentTables() throws IOException {
076:
077:                super ();
078:                loadQueryProperties(QUERY_PROPERTIES_PREFIX
079:                        + QUERY_PROPERTY_FILE);
080:            }
081:
082:            /**
083:             * @see org.opencms.setup.update6to7.generic.CmsUpdateDBContentTables#createContentsTable(org.opencms.setup.CmsSetupDb)
084:             */
085:            protected void createContentsTable(CmsSetupDb dbCon)
086:                    throws SQLException {
087:
088:                String indexTablespace = (String) m_poolData
089:                        .get("indexTablespace");
090:
091:                System.out.println(new Exception().getStackTrace()[0]
092:                        .toString());
093:                if (!dbCon.hasTableOrColumn(TABLE_CMS_CONTENTS, null)) {
094:                    String query = readQuery(QUERY_CREATE_CMS_CONTENTS_TABLE);
095:
096:                    HashMap replacer = new HashMap();
097:                    replacer.put(REPLACEMENT_TABLEINDEX_SPACE, indexTablespace);
098:
099:                    dbCon.updateSqlStatement(query, null, null);
100:                } else {
101:                    System.out.println("table " + TABLE_CMS_CONTENTS
102:                            + " already exists");
103:                }
104:            }
105:
106:            /**
107:             * @see org.opencms.setup.update6to7.generic.CmsUpdateDBContentTables#transferOnlineContents(org.opencms.setup.CmsSetupDb, int)
108:             */
109:            protected void transferOnlineContents(CmsSetupDb dbCon, int pubTag)
110:                    throws SQLException {
111:
112:                String query = readQuery(QUERY_TRANSFER_ONLINE_CONTENTS);
113:                Map replacer = Collections.singletonMap("${pubTag}", ""
114:                        + pubTag);
115:                dbCon.updateSqlStatement(query, replacer, null);
116:
117:                query = readQuery(QUERY_UPDATE_ONLINE_CONTENTS_PUBLISH_TAG_FROM);
118:                dbCon.updateSqlStatement(query, null, null);
119:
120:                query = readQuery(QUERY_UPDATE_ONLINE_CONTENTS_PUBLISH_TAG_FROM2);
121:                dbCon.updateSqlStatement(query, null, Collections
122:                        .singletonList(new Integer(pubTag)));
123:
124:                query = readQuery(QUERY_UPDATE_ONLINE_CONTENTS_PUBLISH_TAG_TO);
125:                dbCon.updateSqlStatement(query, null, null);
126:            }
127:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.