You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2006/04/02 18:58:23 UTC
svn commit: r390857 - in /incubator/tobago/trunk:
tobago-core/src/main/java/org/apache/myfaces/tobago/config/
tobago-core/src/main/java/org/apache/myfaces/tobago/context/
tobago-core/src/main/resources/org/apache/myfaces/tobago/config/
tobago-example/t...
Author: lofwyr
Date: Sun Apr 2 09:58:21 2006
New Revision: 390857
URL: http://svn.apache.org/viewcvs?rev=390857&view=rev
Log:
remove load-resources-from-classpath, it is no longer needed
Modified:
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfig.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfigParser.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceLocator.java
incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceManagerFactory.java
incubator/tobago/trunk/tobago-core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config_1_0.dtd
incubator/tobago/trunk/tobago-example/tobago-example-addressbook/src/main/webapp/WEB-INF/tobago-config.xml
incubator/tobago/trunk/tobago-example/tobago-example-blank/src/main/webapp/WEB-INF/tobago-config.xml
incubator/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tobago-config.xml
incubator/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/property/miniHowto.properties.xml
incubator/tobago/trunk/tobago-example/tobago-example-facelets/src/main/webapp/WEB-INF/tobago-config.xml
incubator/tobago/trunk/tobago-example/tobago-example-foreach/src/main/webapp/WEB-INF/tobago-config.xml
incubator/tobago/trunk/tobago-example/tobago-example-nonfacesrequest/src/main/webapp/WEB-INF/tobago-config.xml
incubator/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/tobago-config.xml
incubator/tobago/trunk/tobago-tool/gendoc/src/main/webapp/WEB-INF/tobago-config.xml
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfig.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfig.java?rev=390857&r1=390856&r2=390857&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfig.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfig.java Sun Apr 2 09:58:21 2006
@@ -40,7 +40,6 @@
private Theme defaultTheme;
private String defaultThemeName;
private Set<String> resourceDirs;
- private boolean loadThemesFromClasspath = true;
private List<MappingRule> mappingRules;
private boolean ajaxEnabled;
private Map<String, Theme> availableTheme;
@@ -164,14 +163,6 @@
public void setAjaxEnabled(String value) {
this.ajaxEnabled = Boolean.valueOf(value);
- }
-
- public boolean isLoadThemesFromClasspath() {
- return loadThemesFromClasspath;
- }
-
- public void setLoadThemesFromClasspath(String loadThemesFromClasspath) {
- this.loadThemesFromClasspath = Boolean.valueOf(loadThemesFromClasspath);
}
public Theme getDefaultTheme() {
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfigParser.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfigParser.java?rev=390857&r1=390856&r2=390857&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfigParser.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/config/TobagoConfigParser.java Sun Apr 2 09:58:21 2006
@@ -71,9 +71,6 @@
digester.addCallMethod(
"tobago-config/mapping-rule/attribute/value", "setValue", 0);
- // enable loading theme from classpath
- digester.addCallMethod("tobago-config/load-theme-resources-from-classpath", "setLoadThemesFromClasspath", 0);
-
// resource dirs
digester.addCallMethod("tobago-config/resource-dir", "addResourceDir", 0);
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceLocator.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceLocator.java?rev=390857&r1=390856&r2=390857&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceLocator.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceLocator.java Sun Apr 2 09:58:21 2006
@@ -43,25 +43,16 @@
private static final Log LOG = LogFactory.getLog(ResourceLocator.class);
-// todo: Test for new theme build mechanism still under development
-// http://issues.apache.org/jira/browse/MYFACES-1106
-// to activate you have to do:
-// 1. set load-theme-resources-from-classpath = true in the tobago-config.xml
-// 2. add resource-path in tobago-config.xml
-// 3. add ResourceServlet in web.xml
-
private ServletContext servletContext;
private ResourceManagerImpl resourceManager;
private ThemeBuilder themeBuilder;
- private boolean loadThemesFromClasspath;
public ResourceLocator(
ServletContext servletContext, ResourceManagerImpl resourceManager,
- ThemeBuilder tobagoConfig, boolean loadThemesFromClasspath) {
+ ThemeBuilder tobagoConfig) {
this.servletContext = servletContext;
this.resourceManager = resourceManager;
this.themeBuilder = tobagoConfig;
- this.loadThemesFromClasspath = loadThemesFromClasspath;
}
public void locate()
@@ -126,7 +117,6 @@
themeBuilder.addTheme(theme);
String prefix = ensureSlash(theme.getResourcePath());
- // TODO other protocols
String protocol = themeUrl.getProtocol();
// tomcat uses jar
// weblogic uses zip
@@ -164,9 +154,7 @@
LOG.info(inputStream);
addProperties(inputStream, resources, name, true);
} else {
- if (loadThemesFromClasspath) {
- resources.add(name);
- }
+ resources.add(name);
}
}
}
@@ -174,7 +162,9 @@
IOUtils.closeQuietly(stream);
}
} else {
- LOG.error("Unknown protocol '"+themeUrl + "'");
+ String error = "Unknown protocol '" + themeUrl + "'";
+ LOG.error(error);
+ throw new Exception(error);
}
}
} catch (Exception e) {
@@ -204,21 +194,12 @@
String directory = childPath.substring(0, childPath.lastIndexOf('/'));
String filename = childPath.substring(childPath.lastIndexOf('/') + 1);
- int begin = filename.indexOf('_') + 1;
int end = filename.lastIndexOf('.');
if (xml) {
end = filename.lastIndexOf('.', end - 1);
}
- String locale;
-/*
- if (begin > 0) {
- locale = filename.substring(begin, end);
- } else {
- locale = "default";
- }
-*/
- locale = filename.substring(0, end);
+ String locale = filename.substring(0, end);
Properties temp = new Properties();
Modified: incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceManagerFactory.java
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceManagerFactory.java?rev=390857&r1=390856&r2=390857&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceManagerFactory.java (original)
+++ incubator/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/context/ResourceManagerFactory.java Sun Apr 2 09:58:21 2006
@@ -53,8 +53,7 @@
ThemeBuilder themeBuilder = new ThemeBuilder();
ResourceLocator resourceLocator = new ResourceLocator(
- servletContext, resourceManager, themeBuilder,
- tobagoConfig.isLoadThemesFromClasspath());
+ servletContext, resourceManager, themeBuilder);
resourceLocator.locate();
Map<String, Theme> availableThemes = themeBuilder.resolveThemes();
tobagoConfig.setAvailableThemes(availableThemes);
Modified: incubator/tobago/trunk/tobago-core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config_1_0.dtd
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config_1_0.dtd?rev=390857&r1=390856&r2=390857&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config_1_0.dtd (original)
+++ incubator/tobago/trunk/tobago-core/src/main/resources/org/apache/myfaces/tobago/config/tobago-config_1_0.dtd Sun Apr 2 09:58:21 2006
@@ -30,6 +30,7 @@
<!ELEMENT resource-dir (#PCDATA)>
+<!-- deprecated -->
<!ELEMENT load-theme-resources-from-classpath (#PCDATA)>
<!ELEMENT mapping-rule (request-uri, forward-uri, attribute*)>
Modified: incubator/tobago/trunk/tobago-example/tobago-example-addressbook/src/main/webapp/WEB-INF/tobago-config.xml
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-example/tobago-example-addressbook/src/main/webapp/WEB-INF/tobago-config.xml?rev=390857&r1=390856&r2=390857&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-example/tobago-example-addressbook/src/main/webapp/WEB-INF/tobago-config.xml (original)
+++ incubator/tobago/trunk/tobago-example/tobago-example-addressbook/src/main/webapp/WEB-INF/tobago-config.xml Sun Apr 2 09:58:21 2006
@@ -22,10 +22,8 @@
<tobago-config>
<theme-config>
- <default-theme>org.apache.myfaces.tobago.context.SpeysideTheme</default-theme>
+ <default-theme>speyside</default-theme>
</theme-config>
<resource-dir>tobago-resource</resource-dir>
- <resource-dir>org/apache/myfaces/tobago/renderkit</resource-dir>
- <load-theme-resources-from-classpath>true</load-theme-resources-from-classpath>
</tobago-config>
Modified: incubator/tobago/trunk/tobago-example/tobago-example-blank/src/main/webapp/WEB-INF/tobago-config.xml
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-example/tobago-example-blank/src/main/webapp/WEB-INF/tobago-config.xml?rev=390857&r1=390856&r2=390857&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-example/tobago-example-blank/src/main/webapp/WEB-INF/tobago-config.xml (original)
+++ incubator/tobago/trunk/tobago-example/tobago-example-blank/src/main/webapp/WEB-INF/tobago-config.xml Sun Apr 2 09:58:21 2006
@@ -22,7 +22,7 @@
<tobago-config>
<theme-config>
- <default-theme>org.apache.myfaces.tobago.context.SpeysideTheme</default-theme>
+ <default-theme>speyside</default-theme>
</theme-config>
<resource-dir>tobago-resource</resource-dir>
Modified: incubator/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tobago-config.xml
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tobago-config.xml?rev=390857&r1=390856&r2=390857&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tobago-config.xml (original)
+++ incubator/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tobago-config.xml Sun Apr 2 09:58:21 2006
@@ -28,6 +28,5 @@
</theme-config>
<resource-dir>tobago-resource</resource-dir>
- <load-theme-resources-from-classpath>false</load-theme-resources-from-classpath>
<ajax-enabled>true</ajax-enabled>
</tobago-config>
Modified: incubator/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/property/miniHowto.properties.xml
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/property/miniHowto.properties.xml?rev=390857&r1=390856&r2=390857&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/property/miniHowto.properties.xml (original)
+++ incubator/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/tobago-resource/html/standard/standard/property/miniHowto.properties.xml Sun Apr 2 09:58:21 2006
@@ -131,7 +131,7 @@
<entry key="themesCodeExample1">...
<tobago-config>
 <theme-config>
- Â Â <default-theme>org.apache.myfaces.tobago.context.SpeysideTheme</default-theme>
+ Â Â <default-theme>speyside</default-theme>
 </theme-config>
 <resource-dir>tobago</resource-dir>
</tobago-config>
Modified: incubator/tobago/trunk/tobago-example/tobago-example-facelets/src/main/webapp/WEB-INF/tobago-config.xml
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-example/tobago-example-facelets/src/main/webapp/WEB-INF/tobago-config.xml?rev=390857&r1=390856&r2=390857&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-example/tobago-example-facelets/src/main/webapp/WEB-INF/tobago-config.xml (original)
+++ incubator/tobago/trunk/tobago-example/tobago-example-facelets/src/main/webapp/WEB-INF/tobago-config.xml Sun Apr 2 09:58:21 2006
@@ -22,7 +22,7 @@
<tobago-config>
<theme-config>
- <default-theme>org.apache.myfaces.tobago.context.SpeysideTheme</default-theme>
+ <default-theme>speyside</default-theme>
</theme-config>
<resource-dir>tobago-resource</resource-dir>
Modified: incubator/tobago/trunk/tobago-example/tobago-example-foreach/src/main/webapp/WEB-INF/tobago-config.xml
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-example/tobago-example-foreach/src/main/webapp/WEB-INF/tobago-config.xml?rev=390857&r1=390856&r2=390857&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-example/tobago-example-foreach/src/main/webapp/WEB-INF/tobago-config.xml (original)
+++ incubator/tobago/trunk/tobago-example/tobago-example-foreach/src/main/webapp/WEB-INF/tobago-config.xml Sun Apr 2 09:58:21 2006
@@ -22,13 +22,11 @@
<tobago-config>
<theme-config>
- <default-theme>org.apache.myfaces.tobago.context.SpeysideTheme</default-theme>
- <supported-theme>org.apache.myfaces.tobago.context.ScarboroughTheme</supported-theme>
- <supported-theme>org.apache.myfaces.tobago.context.RichmondTheme</supported-theme>
+ <default-theme>speyside</default-theme>
+ <supported-theme>scarborough</supported-theme>
+ <supported-theme>richmond</supported-theme>
</theme-config>
<resource-dir>tobago-resource</resource-dir>
- <resource-dir>org/apache/myfaces/tobago/renderkit</resource-dir>
- <load-theme-resources-from-classpath>true</load-theme-resources-from-classpath>
</tobago-config>
Modified: incubator/tobago/trunk/tobago-example/tobago-example-nonfacesrequest/src/main/webapp/WEB-INF/tobago-config.xml
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-example/tobago-example-nonfacesrequest/src/main/webapp/WEB-INF/tobago-config.xml?rev=390857&r1=390856&r2=390857&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-example/tobago-example-nonfacesrequest/src/main/webapp/WEB-INF/tobago-config.xml (original)
+++ incubator/tobago/trunk/tobago-example/tobago-example-nonfacesrequest/src/main/webapp/WEB-INF/tobago-config.xml Sun Apr 2 09:58:21 2006
@@ -22,12 +22,9 @@
<tobago-config>
<theme-config>
- <default-theme>org.apache.myfaces.tobago.context.SpeysideTheme</default-theme>
- <supported-theme>org.apache.myfaces.tobago.context.ScarboroughTheme</supported-theme>
+ <default-theme>speyside</default-theme>
</theme-config>
<resource-dir>tobago-resource</resource-dir>
- <resource-dir>org/apache/myfaces/tobago/renderkit</resource-dir>
- <load-theme-resources-from-classpath>true</load-theme-resources-from-classpath>
</tobago-config>
Modified: incubator/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/tobago-config.xml
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/tobago-config.xml?rev=390857&r1=390856&r2=390857&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/tobago-config.xml (original)
+++ incubator/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/tobago-config.xml Sun Apr 2 09:58:21 2006
@@ -22,10 +22,8 @@
<tobago-config>
<theme-config>
- <default-theme>org.apache.myfaces.tobago.context.SpeysideTheme</default-theme>
+ <default-theme>speyside</default-theme>
</theme-config>
<resource-dir>tobago-resource</resource-dir>
- <resource-dir>org/apache/myfaces/tobago/renderkit</resource-dir>
- <load-theme-resources-from-classpath>true</load-theme-resources-from-classpath>
</tobago-config>
Modified: incubator/tobago/trunk/tobago-tool/gendoc/src/main/webapp/WEB-INF/tobago-config.xml
URL: http://svn.apache.org/viewcvs/incubator/tobago/trunk/tobago-tool/gendoc/src/main/webapp/WEB-INF/tobago-config.xml?rev=390857&r1=390856&r2=390857&view=diff
==============================================================================
--- incubator/tobago/trunk/tobago-tool/gendoc/src/main/webapp/WEB-INF/tobago-config.xml (original)
+++ incubator/tobago/trunk/tobago-tool/gendoc/src/main/webapp/WEB-INF/tobago-config.xml Sun Apr 2 09:58:21 2006
@@ -22,8 +22,8 @@
<tobago-config>
<theme-config>
- <default-theme>org.apache.myfaces.tobago.context.SpeysideTheme</default-theme>
- <supported-theme>org.apache.myfaces.tobago.context.ScarboroughTheme</supported-theme>
+ <default-theme>speyside</default-theme>
+ <supported-theme>scarborough</supported-theme>
</theme-config>
<resource-dir>tobago-resource</resource-dir>