Author: alexsmirnov
Date: 2007-05-07 13:59:31 -0400 (Mon, 07 May 2007)
New Revision: 180
Added:
trunk/framework/src/main/config/resources/
trunk/framework/src/main/config/resources/resources-config.xml
Removed:
trunk/framework/src/main/resources/META-INF/resources-config.xml
Modified:
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesConfigGenerator.java
trunk/cdk/generator/src/main/resources/META-INF/templates/resources-config.vm
trunk/cdk/generator/src/main/resources/META-INF/templates12/resources-config.vm
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/AbstractCDKMojo.java
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/GenerateMojo.java
trunk/samples/useCases/src/main/webapp/pages/controls.xhtml
Log:
fix AJSF-58 issue. Generated resource-config.xml has been overryde manual configuration.
Fix generator to include conten of a manual cgeated configuration into generated file.
Modified:
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesConfigGenerator.java
===================================================================
---
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesConfigGenerator.java 2007-05-07
13:16:19 UTC (rev 179)
+++
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/ResourcesConfigGenerator.java 2007-05-07
17:59:31 UTC (rev 180)
@@ -272,7 +272,7 @@
context.put("classResources", bean.getClassResources());
context.put("pathResources", bean.getPathResources());
- context.put("facesConfig", this);
+ context.put("resourcesConfig", this);
File configFile = getResourcesConfig();
File javaDir = configFile.getParentFile();
if (!javaDir.exists()) {
Modified: trunk/cdk/generator/src/main/resources/META-INF/templates/resources-config.vm
===================================================================
---
trunk/cdk/generator/src/main/resources/META-INF/templates/resources-config.vm 2007-05-07
13:16:19 UTC (rev 179)
+++
trunk/cdk/generator/src/main/resources/META-INF/templates/resources-config.vm 2007-05-07
17:59:31 UTC (rev 180)
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<resource-config>
+<!-- Include manual created resource -->
+${resourcesConfig.includeContent}
#foreach( $key in ${classResources.keySet()})
<resource class="${classResources.get($key)}">
Modified: trunk/cdk/generator/src/main/resources/META-INF/templates12/resources-config.vm
===================================================================
---
trunk/cdk/generator/src/main/resources/META-INF/templates12/resources-config.vm 2007-05-07
13:16:19 UTC (rev 179)
+++
trunk/cdk/generator/src/main/resources/META-INF/templates12/resources-config.vm 2007-05-07
17:59:31 UTC (rev 180)
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<resource-config>
+<!-- Include manual created resource -->
+${resourcesConfig.includeContent}
#foreach( $key in ${classResources.keySet()})
<resource class="${classResources.get($key)}">
Modified:
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/AbstractCDKMojo.java
===================================================================
---
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/AbstractCDKMojo.java 2007-05-07
13:16:19 UTC (rev 179)
+++
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/AbstractCDKMojo.java 2007-05-07
17:59:31 UTC (rev 180)
@@ -81,7 +81,13 @@
*/
protected File taglibInclude;
/**
+ * Place for component configuration XML files
*
+ * @parameter expression="src/main/config/resources"
+ */
+ protected File resourcesInclude;
+ /**
+ *
* @parameter expression="src/main/templates"
*/
protected File templatesDirectory;
Modified:
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/GenerateMojo.java
===================================================================
---
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/GenerateMojo.java 2007-05-07
13:16:19 UTC (rev 179)
+++
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/GenerateMojo.java 2007-05-07
17:59:31 UTC (rev 180)
@@ -200,6 +200,7 @@
// Generate resources configuration file resources-config.xml
// for all images/scripts/css...
ResourcesConfigGenerator resourcesConfigGenerator = new
ResourcesConfigGenerator(resourcesConfiguration, mavenLogger);
+ resourcesConfigGenerator.setInclude(resourcesInclude);
resourcesConfigGenerator.setTemplates(templatesDirectory);
resourcesConfigGenerator.setResourcesConfig(new File(
outputResourcesDirectory, "META-INF/resources-config.xml"));
Added: trunk/framework/src/main/config/resources/resources-config.xml
===================================================================
--- trunk/framework/src/main/config/resources/resources-config.xml
(rev 0)
+++ trunk/framework/src/main/config/resources/resources-config.xml 2007-05-07 17:59:31 UTC
(rev 180)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<resource-config>
+ <resource class="org.ajax4jsf.framework.ajax.AjaxScript">
+ <name>org.ajax4jsf.framework.ajax.AjaxScript</name>
+ </resource>
+ <resource class="org.ajax4jsf.framework.ajax.AjaxScript">
+ <name>ajax.js</name>
+ </resource>
+ <resource class="org.ajax4jsf.framework.resource.PrototypeScript">
+ <name>prototype.js</name>
+ </resource>
+ <resource class="org.ajax4jsf.dnd.DnDScript">
+ <name>dnd.js</name>
+ </resource>
+ <resource >
+ <name>form.js</name>
+ <path>/org/ajax4jsf/renderkit/html/scripts/form.js</path>
+ <renderer class="org.ajax4jsf.framework.resource.ScriptRenderer"/>
+ </resource>
+ <resource >
+ <name>org/ajax4jsf/renderers/ajax/scripts/form.js</name>
+ <path>/org/ajax4jsf/renderkit/html/scripts/form.js</path>
+ <renderer class="org.ajax4jsf.framework.resource.ScriptRenderer"/>
+ </resource>
+</resource-config>
Deleted: trunk/framework/src/main/resources/META-INF/resources-config.xml
===================================================================
--- trunk/framework/src/main/resources/META-INF/resources-config.xml 2007-05-07 13:16:19
UTC (rev 179)
+++ trunk/framework/src/main/resources/META-INF/resources-config.xml 2007-05-07 17:59:31
UTC (rev 180)
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<resource-config>
- <resource class="org.ajax4jsf.framework.ajax.AjaxScript">
- <name>org.ajax4jsf.framework.ajax.AjaxScript</name>
- </resource>
- <resource class="org.ajax4jsf.framework.ajax.AjaxScript">
- <name>ajax.js</name>
- </resource>
- <resource class="org.ajax4jsf.framework.resource.PrototypeScript">
- <name>prototype.js</name>
- </resource>
- <resource class="org.ajax4jsf.dnd.DnDScript">
- <name>dnd.js</name>
- </resource>
- <resource >
- <name>form.js</name>
- <path>/org/ajax4jsf/renderkit/html/scripts/form.js</path>
- <renderer class="org.ajax4jsf.framework.resource.ScriptRenderer"/>
- </resource>
- <resource >
- <name>org/ajax4jsf/renderers/ajax/scripts/form.js</name>
- <path>/org/ajax4jsf/renderkit/html/scripts/form.js</path>
- <renderer class="org.ajax4jsf.framework.resource.ScriptRenderer"/>
- </resource>
-</resource-config>
Modified: trunk/samples/useCases/src/main/webapp/pages/controls.xhtml
===================================================================
--- trunk/samples/useCases/src/main/webapp/pages/controls.xhtml 2007-05-07 13:16:19 UTC
(rev 179)
+++ trunk/samples/useCases/src/main/webapp/pages/controls.xhtml 2007-05-07 17:59:31 UTC
(rev 180)
@@ -9,6 +9,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<a4j:loadStyle src="/css/global.css" />
+ <a4j:loadScript src="resource://prototype.js" />
</head>
<body>
<a4j:form id="headForm">