Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 186386 Details for
Bug 320926
Cleanup W4T configuration
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch to remove w4t configuration file support
clipboard.txt (text/plain), 60.81 KB, created by
Ralf Sternberg
on 2011-01-10 07:57:13 EST
(
hide
)
Description:
Patch to remove w4t configuration file support
Filename:
MIME Type:
Creator:
Ralf Sternberg
Created:
2011-01-10 07:57:13 EST
Size:
60.81 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rap.rwt >Index: src/org/eclipse/rwt/internal/ConfigurationReader.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/rwt/internal/ConfigurationReader.java,v >retrieving revision 1.3 >diff -u -r1.3 ConfigurationReader.java >--- src/org/eclipse/rwt/internal/ConfigurationReader.java 7 Sep 2009 19:33:05 -0000 1.3 >+++ src/org/eclipse/rwt/internal/ConfigurationReader.java 10 Jan 2011 12:46:13 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2002, 2007 Innoopract Informationssysteme GmbH. >+ * Copyright (c) 2002, 2010 Innoopract Informationssysteme GmbH. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -7,290 +7,70 @@ > * > * Contributors: > * Innoopract Informationssysteme GmbH - initial API and implementation >+ * EclipseSource - ongoing implementation > ******************************************************************************/ > package org.eclipse.rwt.internal; > >-import java.io.*; >-import java.net.URL; >-import java.net.URLConnection; > import java.util.HashMap; > import java.util.Map; > >-import javax.xml.parsers.*; >+import javax.xml.parsers.FactoryConfigurationError; > >-import org.w3c.dom.*; >-import org.xml.sax.*; > >- >-/** >- * This is a helping class for the W4TApplication to read >- * the initialisations, which are stored in w4t.xml in the conf/ >- * directory of the web applications root. >+/** >+ * This is a helping class that reads configuration values from system >+ * properties. > */ > public class ConfigurationReader { >- >- private static final String W4_TOOLKIT_SCHEMA = "w4t.xsd"; >- private static final String JAXP_SCHEMA_LANGUAGE >- = "http://java.sun.com/xml/jaxp/properties/schemaLanguage"; >- private static final String W3C_XML_SCHEMA >- = "http://www.w3.org/2001/XMLSchema"; >- > >- private static Document document = null; > private static IConfiguration configuration = null; > private static final Map values = new HashMap(); >- private static File configurationFile = null; > private static IEngineConfig engineConfig = null; > > private static final class ConfigurationImpl implements IConfiguration { > >- private IInitialization initialization = null; >- private IFileUpload fileUpload = null; >- >- public IInitialization getInitialization() { >- if( initialization == null ) { >- initialization = new InitializationImpl(); >- } >- return initialization; >- } >- >- public IFileUpload getFileUpload() { >- if( fileUpload == null ) { >- fileUpload = new FileUploadImpl(); >- } >- return fileUpload; >- } >- } >- >- private static final class InitializationImpl implements IInitialization { >- >- public String getStartUpForm() { >- // do not use Startup.class.getName() since in name space mode >- // that class must be loaded in session scope >- return getConfigValue( "startUpForm", "com.w4t.administration.Startup" ); >- } >- > public String getLifeCycle() { >- String defaultValue = IInitialization.LIFE_CYCLE_DEFAULT; >- return getConfigValue( IInitialization.PARAM_LIFE_CYCLE, defaultValue ); >- } >- >- public String getErrorPage() { >- // do not use DefaultErrorForm.class.getName() since in name space mode >- // that class must be loaded in session scope >- String defaultValue = "com.w4t.administration.DefaultErrorForm"; >- return getConfigValue( "errorPage", defaultValue ); >- } >- >- public String getAdministrationStartupForm() { >- // do not use Startup.class.getName() since in name space mode >- // that class must be loaded in session scope >- String defaultValue = "com.w4t.administration.Startup"; >- return getConfigValue( "administrationStartupForm", defaultValue ); >+ String defaultValue = IConfiguration.LIFE_CYCLE_DEFAULT; >+ return getConfigValue( IConfiguration.PARAM_LIFE_CYCLE, defaultValue ); > } >- >- public String getMessagePage() { >- // do not use DefaultMessageForm.class.getName() since in name space mode >- // that class must be loaded in session scope >- String defaultValue = "com.w4t.administration.DefaultMessageForm"; >- return getConfigValue( "messagePage", defaultValue ); >- } >- >- public String getWorkDirectory() { >- return getConfigValue( "workDirectory", "WEB-INF/classes/" ); >- } >- >- public long getClosingTimeout() { >- String value = getConfigValue( "closingTimeout", "3600000" ); >- long result = Long.parseLong( value ); >- return ( result < 60000 ) ? 60000 : result; >- } >- >- public long getSkimmerFrequenzy() { >- String value = getConfigValue( "skimmerFrequency", "60000" ); >- return Long.parseLong( value ); >- } >- >- public boolean isDirectMonitoringAccess() { >- String value = getConfigValue( "directMonitoringAccess", "true" ); >- return Boolean.valueOf( value ).booleanValue(); >- } >- >+ > public boolean isCompression() { >- String value = getConfigValue( "org.eclipse.rwt.compression", "false" ); >+ String value = getConfigValue( IConfiguration.PARAM_COMPRESSION, >+ "false" ); > return Boolean.valueOf( value ).booleanValue(); > } >- >- public boolean isProcessTime() { >- String value = getConfigValue( "processTime", "false" ); >- return Boolean.valueOf( value ).booleanValue(); >- } >- >- public String getNoscriptSubmitters() { >- String defaultValue = IInitialization.NOSCRIPT_SUBMITTERS_CREATE; >- return getConfigValue( "noscriptSubmitters", defaultValue ); >- } >- >+ > public String getResources() { >- String defaultValue = IInitialization.RESOURCES_DELIVER_FROM_DISK; >+ String defaultValue = IConfiguration.RESOURCES_DELIVER_FROM_DISK; > return getConfigValue( "resources", defaultValue ); > } >- >- public long getMaxSessionUnboundToForceGC() { >- String tagName = "maxSessionUnboundToForceGC"; >- String value = getConfigValue( tagName, "0" ); >- return Long.parseLong( value ); >- } >- >- public String getHandleMissingI18NResource() { >- String defaultValue = IInitialization.HANDLE_MISSING_I18N_RESOURCE_EMPTY; >- return getConfigValue( "handleMissingI18NResource", defaultValue ); >- } > } > >- private static final class FileUploadImpl implements IFileUpload { >- >- public long getMaxUploadSize() { >- String value = getConfigValue( "maxUploadSize", "4194304" ); >- return Long.parseLong( value ); >- } >- >- public int getMaxMemorySize() { >- String value = getConfigValue( "maxMemorySize", "524288" ); >- return Integer.parseInt( value ); >- } >- } >- > public static IConfiguration getConfiguration() { > if( configuration == null ) { > configuration = new ConfigurationImpl(); > } > return configuration; > } >- >- public static void setConfigurationFile( final File configurationFile ) >- throws FactoryConfigurationError, >- ParserConfigurationException, >- SAXException, >- IOException >- { >- reset(); >- if( configurationFile != null ) { >- if( !configurationFile.exists() ) { >- String msg = "Parameter 'configurationFile [" >- + configurationFile.toString() >- + "]' does not exist."; >- throw new IllegalArgumentException( msg ); >- } >- if( configurationFile.isDirectory() ) { >- String msg = "Parameter 'configurationFile' must not be a directory."; >- throw new IllegalArgumentException( msg ); >- } >- ConfigurationReader.configurationFile = configurationFile; >- } >- if( configurationFile != null ) { >- parseConfiguration(); >- } >- } > > public static IEngineConfig getEngineConfig() { > return engineConfig; > } >- >+ > public static void setEngineConfig( final IEngineConfig engineConfig ) >- throws FactoryConfigurationError, >- ParserConfigurationException, >- SAXException, >- IOException >+ throws FactoryConfigurationError > { > ConfigurationReader.engineConfig = engineConfig; >- setConfigurationFile( engineConfig.getConfigFile() ); > } >- >- >- ////////////////// >- // helping methods > >- private static void reset() { >+ public static void reset() { > values.clear(); >- document = null; > configuration = null; >- configurationFile = null; > } >- >- private static void parseConfiguration() >- throws FactoryConfigurationError, >- ParserConfigurationException, >- SAXException, >- IOException >- { >- if( configurationFile != null ) { >- InputStream is = new FileInputStream( configurationFile ); >- try { >- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); >- factory.setNamespaceAware( true ); >- ClassLoader loader = ConfigurationReader.class.getClassLoader(); >- final URL schema = loader.getResource( W4_TOOLKIT_SCHEMA ); >- factory.setValidating( schema != null ); >- try { >- factory.setAttribute( JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA ); >- } catch( final IllegalArgumentException iae ) { >- // XML-Processing does not support JAXP 1.2 or greater >- factory.setNamespaceAware( false ); >- factory.setValidating( false ); >- } >- DocumentBuilder builder = factory.newDocumentBuilder(); >- builder.setEntityResolver( new EntityResolver() { >- public InputSource resolveEntity( final String publicID, >- final String systemID ) >- throws IOException, SAXException >- { >- InputSource result = null; >- if( schema != null && systemID.endsWith( W4_TOOLKIT_SCHEMA ) ) { >- URLConnection connection = schema.openConnection(); >- connection.setUseCaches( false ); >- result = new InputSource( connection.getInputStream() ); >- } >- return result; >- } >- } ); >- >- // TODO: more sophisticated ErrorHandler implementation... >- builder.setErrorHandler( new ErrorHandler() { >- >- public void error( final SAXParseException spe ) >- throws SAXException >- { >- System.out.println( "Error parsing W4 Toolkit configuration:" ); >- System.out.println( configurationFile.toString() ); >- System.out.println( spe.getMessage() ); >- } >- >- public void fatalError( final SAXParseException spe ) >- throws SAXException >- { >- String msg = "Fatal error parsing W4 Toolkit configuration:"; >- System.out.println( msg ); >- System.out.println( configurationFile.toString() ); >- System.out.println( spe.getMessage() ); >- } >- >- public void warning( final SAXParseException spe ) >- throws SAXException >- { >- System.out.println( "Warning parsing W4 Toolkit configuration:" ); >- System.out.println( configurationFile.toString() ); >- System.out.println( spe.getMessage() ); >- } >- >- } ); >- document = builder.parse( is ); >- } finally { >- is.close(); >- } >- } >- } >- >+ >+ ////////////////// >+ // helping methods >+ > private static String getConfigValue( final String tagName, > final String defaultValue ) > { >@@ -298,18 +78,6 @@ > String result = ""; > if( System.getProperty( tagName ) != null ) { > result = System.getProperty( tagName ); >- } else if( document != null ) { >- NodeList nodeList = document.getElementsByTagName( tagName ); >- Node item = nodeList.item( 0 ); >- if( item != null ) { >- Node firstChild = item.getFirstChild(); >- if( firstChild != null ) { >- String nodeValue = firstChild.getNodeValue(); >- result = nodeValue.trim(); >- } >- } else { >- result = defaultValue; >- } > } else { > result = defaultValue; > } >Index: src/org/eclipse/rwt/internal/EngineConfig.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/rwt/internal/EngineConfig.java,v >retrieving revision 1.2 >diff -u -r1.2 EngineConfig.java >--- src/org/eclipse/rwt/internal/EngineConfig.java 12 Jun 2008 13:12:19 -0000 1.2 >+++ src/org/eclipse/rwt/internal/EngineConfig.java 10 Jan 2011 12:46:13 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2002, 2007 Innoopract Informationssysteme GmbH. >+ * Copyright (c) 2002, 2010 Innoopract Informationssysteme GmbH. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -7,6 +7,7 @@ > * > * Contributors: > * Innoopract Informationssysteme GmbH - initial API and implementation >+ * EclipseSource - ongoing implementation > ******************************************************************************/ > package org.eclipse.rwt.internal; > >@@ -37,14 +38,6 @@ > > // interface methods > //////////////////// >- >- public File getConfigFile() { >- File result = new File( getServerContextDir().toString() >- + CONF >- + File.separator >- + "W4T.xml" ); >- return result; >- } > > public File getLibDir() { > File result = new File( getServerContextDir().toString() >Index: src/org/eclipse/rwt/internal/IConfiguration.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/rwt/internal/IConfiguration.java,v >retrieving revision 1.2 >diff -u -r1.2 IConfiguration.java >--- src/org/eclipse/rwt/internal/IConfiguration.java 12 Jun 2008 13:12:19 -0000 1.2 >+++ src/org/eclipse/rwt/internal/IConfiguration.java 10 Jan 2011 12:46:13 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2002, 2007 Innoopract Informationssysteme GmbH. >+ * Copyright (c) 2002, 2010 Innoopract Informationssysteme GmbH. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -7,9 +7,12 @@ > * > * Contributors: > * Innoopract Informationssysteme GmbH - initial API and implementation >+ * EclipseSource - ongoing implementation > ******************************************************************************/ > package org.eclipse.rwt.internal; > >+import org.eclipse.rwt.internal.lifecycle.RWTLifeCycle; >+ > /** > * <p>This interface provides access to the W4 Toolkit configuration > * settings.</p> >@@ -17,7 +20,36 @@ > */ > public interface IConfiguration { > >- IInitialization getInitialization(); >+ public static final String PARAM_LIFE_CYCLE = "lifecycle"; >+ public static final String PARAM_COMPRESSION = "org.eclipse.rwt.compression"; >+ >+ public static final String LIFE_CYCLE_DEFAULT = RWTLifeCycle.class.getName(); >+ >+ public static final String RESOURCES_DELIVER_FROM_DISK = "deliverFromDisk"; >+ public static final String RESOURCES_DELIVER_BY_SERVLET = "deliverByServlet"; >+ >+ /** >+ * specifies the implementation class that manages the lifecycle of each >+ * request. >+ */ >+ String getLifeCycle(); >+ >+ /** >+ * <p>Returns whether the HTML output of the web appliction is sent >+ * gzipped to browsers that support gzipped network communication >+ * (Should be 'true' for productive versions to save network traffic >+ * and shorten loading time).</p> >+ */ >+ boolean isCompression(); > >- IFileUpload getFileUpload(); >+ /** >+ * <p>Returns whether static resources like JavaScript-libraries, images, >+ * css-files etc. which are available on the applications >+ * classpath are copied to disk and delivered as static files by >+ * a web-server or delivered directly by the servlet engine. >+ * Should be <code>RESOURCES_DELIVER_FROM_DISK</code> in most cases. >+ * Can be <code>RESOURCES_DELIVER_FROM_DISK</code> or >+ * <code>RESOURCES_DELIVER_BY_SERVLET</code>. >+ */ >+ String getResources(); > } >Index: src/org/eclipse/rwt/internal/IEngineConfig.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/rwt/internal/IEngineConfig.java,v >retrieving revision 1.2 >diff -u -r1.2 IEngineConfig.java >--- src/org/eclipse/rwt/internal/IEngineConfig.java 12 Jun 2008 13:12:19 -0000 1.2 >+++ src/org/eclipse/rwt/internal/IEngineConfig.java 10 Jan 2011 12:46:13 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2002, 2007 Innoopract Informationssysteme GmbH. >+ * Copyright (c) 2002, 2010 Innoopract Informationssysteme GmbH. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -7,6 +7,7 @@ > * > * Contributors: > * Innoopract Informationssysteme GmbH - initial API and implementation >+ * EclipseSource - ongoing implementation > ******************************************************************************/ > package org.eclipse.rwt.internal; > >@@ -17,15 +18,6 @@ > * usable for configuration of the W4T engine adapter. > */ > public interface IEngineConfig { >- >- /** >- * This returns a file object that represent a W4T.xml config file >- * containing the configuration for the W4T engine. The file object >- * returned might differ for different engine adapters in the same VM. >- * >- * @return A file object corresponding to a W4T config file. >- */ >- public File getConfigFile(); > > /** > * This returns a file object representing a global lib directory >Index: src/org/eclipse/rwt/internal/IInitialization.java >=================================================================== >RCS file: src/org/eclipse/rwt/internal/IInitialization.java >diff -N src/org/eclipse/rwt/internal/IInitialization.java >--- src/org/eclipse/rwt/internal/IInitialization.java 12 Jun 2008 13:12:19 -0000 1.2 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,187 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2002, 2007 Innoopract Informationssysteme GmbH. >- * All rights reserved. This program and the accompanying materials >- * are made available under the terms of the Eclipse Public License v1.0 >- * which accompanies this distribution, and is available at >- * http://www.eclipse.org/legal/epl-v10.html >- * >- * Contributors: >- * Innoopract Informationssysteme GmbH - initial API and implementation >- ******************************************************************************/ >-package org.eclipse.rwt.internal; >- >-/** >- * <p>This interface provides the common W4Toolkit application parameter >- * settings.</p> >- * <p>This interface is not intended to be implemented by clients.</p> >- * @see org.eclipse.rwt.internal.IConfiguration >- */ >-public interface IInitialization { >- >- public static final String PARAM_LIFE_CYCLE = "lifecycle"; >- >- public static final String LIFE_CYCLE_DEFAULT >- = "com.w4t.engine.lifecycle.standard.LifeCycle_Standard"; >- >- public final static String NOSCRIPT_SUBMITTERS_NONE = "None"; >- public final static String NOSCRIPT_SUBMITTERS_CREATE = "Create"; >- public final static String NOSCRIPT_SUBMITTERS_USE = "Use"; >- >- public static final String RESOURCES_DELIVER_FROM_DISK = "deliverFromDisk"; >- public static final String RESOURCES_DELIVER_BY_SERVLET = "deliverByServlet"; >- >- public static final String HANDLE_MISSING_I18N_RESOURCE_EMPTY = "Empty"; >- public static final String HANDLE_MISSING_I18N_RESOURCE_FAIL = "Fail"; >- public static final String HANDLE_MISSING_I18N_RESOURCE_EXPLICIT = "Explicit"; >- >- >- /** >- * <p>Returns the fully qualified class name of the WebForm that will be >- * displayed when the web application starts.</p> >- */ >- String getStartUpForm(); >- >- /** >- * specifies the implementation class that manages the lifecycle of each >- * request. >- */ >- String getLifeCycle(); >- >- /** >- * <p>Returns the fully qualified class name of a WebForm that >- * displays Exceptions that broke the control flow within >- * the web application. If user-defined, this must be a subclass of >- * <code>WebForm</code> and must implement the >- * <code>WebErrorForm</code> interface.</p> >- * @see org.eclipse.rwt.WebForm >- * @see org.eclipse.rwt.WebErrorForm >- */ >- String getErrorPage(); >- >- /** >- * <p>Returns the fully qualified class name of a WebForm that is used as >- * the entry point for an web-application providing administration >- * information about the main application.</p> >- */ >- String getAdministrationStartupForm(); >- >- /** >- * <p>Returns the fully qualified class name of a WebForm that >- * displays messages that were created within the web application. >- * If user-defined, this must be a subclass of >- * <code>WebForm</code> and must implement the >- * <code>MessageForm</code> interface.</p> >- * @see org.eclipse.rwt.WebForm >- * @see org.eclipse.rwt.MessageForm >- */ >- String getMessagePage(); >- >- /** >- * <p>Returns the path to a writeable directory, used for temporary files.</p> >- */ >- String getWorkDirectory(); >- >- /** >- * <p>Returns the maximum time till the closing of a WebForm on the >- * client is recognized at server side. Time interval, in ms.</p> >- */ >- long getClosingTimeout(); >- >- /** >- * <p>Returns the time interval between scans for closed WebForm at >- * the server side. This value should not be greater than >- * half of the closingTimeout value. Time interval, in ms.</p> >- */ >- long getSkimmerFrequenzy(); >- >- /** >- * <p>Returns whether the W4Toolkit administration pages are accessible >- * via the admin.html page (Shoud be 'false' for productive versions).</p> >- */ >- boolean isDirectMonitoringAccess(); >- >- /** >- * <p>Returns whether the HTML output of the web appliction is sent >- * gzipped to browsers that support gzipped network communication >- * (Should be 'true' for productive versions to save network traffic >- * and shorten loading time).</p> >- */ >- boolean isCompression(); >- >- /** >- * <p>Returns whether the server-side processing time of the HTML >- * page is displayed (on the bottom of the page). This >- * may be useful for application tuning (Should be 'false' >- * for productive versions).</p> >- */ >- boolean isProcessTime(); >- >- /** >- * <p>Returns whether special submitter images are used for browsers >- * that have JavaScript disabled. Possible values are: >- * <ul> >- * <li><code>NOSCRIPT_SUBMITTERS_NONE<code><br> >- * If set to <code>NOSCRIPT_SUBMITTERS_NONE<code>, a standard submitter image >- * is rendered in addition to the labels on link >- * buttons, tree nodes etc.;</li> >- * <li><code>NOSCRIPT_SUBMITTERS_CREATE<code><br> >- * If set to <code>NOSCRIPT_SUBMITTERS_CREATE<code>, a special image is >- * created automatically with the appropriate text and colors. >- * Images created only once and buffered on harddisk >- * in the webapplications image directory. >- * Setting this to 'create' requires an available X >- * server on Unixes, however.</li> >- * <li><code>NOSCRIPT_SUBMITTERS_USE<code><br> >- * If set to <code>NOSCRIPT_SUBMITTERS_USE<code> earlier generated images >- * are used but no new images are generated. If no image is >- * available from disk, a standard submitter image >- * is rendered in addition to the labels on link >- * buttons, tree nodes etc.;</li></ul></p> >- */ >- String getNoscriptSubmitters(); >- >- /** >- * <p>Returns whether static resources like JavaScript-libraries, images, >- * css-files etc. which are available on the applications >- * classpath are copied to disk and delivered as static files by >- * a web-server or delivered directly by the servlet engine. >- * Should be <code>RESOURCES_DELIVER_FROM_DISK</code> in most cases. >- * Can be <code>RESOURCES_DELIVER_FROM_DISK</code> or >- * <code>RESOURCES_DELIVER_BY_SERVLET</code>. >- */ >- String getResources(); >- >- /** >- * <p>This is a special option for certain environments, where >- * the gc algorithm comes too late to unload classes. >- * If set to a number > 0, this will enforce a gc after the >- * specified number of sessions has been invalidated.</p> >- */ >- long getMaxSessionUnboundToForceGC(); >- >- /** >- * <p>W4 Toolkit supports i18n by accepting values like >- * 'property://someKey@some.package.SomePropertiesFile' >- * which are resolved on rendering, so that the specified >- * property is displayed in the HTML output that the user sees.</p> >- * >- * <p>This attribute specifies the behaviour of the resolver >- * when the specifed resource could not be found as expected. >- * (For development, it may be convenient to set this to >- * <code>HANDLE_MISSING_I18N_RESOURCE_EMPTY</code>, whereas >- * probably in productive environments the most sensible setting >- * would be <code>HANDLE_MISSING_I18N_RESOURCE_EMPTY</code> here.)</p> >- * >- * <p>Possible values are: >- * <ul> >- * <li><code>HANDLE_MISSING_I18N_RESOURCE_FAIL</code><br> >- * behaves like a failed assertion, that is a runtime exception is fired.</li> >- * <li><code>HANDLE_MISSING_I18N_RESOURCE_EMPTY</code><br> >- * does nothing and renders an empty String into the component's output.</li> >- * <li><code>HANDLE_MISSING_I18N_RESOURCE_EXPLICIT</code><br> >- * does nothing and renders the property URI literally into the >- * component's output.</li></ul> >- * </p> >- */ >- String getHandleMissingI18NResource(); >-} >Index: src/org/eclipse/rwt/internal/engine/RWTDelegate.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/rwt/internal/engine/RWTDelegate.java,v >retrieving revision 1.10 >diff -u -r1.10 RWTDelegate.java >--- src/org/eclipse/rwt/internal/engine/RWTDelegate.java 14 Jan 2010 13:06:29 -0000 1.10 >+++ src/org/eclipse/rwt/internal/engine/RWTDelegate.java 10 Jan 2011 12:46:13 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2002, 2008 Innoopract Informationssysteme GmbH. >+ * Copyright (c) 2002, 2010 Innoopract Informationssysteme GmbH. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -7,6 +7,7 @@ > * > * Contributors: > * Innoopract Informationssysteme GmbH - initial API and implementation >+ * EclipseSource - ongoing implementation > ******************************************************************************/ > package org.eclipse.rwt.internal.engine; > >@@ -72,7 +73,7 @@ > > ///////////////////////////////////////// > // Methods to be overridden by subclasses >- >+ > protected HttpServletRequest getWrappedRequest( final HttpServletRequest req ) > throws ServletException > { >@@ -95,7 +96,7 @@ > > private void createResourceManagerInstance() { > IConfiguration configuration = ConfigurationReader.getConfiguration(); >- String resources = configuration.getInitialization().getResources(); >+ String resources = configuration.getResources(); > ResourceManagerImpl.createInstance( getWebAppBase().toString(), resources ); > } > >Index: src/org/eclipse/rwt/internal/lifecycle/LifeCycle.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/rwt/internal/lifecycle/LifeCycle.java,v >retrieving revision 1.4 >diff -u -r1.4 LifeCycle.java >--- src/org/eclipse/rwt/internal/lifecycle/LifeCycle.java 9 Feb 2010 15:35:23 -0000 1.4 >+++ src/org/eclipse/rwt/internal/lifecycle/LifeCycle.java 10 Jan 2011 12:46:13 -0000 >@@ -18,23 +18,20 @@ > import org.eclipse.rwt.lifecycle.PhaseListener; > > >-/** <p>The superclass for all implementations of the lifecycle of a request.</p> >- * >- * <p>Implementations can be provided for different compatibility modes. >- * LifeCycles are loaded depending on compatibility mode in the >- * W4TModelCore using the org.eclipse.rap.engine.lifecycle.LifeCycleFactory.</p> >- */ >+/** >+ * The superclass for all implementations of the lifecycle of a request. >+ */ > public abstract class LifeCycle implements ILifeCycle { >- >- /** >- * <p>Executes the lifecycle defined in this LifeCycle. Implementing >- * subclasses use this as entry point to the processing of their phases.</p> >+ >+ /** >+ * Executes the lifecycle defined in this LifeCycle. Implementing subclasses >+ * use this as entry point to the processing of their phases. > */ > public abstract void execute() throws ServletException, IOException; > > public abstract void addPhaseListener( PhaseListener listener ); > > public abstract void removePhaseListener( PhaseListener listener ); >- >+ > public abstract Scope getScope(); > } >Index: src/org/eclipse/rwt/internal/lifecycle/LifeCycleFactory.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/rwt/internal/lifecycle/LifeCycleFactory.java,v >retrieving revision 1.5 >diff -u -r1.5 LifeCycleFactory.java >--- src/org/eclipse/rwt/internal/lifecycle/LifeCycleFactory.java 9 Feb 2010 15:35:23 -0000 1.5 >+++ src/org/eclipse/rwt/internal/lifecycle/LifeCycleFactory.java 10 Jan 2011 12:46:13 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2002, 2007 Innoopract Informationssysteme GmbH. >+ * Copyright (c) 2002, 2010 Innoopract Informationssysteme GmbH. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -7,6 +7,7 @@ > * > * Contributors: > * Innoopract Informationssysteme GmbH - initial API and implementation >+ * EclipseSource - ongoing implementation > ******************************************************************************/ > package org.eclipse.rwt.internal.lifecycle; > >@@ -52,18 +53,13 @@ > String lifeCycleClassName = null; > try { > IConfiguration configuration = ConfigurationReader.getConfiguration(); >- IInitialization initialization = configuration.getInitialization(); >- lifeCycleClassName = initialization.getLifeCycle(); >+ lifeCycleClassName = configuration.getLifeCycle(); > Class lifeCycleClass = Class.forName( lifeCycleClassName ); > result = ( LifeCycle )lifeCycleClass.newInstance(); > if( result.getScope().equals( Scope.APPLICATION ) ) { > globalLifeCycle = result; > } > } catch( Exception ex ) { >- // TODO [w4t] revise: throw exception instead of issuing a warning and >- // returning the w4t standard life cycle >-// System.out.println( "Could not load lifecycle. " + ex.toString() ); >-// result = new org.eclipse.rap.engine.lifecycle.standard.LifeCycle_Standard(); > String text = "Could not load life cycle implementation {0}: {1}"; > Object[] args = new Object[] { lifeCycleClassName, ex.toString() }; > String msg = MessageFormat.format( text, args ); >Index: src/org/eclipse/rwt/internal/service/AbstractServiceHandler.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/rwt/internal/service/AbstractServiceHandler.java,v >retrieving revision 1.4 >diff -u -r1.4 AbstractServiceHandler.java >--- src/org/eclipse/rwt/internal/service/AbstractServiceHandler.java 9 Feb 2010 15:35:23 -0000 1.4 >+++ src/org/eclipse/rwt/internal/service/AbstractServiceHandler.java 10 Jan 2011 12:46:13 -0000 >@@ -36,7 +36,7 @@ > static PrintWriter getOutputWriter() throws IOException { > OutputStreamWriter utf8Writer; > OutputStream out = getResponse().getOutputStream(); >- if( isAcceptEncoding() && getInitProps().isCompression() ) { >+ if( isAcceptEncoding() && getConfiguration().isCompression() ) { > GZIPOutputStream zipStream = new GZIPOutputStream( out ); > utf8Writer = new OutputStreamWriter( zipStream, HTML.CHARSET_NAME_UTF_8 ); > getResponse().setHeader( CONTENT_ENCODING, ENCODING_GZIP ); >@@ -46,9 +46,8 @@ > return new PrintWriter( utf8Writer, false ); > } > >- static IInitialization getInitProps() { >- IConfiguration configuration = ConfigurationReader.getConfiguration(); >- return configuration.getInitialization(); >+ static IConfiguration getConfiguration() { >+ return ConfigurationReader.getConfiguration(); > } > > protected static HttpServletRequest getRequest() { >Index: src/org/eclipse/rwt/internal/service/JSLibraryServiceHandler.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt/org.eclipse.rap.rwt/src/org/eclipse/rwt/internal/service/JSLibraryServiceHandler.java,v >retrieving revision 1.6 >diff -u -r1.6 JSLibraryServiceHandler.java >--- src/org/eclipse/rwt/internal/service/JSLibraryServiceHandler.java 16 Feb 2010 09:45:31 -0000 1.6 >+++ src/org/eclipse/rwt/internal/service/JSLibraryServiceHandler.java 10 Jan 2011 12:46:13 -0000 >@@ -72,7 +72,7 @@ > response.setHeader( HTML.CONTENT_TYPE, HTML.CONTENT_TEXT_JAVASCRIPT ); > response.setHeader( EXPIRES, EXPIRES_NEVER ); > response.setCharacterEncoding( HTML.CHARSET_NAME_UTF_8 ); >- if( isAcceptEncoding() && getInitProps().isCompression()) { >+ if( isAcceptEncoding() && getConfiguration().isCompression()) { > writeCompressedOutput(); > } else { > writeUnCompressedOutput(); >@@ -126,9 +126,8 @@ > return encodings != null && encodings.indexOf( JSLibraryServiceHandler.ENCODING_GZIP ) != -1; > } > >- private static IInitialization getInitProps() { >- IConfiguration configuration = ConfigurationReader.getConfiguration(); >- return configuration.getInitialization(); >+ private static IConfiguration getConfiguration() { >+ return ConfigurationReader.getConfiguration(); > } > > private static JsConcatenator getJsConcatenator() { >#P org.eclipse.rap.rwt.q07.test >Index: src/org/eclipse/rwt/internal/lifecycle/PreserveWidgetsPhaseListener_Test.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt.test/org.eclipse.rap.rwt.q07.test/src/org/eclipse/rwt/internal/lifecycle/PreserveWidgetsPhaseListener_Test.java,v >retrieving revision 1.10 >diff -u -r1.10 PreserveWidgetsPhaseListener_Test.java >--- src/org/eclipse/rwt/internal/lifecycle/PreserveWidgetsPhaseListener_Test.java 21 Jan 2010 15:52:54 -0000 1.10 >+++ src/org/eclipse/rwt/internal/lifecycle/PreserveWidgetsPhaseListener_Test.java 10 Jan 2011 12:46:15 -0000 >@@ -46,8 +46,6 @@ > } > > protected void setUp() throws Exception { >- System.setProperty( IInitialization.PARAM_LIFE_CYCLE, >- RWTLifeCycle.class.getName() ); > Fixture.fakeContext(); > Fixture.fakeNewRequest(); > } >Index: src/org/eclipse/rwt/internal/lifecycle/RWTLifeCycle2_Test.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt.test/org.eclipse.rap.rwt.q07.test/src/org/eclipse/rwt/internal/lifecycle/RWTLifeCycle2_Test.java,v >retrieving revision 1.11 >diff -u -r1.11 RWTLifeCycle2_Test.java >--- src/org/eclipse/rwt/internal/lifecycle/RWTLifeCycle2_Test.java 9 Feb 2010 15:35:25 -0000 1.11 >+++ src/org/eclipse/rwt/internal/lifecycle/RWTLifeCycle2_Test.java 10 Jan 2011 12:46:15 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2008 Innoopract Informationssysteme GmbH. >+ * Copyright (c) 2010 Innoopract Informationssysteme GmbH. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -7,6 +7,7 @@ > * > * Contributors: > * Innoopract Informationssysteme GmbH - initial API and implementation >+ * EclipseSource - ongoing implementation > ******************************************************************************/ > package org.eclipse.rwt.internal.lifecycle; > >@@ -20,7 +21,6 @@ > > import org.eclipse.rwt.*; > import org.eclipse.rwt.internal.AdapterFactoryRegistry; >-import org.eclipse.rwt.internal.IInitialization; > import org.eclipse.rwt.internal.engine.RWTDelegate; > import org.eclipse.rwt.internal.service.*; > import org.eclipse.rwt.internal.theme.ThemeManager; >@@ -305,8 +305,6 @@ > eventLog = new ArrayList(); > StartupPage.configurer = new RWTStartupPageConfigurer(); > Fixture.clearSingletons(); >- System.setProperty( IInitialization.PARAM_LIFE_CYCLE, >- RWTLifeCycle.class.getName() ); > ThemeManager.getInstance().initialize(); > Fixture.registerResourceManager(); > PhaseListenerRegistry.add( new PreserveWidgetsPhaseListener() ); >Index: src/org/eclipse/swt/internal/widgets/displaykit/DisplayLCA_Test.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt.test/org.eclipse.rap.rwt.q07.test/src/org/eclipse/swt/internal/widgets/displaykit/DisplayLCA_Test.java,v >retrieving revision 1.12 >diff -u -r1.12 DisplayLCA_Test.java >--- src/org/eclipse/swt/internal/widgets/displaykit/DisplayLCA_Test.java 21 Jan 2010 15:52:54 -0000 1.12 >+++ src/org/eclipse/swt/internal/widgets/displaykit/DisplayLCA_Test.java 10 Jan 2011 12:46:15 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2002, 2009 Innoopract Informationssysteme GmbH. >+ * Copyright (c) 2002, 2010 Innoopract Informationssysteme GmbH. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -381,8 +381,6 @@ > protected void setUp() throws Exception { > Fixture.fakeContext(); > Fixture.fakeNewRequest(); >- System.setProperty( IInitialization.PARAM_LIFE_CYCLE, >- RWTLifeCycle.class.getName() ); > ThemeManager.getInstance().initialize(); > AdapterManager manager = AdapterManagerImpl.getInstance(); > lifeCycleAdapterFactory = new AdapterFactory() { >#P org.eclipse.rap.rwt.test >Index: src/org/eclipse/rwt/internal/AdapterFactoryRegistry_Test.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt.test/org.eclipse.rap.rwt.test/src/org/eclipse/rwt/internal/AdapterFactoryRegistry_Test.java,v >retrieving revision 1.8 >diff -u -r1.8 AdapterFactoryRegistry_Test.java >--- src/org/eclipse/rwt/internal/AdapterFactoryRegistry_Test.java 21 Jan 2010 15:53:00 -0000 1.8 >+++ src/org/eclipse/rwt/internal/AdapterFactoryRegistry_Test.java 10 Jan 2011 12:46:16 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2002, 2008 Innoopract Informationssysteme GmbH. >+ * Copyright (c) 2002, 2010 Innoopract Informationssysteme GmbH. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -7,6 +7,7 @@ > * > * Contributors: > * Innoopract Informationssysteme GmbH - initial API and implementation >+ * EclipseSource - ongoing implementation > ******************************************************************************/ > > package org.eclipse.rwt.internal; >@@ -39,7 +40,7 @@ > } > > protected void setUp() throws Exception { >- System.setProperty( IInitialization.PARAM_LIFE_CYCLE, >+ System.setProperty( IConfiguration.PARAM_LIFE_CYCLE, > RWTLifeCycle.class.getName() ); > Fixture.fakeContext(); > Fixture.fakeNewRequest(); >Index: src/org/eclipse/rwt/internal/ConfigurationReader_Test.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt.test/org.eclipse.rap.rwt.test/src/org/eclipse/rwt/internal/ConfigurationReader_Test.java,v >retrieving revision 1.4 >diff -u -r1.4 ConfigurationReader_Test.java >--- src/org/eclipse/rwt/internal/ConfigurationReader_Test.java 22 Jul 2010 15:24:46 -0000 1.4 >+++ src/org/eclipse/rwt/internal/ConfigurationReader_Test.java 10 Jan 2011 12:46:16 -0000 >@@ -11,117 +11,18 @@ > ******************************************************************************/ > package org.eclipse.rwt.internal; > >-import java.io.File; >- > import junit.framework.TestCase; > >-import org.eclipse.rwt.Fixture; >- > > public class ConfigurationReader_Test extends TestCase { >- >- private final static File TEST_CONFIG_POOLS >- = new File( Fixture.TEMP_DIR, "w4t_pools.xml" ); >- private final static File TEST_CONFIG_PARTIAL >- = new File( Fixture.TEMP_DIR, "w4t_partial.xml" ); >- private final static File TEST_XSD >- = new File( Fixture.TEMP_DIR, "W4T.xsd" ); >- >- protected void setUp() throws Exception { >- ConfigurationReader.setConfigurationFile( null ); >- Fixture.copyTestResource( "resources/w4t_partial.xml", >- TEST_CONFIG_PARTIAL ); >- } >- >- protected void tearDown() throws Exception { >- System.getProperties().remove( "startUpForm" ); >- System.getProperties().remove( "compatibilityMode" ); >- >- if( TEST_CONFIG_POOLS.exists() ) { >- TEST_CONFIG_POOLS.delete(); >- } >- if( TEST_CONFIG_PARTIAL.exists() ) { >- TEST_CONFIG_PARTIAL.delete(); >- } >- if( TEST_XSD.exists() ) { >- TEST_XSD.delete(); >- } >- ConfigurationReader.setConfigurationFile( null ); >- } >- >+ > public void testConfigurationReading() { >- IConfiguration application = ConfigurationReader.getConfiguration(); >- >- // initialization >- IInitialization initialization = application.getInitialization(); >- String startUpForm = initialization.getStartUpForm(); >- assertEquals( "com.w4t.administration.Startup", startUpForm ); >- String lifeCycle = initialization.getLifeCycle(); >- assertEquals( "com.w4t.engine.lifecycle.standard.LifeCycle_Standard", >- lifeCycle ); >- String errorPage = initialization.getErrorPage(); >- assertEquals( "com.w4t.administration.DefaultErrorForm", errorPage ); >- String adminStartupForm = initialization.getAdministrationStartupForm(); >- assertEquals( "com.w4t.administration.Startup", adminStartupForm ); >- String messagePage = initialization.getMessagePage(); >- assertEquals( "com.w4t.administration.DefaultMessageForm", messagePage ); >- String workDirectory = initialization.getWorkDirectory(); >- assertEquals( "WEB-INF/classes/", workDirectory ); >- long closingTimeout = initialization.getClosingTimeout(); >- assertEquals( 3600000, closingTimeout ); >- long skimmerFrequency = initialization.getSkimmerFrequenzy(); >- assertEquals( 60000, skimmerFrequency ); >- boolean directMonitoringAccess = initialization.isDirectMonitoringAccess(); >- assertEquals( true, directMonitoringAccess ); >- boolean compression = initialization.isCompression(); >+ IConfiguration configuration = ConfigurationReader.getConfiguration(); >+ String lifeCycle = configuration.getLifeCycle(); >+ assertEquals( IConfiguration.LIFE_CYCLE_DEFAULT, lifeCycle ); >+ boolean compression = configuration.isCompression(); > assertEquals( false, compression ); >- boolean processTime = initialization.isProcessTime(); >- assertEquals( false, processTime ); >- String nsSubmitters = initialization.getNoscriptSubmitters(); >- assertEquals( IInitialization.NOSCRIPT_SUBMITTERS_CREATE, nsSubmitters ); >- String resources = initialization.getResources(); >- assertEquals( IInitialization.RESOURCES_DELIVER_FROM_DISK, resources ); >- long maxSessionUnboundToForceGC >- = initialization.getMaxSessionUnboundToForceGC(); >- assertEquals( 0, maxSessionUnboundToForceGC ); >- String handleMissingI18NResource >- = initialization.getHandleMissingI18NResource(); >- assertEquals( IInitialization.HANDLE_MISSING_I18N_RESOURCE_EMPTY, >- handleMissingI18NResource ); >- >- // file upload >- IFileUpload fileUpload = application.getFileUpload(); >- long maxUploadSize = fileUpload.getMaxUploadSize(); >- assertEquals( 4194304, maxUploadSize ); >- long maxMemorySize = fileUpload.getMaxMemorySize(); >- assertEquals( 524288, maxMemorySize ); >- } >- >- public void testPartialInitializationFile() throws Exception { >- ConfigurationReader.setConfigurationFile( TEST_CONFIG_PARTIAL ); >- IConfiguration application = ConfigurationReader.getConfiguration(); >- >- IInitialization initialization = application.getInitialization(); >- String startUpForm = initialization.getStartUpForm(); >- assertEquals( "com.w4t.FakeStartup", startUpForm ); >- String lifeCycle = initialization.getLifeCycle(); >- assertEquals( IInitialization.LIFE_CYCLE_DEFAULT, lifeCycle ); >- } >- >- public void testConfigurationOverridingWithSystemProps() throws Exception { >- String startupFormProp = "trallala"; >- System.setProperty( "startUpForm", startupFormProp ); >- String compatibilityModeProp = "unknown"; >- System.setProperty( "compatibilityMode", compatibilityModeProp ); >- >- ConfigurationReader.setConfigurationFile( TEST_CONFIG_PARTIAL ); >- IConfiguration application = ConfigurationReader.getConfiguration(); >- >- IInitialization initialization = application.getInitialization(); >- String startUpForm = initialization.getStartUpForm(); >- assertEquals( startupFormProp, startUpForm ); >- >- String lifeCycle = initialization.getLifeCycle(); >- assertEquals( IInitialization.LIFE_CYCLE_DEFAULT, lifeCycle ); >+ String resources = configuration.getResources(); >+ assertEquals( IConfiguration.RESOURCES_DELIVER_FROM_DISK, resources ); > } > } >Index: src/org/eclipse/rwt/internal/EngineConfig_Test.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt.test/org.eclipse.rap.rwt.test/src/org/eclipse/rwt/internal/EngineConfig_Test.java,v >retrieving revision 1.3 >diff -u -r1.3 EngineConfig_Test.java >--- src/org/eclipse/rwt/internal/EngineConfig_Test.java 12 Jun 2008 13:23:17 -0000 1.3 >+++ src/org/eclipse/rwt/internal/EngineConfig_Test.java 10 Jan 2011 12:46:16 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2002, 2007 Innoopract Informationssysteme GmbH. >+ * Copyright (c) 2002, 2010 Innoopract Informationssysteme GmbH. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -7,6 +7,7 @@ > * > * Contributors: > * Innoopract Informationssysteme GmbH - initial API and implementation >+ * EclipseSource - ongoing implementation > ******************************************************************************/ > > package org.eclipse.rwt.internal; >@@ -38,6 +39,5 @@ > assertTrue( config.getClassDir().exists() ); > assertTrue( config.getLibDir().exists() ); > assertTrue( config.getServerContextDir().exists() ); >- assertTrue( config.getConfigFile().exists() ); > } > } >\ No newline at end of file >Index: src/org/eclipse/rwt/internal/engine/RWTServletContextListener_Test.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt.test/org.eclipse.rap.rwt.test/src/org/eclipse/rwt/internal/engine/RWTServletContextListener_Test.java,v >retrieving revision 1.9 >diff -u -r1.9 RWTServletContextListener_Test.java >--- src/org/eclipse/rwt/internal/engine/RWTServletContextListener_Test.java 21 Jan 2010 15:53:00 -0000 1.9 >+++ src/org/eclipse/rwt/internal/engine/RWTServletContextListener_Test.java 10 Jan 2011 12:46:16 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2002, 2008 Innoopract Informationssysteme GmbH. >+ * Copyright (c) 2002, 2010 Innoopract Informationssysteme GmbH. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -7,6 +7,7 @@ > * > * Contributors: > * Innoopract Informationssysteme GmbH - initial API and implementation >+ * EclipseSource - ongoing implementation > ******************************************************************************/ > > package org.eclipse.rwt.internal.engine; >@@ -95,10 +96,8 @@ > > protected void setUp() throws Exception { > Fixture.fakeContext(); >- System.setProperty( IInitialization.PARAM_LIFE_CYCLE, >- RWTLifeCycle.class.getName() ); > } >- >+ > protected void tearDown() throws Exception { > Fixture.tearDown(); > AdapterFactoryRegistry.clear(); >Index: src/org/eclipse/rwt/internal/service/JSLibraryServiceHandler_Test.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt.test/org.eclipse.rap.rwt.test/src/org/eclipse/rwt/internal/service/JSLibraryServiceHandler_Test.java,v >retrieving revision 1.6 >diff -u -r1.6 JSLibraryServiceHandler_Test.java >--- src/org/eclipse/rwt/internal/service/JSLibraryServiceHandler_Test.java 16 Feb 2010 09:45:27 -0000 1.6 >+++ src/org/eclipse/rwt/internal/service/JSLibraryServiceHandler_Test.java 10 Jan 2011 12:46:16 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2008 Innoopract Informationssysteme GmbH. >+ * Copyright (c) 2010 Innoopract Informationssysteme GmbH. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -7,6 +7,7 @@ > * > * Contributors: > * Innoopract Informationssysteme GmbH - initial API and implementation >+ * EclipseSource - ongoing implementation > ******************************************************************************/ > package org.eclipse.rwt.internal.service; > >@@ -17,6 +18,7 @@ > import junit.framework.TestCase; > > import org.eclipse.rwt.*; >+import org.eclipse.rwt.internal.IConfiguration; > import org.eclipse.rwt.internal.util.HTML; > > >@@ -33,7 +35,7 @@ > public void testResponseEncoding() throws IOException, ServletException { > // as there is js concatenation in unit test mode switched of > // we only test header settings... >- System.setProperty( "org.eclipse.rwt.compression", "true" ); >+ System.setProperty( IConfiguration.PARAM_COMPRESSION, "true" ); > > // test with encoding not allowed by browser > TestResponse response = ( TestResponse )RWT.getResponse(); >@@ -58,7 +60,7 @@ > assertNotNull( encoding ); > assertEquals( JSLibraryServiceHandler.ENCODING_GZIP, encoding ); > // clean up >- System.getProperties().remove( "org.eclipse.rwt.compression" ); >+ System.getProperties().remove( IConfiguration.PARAM_COMPRESSION ); > } > > public void testRequestURLCreation() throws IOException { >#P org.eclipse.rap.rwt.testfixture >Index: src/org/eclipse/rwt/Fixture.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.rwt.test/org.eclipse.rap.rwt.testfixture/src/org/eclipse/rwt/Fixture.java,v >retrieving revision 1.18 >diff -u -r1.18 Fixture.java >--- src/org/eclipse/rwt/Fixture.java 7 Oct 2010 16:09:51 -0000 1.18 >+++ src/org/eclipse/rwt/Fixture.java 10 Jan 2011 12:46:17 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2002, 2009 Innoopract Informationssysteme GmbH. >+ * Copyright (c) 2002, 2010 Innoopract Informationssysteme GmbH. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -7,6 +7,7 @@ > * > * Contributors: > * Innoopract Informationssysteme GmbH - initial API and implementation >+ * EclipseSource - ongoing implementation > ******************************************************************************/ > > package org.eclipse.rwt; >@@ -16,7 +17,6 @@ > > import javax.servlet.http.*; > import javax.xml.parsers.FactoryConfigurationError; >-import javax.xml.parsers.ParserConfigurationException; > > import junit.framework.Assert; > >@@ -33,7 +33,6 @@ > import org.eclipse.swt.internal.widgets.WidgetAdapter; > import org.eclipse.swt.widgets.Display; > import org.eclipse.swt.widgets.Widget; >-import org.xml.sax.SAXException; > > public class Fixture { > >@@ -58,25 +57,17 @@ > public static void setUp() { > // standard setup > commonSetUp(); >- System.setProperty( IInitialization.PARAM_LIFE_CYCLE, >- RWTLifeCycle.class.getName() ); >- > ThemeManager.getInstance().initialize(); > registerAdapterFactories(); > PhaseListenerRegistry.add( Fixture.currentPhaseListener ); >- > // registration of mockup resource manager > registerResourceManager(); >- > SettingStoreManager.register( new MemorySettingStoreFactory() ); > } > > public static void setUpWithoutResourceManager() { > // standard setup > commonSetUp(); >- System.setProperty( IInitialization.PARAM_LIFE_CYCLE, >- RWTLifeCycle.class.getName() ); >- > // registration of adapter factories > registerAdapterFactories(); > } >@@ -85,12 +76,6 @@ > // disable js-versioning by default to make comparison easier > System.setProperty( SystemProps.USE_VERSIONED_JAVA_SCRIPT, "false" ); > clearSingletons(); >- try { >- ConfigurationReader.setConfigurationFile( null ); >- } catch( Throwable shouldNotHappen ) { >- throw new RuntimeException( shouldNotHappen ); >- } >- > TestResponse response = new TestResponse(); > TestRequest request = new TestRequest(); > request.setSession( new TestSession() ); >@@ -125,15 +110,14 @@ > ContextProvider.disposeContext(); > session.invalidate(); > clearSingletons(); >- System.getProperties().remove( IInitialization.PARAM_LIFE_CYCLE ); >+ System.getProperties().remove( IConfiguration.PARAM_LIFE_CYCLE ); > > AbstractBranding[] all = BrandingManager.getAll(); > for( int i = 0; i < all.length; i++ ) { > BrandingManager.deregister( all[ i ] ); > } >- >+ ConfigurationReader.reset(); > LifeCycleFactory.destroy(); >- > PhaseListenerRegistry.clear(); > } > >@@ -144,10 +128,7 @@ > } > > public static void createContext( final boolean fake ) >- throws IOException, >- FactoryConfigurationError, >- ParserConfigurationException, >- SAXException >+ throws FactoryConfigurationError > { > if( fake ) { > setPrivateField( ResourceManagerImpl.class, >@@ -157,17 +138,13 @@ > } else { > createContextWithoutResourceManager(); > String webAppBase = CONTEXT_DIR.toString(); >- String deliverFromDisk = IInitialization.RESOURCES_DELIVER_FROM_DISK; >+ String deliverFromDisk = IConfiguration.RESOURCES_DELIVER_FROM_DISK; > ResourceManagerImpl.createInstance( webAppBase, deliverFromDisk ); > } > } > > public static void createContextWithoutResourceManager() >- throws FileNotFoundException, >- IOException, >- FactoryConfigurationError, >- ParserConfigurationException, >- SAXException >+ throws FactoryConfigurationError > { > CONTEXT_DIR.mkdirs(); > File webInf = new File( CONTEXT_DIR, "WEB-INF" ); >@@ -178,8 +155,6 @@ > classes.mkdirs(); > File libDir = new File( webInf, "lib" ); > libDir.mkdirs(); >- File w4tXml = new File( conf, "W4T.xml" ); >- copyTestResource( "resources/w4t_fixture.xml", w4tXml ); > > String webAppBase = CONTEXT_DIR.toString(); > EngineConfig engineConfig = new EngineConfig( webAppBase ); >@@ -208,6 +183,10 @@ > { > ClassLoader loader = Fixture.class.getClassLoader(); > InputStream is = loader.getResourceAsStream( resourceName ); >+ if( is == null ) { >+ throw new IllegalArgumentException( "Resource could not be found: " >+ + resourceName ); >+ } > try { > OutputStream out = new FileOutputStream( destination ); > try { >Index: src/resources/w4t_fixture.xml >=================================================================== >RCS file: src/resources/w4t_fixture.xml >diff -N src/resources/w4t_fixture.xml >--- src/resources/w4t_fixture.xml 9 Apr 2008 16:44:14 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,11 +0,0 @@ >-<?xml version="1.0" encoding="UTF-8"?> >-<w4t:application xmlns:w4t="http://w4toolkit.com/" >- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >- xsi:schemaLocation="http://w4toolkit.com/ w4t.xsd "> >- <initialisation> >- <startUpForm> >- com.w4t.FixtureForm >- </startUpForm> >- <noscriptSubmitters>None</noscriptSubmitters> >- </initialisation> >-</w4t:application> >Index: src/resources/w4t_partial.xml >=================================================================== >RCS file: src/resources/w4t_partial.xml >diff -N src/resources/w4t_partial.xml >--- src/resources/w4t_partial.xml 9 Apr 2008 16:44:14 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,10 +0,0 @@ >-<?xml version="1.0" encoding="UTF-8"?> >-<w4t:application xmlns:w4t="http://w4toolkit.com/" >- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >- xsi:schemaLocation="http://w4toolkit.com/ w4t.xsd "> >- <initialisation> >- <startUpForm> >- com.w4t.FakeStartup >- </startUpForm> >- </initialisation> >-</w4t:application> >#P org.eclipse.rap.ui.workbench >Index: Eclipse UI/org/eclipse/rap/ui/internal/servlet/EngineConfigWrapper.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.ui/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/rap/ui/internal/servlet/EngineConfigWrapper.java,v >retrieving revision 1.13 >diff -u -r1.13 EngineConfigWrapper.java >--- Eclipse UI/org/eclipse/rap/ui/internal/servlet/EngineConfigWrapper.java 1 Apr 2010 14:27:58 -0000 1.13 >+++ Eclipse UI/org/eclipse/rap/ui/internal/servlet/EngineConfigWrapper.java 10 Jan 2011 12:46:18 -0000 >@@ -47,10 +47,6 @@ > // TODO: [fappel] clean replacement mechanism that is anchored in W4Toolkit core > final class EngineConfigWrapper implements IEngineConfig { > >- private final static String FOLDER >- = EngineConfigWrapper.class.getPackage().getName().replace( '.', '/' ); >- // path to a w4toolkit configuration file on the classpath >- private final static String CONFIG = FOLDER +"/config.xml"; > // extension point id for adapter factory registration > private static final String ID_ADAPTER_FACTORY > = "org.eclipse.rap.ui.adapterfactory"; >@@ -103,20 +99,6 @@ > return engineConfig.getClassDir(); > } > >- public File getConfigFile() { >- File result = engineConfig.getConfigFile(); >- if( !result.exists() ) { >- result.getParentFile().mkdirs(); >- try { >- result.createNewFile(); >- createConfiguration( result ); >- } catch( final IOException shouldNotHappen ) { >- throw new RuntimeException( shouldNotHappen ); >- } >- } >- return result; >- } >- > public File getLibDir() { > return engineConfig.getLibDir(); > } >@@ -386,27 +368,6 @@ > return stateLocation.append( "context" ); > } > >- private static void createConfiguration( final File destination ) >- throws FileNotFoundException, IOException >- { >- ClassLoader loader = EngineConfigWrapper.class.getClassLoader(); >- InputStream is = loader.getResourceAsStream( CONFIG ); >- try { >- OutputStream out = new FileOutputStream( destination ); >- try { >- int character = is.read(); >- while( character != -1 ) { >- out.write( character ); >- character = is.read(); >- } >- } finally { >- out.close(); >- } >- } finally { >- is.close(); >- } >- } >- > private static void registerResources() { > IExtensionRegistry registry = Platform.getExtensionRegistry(); > IExtensionPoint point = registry.getExtensionPoint( ID_RESOURCES ); >Index: Eclipse UI/org/eclipse/rap/ui/internal/servlet/config.xml >=================================================================== >RCS file: Eclipse UI/org/eclipse/rap/ui/internal/servlet/config.xml >diff -N Eclipse UI/org/eclipse/rap/ui/internal/servlet/config.xml >--- Eclipse UI/org/eclipse/rap/ui/internal/servlet/config.xml 12 Feb 2009 11:11:48 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,7 +0,0 @@ >-<?xml version="1.0" encoding="UTF-8"?> >-<w4t:application xmlns:w4t="http://w4toolkit.com/" >- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >- xsi:schemaLocation="http://w4toolkit.com/ w4t.xsd "> >- <initialisation> >- </initialisation> >-</w4t:application> >\ No newline at end of file
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 320926
: 186386