Source Code Cross Referenced for ConfigDataConstants.java in  » Portal » Open-Portal » com » sun » portal » fabric » tasks » 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 » Portal » Open Portal » com.sun.portal.fabric.tasks 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package com.sun.portal.fabric.tasks;
002:
003:        import java.io.File;
004:
005:        import java.util.logging.Level;
006:        import java.util.logging.Logger;
007:        import java.util.logging.LogRecord;
008:
009:        import com.sun.portal.fabric.util.XMLJdomUtil;
010:        import com.sun.portal.fabric.util.XMLJdomFileCreationException;
011:        import com.sun.portal.log.common.PortalLogger;
012:        import com.sun.portal.util.Platform;
013:
014:        public class ConfigDataConstants {
015:
016:            protected static final String cps = File.pathSeparator;
017:            protected static final String fs = Platform.fs;
018:            protected static final String nl = System
019:                    .getProperty("line.separator");
020:            protected static final String ts = "@";
021:            protected static final String MODE_RECORD = "Record";
022:            protected static final String MODE_PLAYBACK = "Playback";
023:            protected static final String MODE_ERASE = "Erase";
024:
025:            public static final String PASCONFIG_PORTAL_SERVER_CONFIGURATION = "WebContainerConfigData";
026:            public static final String PASCONFIG_PATHS = "Paths";
027:            public static final String PASCONFIG_JVM_OPTIONS = "Jvm_options";
028:            public static final String PASCONFIG_RESOURCES = "Resources";
029:
030:            public static final String PASCONFIG_ATTR_CLASSPATH = "classpath";
031:            public static final String PASCONFIG_ATTR_NATIVE_LIB_PATH = "native_lib_path";
032:            public static final String PASCONFIG_ATTR_RESOURCES_LIST = "resources_list";
033:
034:            public static final String PASCONFIG_INSTANCE_ID = "@INSTANCE_ID@";
035:
036:            protected XMLJdomUtil m_xmlJdomUtil = null;
037:            protected String m_sPASFileLocation = null;
038:            protected String m_sPASXSDFileLocation = null;
039:            protected boolean m_bRecordingFound = false;
040:
041:            private static Logger logger = PortalLogger
042:                    .getLogger(ConfigDataConstants.class);
043:
044:            /**
045:             * Constructor
046:             *
047:             * @param sPSLibDir            Portal Server Lib Dir
048:             * @param sPortalConfigDataDir Portal Config Dir
049:             * @param logger               Logger
050:             */
051:            protected ConfigDataConstants(final String sPSLibDir,
052:                    final String sPortalConfigDataDir)
053:                    throws ConfigDataRecorderPlaybackException {
054:
055:                if ((sPSLibDir == null) || (sPSLibDir.trim().length() == 0)) {
056:                    // log message
057:                    logger.log(Level.SEVERE, "PSFB_CSPFT0207");
058:                    throw new ConfigDataRecorderPlaybackException(
059:                            "PS Lib Directory = Null/Empty");
060:                }
061:
062:                File fPSLibDir = new File(sPSLibDir);
063:                if (!fPSLibDir.isDirectory()) {
064:                    // log message
065:                    logger.log(Level.SEVERE, "PSFB_CSPFT0208", sPSLibDir);
066:                    throw new ConfigDataRecorderPlaybackException("Directory '"
067:                            + sPSLibDir + "' can not be found!!!");
068:                }
069:
070:                m_sPASXSDFileLocation = sPSLibDir + fs + "PASconfig.xsd";
071:                /*??File fPASXSDFileLocation = new File(m_sPASXSDFileLocation);
072:                if (!fPASXSDFileLocation.isFile()) {
073:                   // log message
074:                   throw new ConfigDataRecorderPlaybackException("Schema file " + m_sPASXSDFileLocation + " can not be found!!!");
075:                }??*/
076:
077:                try {
078:                    m_xmlJdomUtil = new XMLJdomUtil();
079:
080:                    if ((sPortalConfigDataDir == null)
081:                            || (sPortalConfigDataDir.trim().length() == 0)) {
082:                        // log message
083:                        logger.log(Level.SEVERE, "PSFB_CSPFT0209");
084:                        throw new ConfigDataRecorderPlaybackException(
085:                                "Portal Config Dir = Null/Empty");
086:                    }
087:
088:                    File fDir = new File(sPortalConfigDataDir);
089:                    boolean bCreatePortalConfigDir = fDir.isDirectory() ? true
090:                            : fDir.mkdirs();
091:                    if (!bCreatePortalConfigDir) {
092:                        // log nessage
093:                        logger.log(Level.SEVERE, "PSFB_CSPFT0210",
094:                                sPortalConfigDataDir);
095:                        throw new ConfigDataRecorderPlaybackException(
096:                                "Failed to create Portal Config Dir '"
097:                                        + sPortalConfigDataDir + "'");
098:                    }
099:
100:                    // Read Portal Config File if available
101:                    m_sPASFileLocation = sPortalConfigDataDir + fs
102:                            + "WebContainerConfigData.xml";
103:                    File fTmpFile = new File(m_sPASFileLocation);
104:                    if (fTmpFile.isFile()) {
105:                        System.out.println("File '"
106:                                + fTmpFile.getAbsolutePath() + "' found.");
107:                        //??m_xmlJdomUtil.readXMLFile(fTmpFile.getAbsolutePath());
108:                        m_xmlJdomUtil.readXMLFileLessSchemaValidation(fTmpFile
109:                                .getAbsolutePath());
110:                        m_bRecordingFound = true;
111:                    }
112:                } catch (XMLJdomFileCreationException e) {
113:                    // log message
114:                    logger.log(Level.SEVERE, "PSFB_CSPFT0211", e);
115:                    throw new ConfigDataRecorderPlaybackException(e);
116:                }
117:            }
118:
119:            public final boolean isRecordingFound() {
120:
121:                return m_bRecordingFound;
122:            }
123:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.