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


001:        /*
002:         * Copyright 2001 Sun Microsystems, Inc.  All rights reserved.
003:         * PROPRIETARY/CONFIDENTIAL.  Use of this product is subject to license terms.
004:         */
005:        package com.sun.portal.rewriter;
006:
007:        import com.sun.portal.rewriter.rom.RuleSetManager;
008:        import com.sun.portal.rewriter.services.DataService;
009:        import com.sun.portal.rewriter.services.DataServiceFactory;
010:        import com.sun.portal.rewriter.services.DataServiceHelper;
011:        import com.sun.portal.rewriter.util.ConfigManager;
012:        import com.sun.portal.rewriter.util.Constants;
013:        import com.sun.portal.rewriter.util.i18n.EncodingHelper;
014:        import com.sun.portal.rewriter.util.i18n.MIMEHelper;
015:
016:        import java.util.Properties;
017:
018:        /**
019:         * Has the info related to initialization of the rewriter component
020:         */
021:        public class RewriterModule {
022:            public static final String REWRITER_LOG = "debug.com.sun.portal.rewriter";
023:            public static final String REWRITER_LOG_REST = REWRITER_LOG
024:                    + ".rest";
025:            public static final String REWRITER_LOG_RULRESET_INFO = REWRITER_LOG
026:                    + ".rulesetinfo";
027:            public static final String REWRITER_LOG_URI_INFO = REWRITER_LOG
028:                    + ".uriinfo";
029:            public static final String REWRITER_LOG_ORIGINAL_PAGES = REWRITER_LOG
030:                    + ".original";
031:            public static final String REWRITER_LOG_REWRITTEN_PAGES = REWRITER_LOG
032:                    + ".rewritten";
033:            public static final String REWRITER_LOG_UNAFFECTED_PAGES = REWRITER_LOG
034:                    + ".unaffected";
035:
036:            public static final String RESOURCE_HOME = "/resources";
037:
038:            public static final String RESOURCE_RULESET_TEMPLATE_LOCATION = RESOURCE_HOME
039:                    + "/RuleSetTemplate.xml";
040:            public static final String RULESET_TEMPLATE_ID = "ruleset_template";
041:
042:            public static final String RESOURCE_GENERIC_RULESET_LOCATION = RESOURCE_HOME
043:                    + "/GenericRuleSet.xml";
044:            public static final String GENRIC_RULESET_ID = "generic_ruleset";
045:
046:            public static final String RESOURCE_DEFAULT_RULESET_LOCATION = RESOURCE_HOME
047:                    + "/DefaultRuleSet.xml";
048:            public static final String DEFAULT_RULESET_ID = "default_ruleset";
049:
050:            public static final String[][] PORTAL_RULESET_SPEC = {
051:                    { RESOURCE_GENERIC_RULESET_LOCATION, GENRIC_RULESET_ID },
052:                    //		{RESOURCE_DEFAULT_RULESET_LOCATION, DEFAULT_RULESET_ID},
053:                    { RESOURCE_RULESET_TEMPLATE_LOCATION, RULESET_TEMPLATE_ID }, };
054:
055:            public static final String RESOURCE_RULESET_DTD_LOCATION = RESOURCE_HOME
056:                    + "/RuleSet.dtd";
057:            public static final String RESOURCE_RULESET_V62_DTD_LOCATION = RESOURCE_HOME
058:                    + "/RuleSetV62.dtd";
059:
060:            public static final String RESOURCE_CONVERT_EXPRESSTION_FUNCTION_LOCATION = RESOURCE_HOME
061:                    + "/ConvertExpression.js";
062:            public static final String RESOURCE_URI_UTILS_LOCATION = RESOURCE_HOME
063:                    + "/URIUtils.js";
064:            public static final String RESOURCE_CONVERT_SYSTEM_FUNCTION_LOCATION = RESOURCE_HOME
065:                    + "/ConvertSystem.js";
066:
067:            public static final String RESOURCE_RWCLIPROPS_LOCATION = RESOURCE_HOME
068:                    + "/RuleSetCLI.properties";
069:            public static final String RESOURCE_RWCLISPEC_LOCATION = RESOURCE_HOME
070:                    + "/RuleSetCLISpec.xml";
071:            public static final String RESOURCE_RWCLISPEC_DTD_LOCATION = "/resources/CLISpec.dtd";
072:
073:            public static final String RESOURCE_EXT_2_MIME_MAPPING_LOCATION = RESOURCE_HOME
074:                    + "/Ext2MimeMapping.properties";
075:
076:            public static final String RESOURCE_JAVA_2_IANA_ENCODING_MAPPING_LOCATION = RESOURCE_HOME
077:                    + "/Java2IANAEncodingMappings.properties";
078:
079:            public static final String RESOURCE_REWRITER_MODULE_PROPERTIES_LOCATION = RESOURCE_HOME
080:                    + "/RewriterModule.properties";
081:
082:            public static final String PROPERTY_MIME_MAP_LOCATION = "MIME_MAP_LOCATION";
083:            public static final String PROPERTY_ENCODING_MAP_LOCATION = "ENCODING_MAP_LOCATION";
084:
085:            public static void init(final Properties aDataServiceProps,
086:                    final Properties aConfigProps, final Properties aI18NProps) {
087:                ConfigManager.init(mergeProperties(aConfigProps,
088:                        getConfigProps()));
089:                init(DataServiceFactory.create(aDataServiceProps),
090:                        aConfigProps, aI18NProps);
091:            }//init()
092:
093:            public static void init(final DataService aDataService,
094:                    final Properties aConfigProps, Properties aI18NProps) {
095:                ConfigManager.init(mergeProperties(aConfigProps,
096:                        getConfigProps()));
097:
098:                if (aI18NProps == null) {
099:                    aI18NProps = getMIMEAndEncodingProps();
100:                }
101:
102:                MIMEHelper.init(aI18NProps
103:                        .getProperty(PROPERTY_MIME_MAP_LOCATION));
104:                EncodingHelper.init(aI18NProps
105:                        .getProperty(PROPERTY_ENCODING_MAP_LOCATION));
106:                //BadCode..
107:                new RewriterPool(new RuleSetManager(aDataService));
108:            }//init()
109:
110:            private static Properties getConfigProps() {
111:                return ConfigManager
112:                        .readProps(RESOURCE_REWRITER_MODULE_PROPERTIES_LOCATION);
113:            }//getConfigProps()
114:
115:            private static Properties getMIMEAndEncodingProps() {
116:                Properties lResult = new Properties();
117:                lResult.put(PROPERTY_MIME_MAP_LOCATION,
118:                        RESOURCE_EXT_2_MIME_MAPPING_LOCATION);
119:                lResult.put(PROPERTY_ENCODING_MAP_LOCATION,
120:                        RESOURCE_JAVA_2_IANA_ENCODING_MAPPING_LOCATION);
121:
122:                return lResult;
123:            }//getMIMEAndEncodingProps()
124:
125:            private static Properties mergeProperties(
126:                    final Properties aCustomProps,
127:                    final Properties aDefaultProps) {
128:                if (aCustomProps == null) {
129:                    return aDefaultProps;
130:                }
131:
132:                // If the user has supplid some treat them as overiding ones
133:                // what ever the user has not supplide try taking them form
134:                //default
135:                aDefaultProps.putAll(aCustomProps);
136:                return aDefaultProps;
137:            }//mergeProperties()
138:
139:            public static void initIDS() {
140:                init(DataServiceHelper.getDefaultIDSProps(), null, null);
141:            }//initIDS()
142:
143:            public synchronized static void initIDSAME() {
144:                //BugNo:4895102
145:                if (RuleSetManager.getDefault() == null) {
146:                    init(DataServiceHelper.getDefaultIDSAMEProps(), null, null);
147:                }
148:            }//initIDSAME()
149:
150:            public static void initIDSAME(final String aUserName,
151:                    final String aPassword) {
152:                init(DataServiceHelper.getIDSAMEProps(aUserName, aPassword),
153:                        null, null);
154:            }//initIDSAME()
155:
156:            /**
157:             * Initialize the rewriter component to be used with a File based service and
158:             * default properties.
159:             */
160:            public static void initFile() {
161:                init(DataServiceHelper.getDefaultFileProps(), null, null);
162:            }//initFile()
163:
164:            public static void initFile(String logLocation, String logLevel) {
165:                Properties logProps = new Properties();
166:                logProps.put(Constants.LOG_LOCATION, logLocation);
167:                logProps.put(Constants.LOG_LEVEL, logLevel);
168:                init(DataServiceHelper.getDefaultFileProps(), logProps, null);
169:            }
170:        }//Class RewriterModule
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.