Author: maksimkaszynski
Date: 2008-03-21 13:21:23 -0400 (Fri, 21 Mar 2008)
New Revision: 7076
Added:
trunk/ui/scrollableDataTable/src/main/config/converter/
trunk/ui/scrollableDataTable/src/main/config/converter/selection.xml
Modified:
trunk/cdk/generator/src/main/resources/META-INF/templates12/componentTag.vm
trunk/cdk/generator/src/main/resources/META-INF/templates12/tag.vm
trunk/cdk/generator/src/main/resources/META-INF/templates12/tagtest.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/framework/api/src/main/java/org/ajax4jsf/Messages.java
trunk/ui/scrollableDataTable/src/main/config/component/scrollable-data-table.xml
Log:
added rowKeyConverter, made separate folders for converters, validators
http://jira.jboss.com/jira/browse/RF-1024
Modified: trunk/cdk/generator/src/main/resources/META-INF/templates12/componentTag.vm
===================================================================
--- trunk/cdk/generator/src/main/resources/META-INF/templates12/componentTag.vm 2008-03-21
17:15:41 UTC (rev 7075)
+++ trunk/cdk/generator/src/main/resources/META-INF/templates12/componentTag.vm 2008-03-21
17:21:23 UTC (rev 7076)
@@ -48,6 +48,8 @@
//Do nothing. Use 'action' instead
#elseif($prop.name == "converter")
setConverterProperty(comp, this._${prop.name});
+ #elseif($prop.name == "rowKeyConverter")
+ setRowKeyConverterProperty(comp, this._${prop.name});
#elseif($prop.name == "validator")
setValidatorProperty(comp, this._${prop.name});
#elseif($prop.name == "valueChangeListener")
Modified: trunk/cdk/generator/src/main/resources/META-INF/templates12/tag.vm
===================================================================
--- trunk/cdk/generator/src/main/resources/META-INF/templates12/tag.vm 2008-03-21 17:15:41
UTC (rev 7075)
+++ trunk/cdk/generator/src/main/resources/META-INF/templates12/tag.vm 2008-03-21 17:21:23
UTC (rev 7076)
@@ -93,6 +93,8 @@
setActionListenerProperty(component, this._${prop.name});
#elseif($prop.name == "converter")
setConverterProperty(component, this._${prop.name});
+ #elseif($prop.name == "rowKeyConverter")
+ setRowKeyConverterProperty(component, this._${prop.name});
#elseif($prop.name == "validator")
setValidatorProperty(component, this._${prop.name});
#elseif($prop.name == "valueChangeListener")
Modified: trunk/cdk/generator/src/main/resources/META-INF/templates12/tagtest.vm
===================================================================
--- trunk/cdk/generator/src/main/resources/META-INF/templates12/tagtest.vm 2008-03-21
17:15:41 UTC (rev 7075)
+++ trunk/cdk/generator/src/main/resources/META-INF/templates12/tagtest.vm 2008-03-21
17:21:23 UTC (rev 7076)
@@ -172,12 +172,12 @@
tag.${prop.setterName}(expression);
tag.setProperties(component);
verify(component);
- #if($prop.name == 'converter')
+ #if($prop.name == 'converter' || $prop.name == 'rowKeyConverter')
String converterType = this.getClass().getName();
expression = new org.ajax4jsf.tests.LiteralValueExpression(converterType);
reset(component);
- component.setConverter(isA(MyConverter.class));
- tag.setConverter(expression);
+ component.${prop.setterName}(isA(MyConverter.class));
+ tag.${prop.setterName}(expression);
replay(component);
tag.setProperties(component);
verify(component);
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 2008-03-21
17:15:41 UTC (rev 7075)
+++
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/AbstractCDKMojo.java 2008-03-21
17:21:23 UTC (rev 7076)
@@ -70,6 +70,24 @@
*/
protected File componentConfigDirectory;
/**
+ * Place for validator configuration XML files. All '*.xml' files wil be
+ * parsed as component config. All '*.ent' files will be processed as
+ * include configurations.
+ *
+ * @parameter expression="src/main/config/validator"
+ */
+ protected File validatorConfigDirectory;
+
+ /**
+ * Place for converter configuration XML files. All '*.xml' files wil be
+ * parsed as components config. All '*.ent' files will be processed as
+ * include configurations.
+ *
+ * @parameter expression="src/main/config/converter"
+ */
+ protected File converterConfigDirectory;
+
+ /**
* Place for faces configuration XML files
*
* @parameter expression="src/main/config/faces"
@@ -166,7 +184,7 @@
String version = Library.JSF11;
// Check version-specific methods in UIComponent class
try {
- Class componentClass = createProjectClassLoader(project,
false).loadClass("javax.faces.component.UIComponent");
+ Class<?> componentClass = createProjectClassLoader(project,
false).loadClass("javax.faces.component.UIComponent");
Method[] methods = componentClass.getDeclaredMethods();
for (int i = 0; i < methods.length; i++) {
if("encodeAll".equals(methods[i].getName())){
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 2008-03-21
17:15:41 UTC (rev 7075)
+++
trunk/cdk/maven-cdk-plugin/src/main/java/org/ajax4jsf/builder/mojo/GenerateMojo.java 2008-03-21
17:21:23 UTC (rev 7076)
@@ -251,13 +251,27 @@
}
};
- File[] files = componentConfigDirectory.listFiles(filter);
- if (null == files) {
+ boolean filesParsed = false;
+ File [] directories = {
+ componentConfigDirectory,
+ validatorConfigDirectory,
+ converterConfigDirectory
+ };
+
+ for (File directory : directories) {
+ if (directory.exists()) {
+ File[] files = directory.listFiles(filter);
+ for (File file : files) {
+ filesParsed = true;
+ builderConfig.parseConfig(file);
+ }
+ }
+ }
+
+ if (!filesParsed) {
throw new ParsingException("No config files found");
}
- for (int i = 0; i < files.length; i++) {
- builderConfig.parseConfig(files[i]);
- }
+
builderConfig.checkComponentProperties();
return builderConfig;
}
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/Messages.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/Messages.java 2008-03-21 17:15:41 UTC
(rev 7075)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/Messages.java 2008-03-21 17:21:23 UTC
(rev 7076)
@@ -252,6 +252,7 @@
public static final String ACESSING_SKIN_PROPERTY_AS_ARRAY_ERROR =
"ACESSING_SKIN_PROPERTY_AS_ARRAY_ERROR";
public static final String ACESSING_SKIN_PROPERTY_ERROR =
"ACESSING_SKIN_PROPERTY_ERROR";
public static final String SKIN_PROPERTIES_READ_ONLY_ERROR =
"SKIN_PROPERTIES_READ_ONLY_ERROR";
+ public static final String NO_DATA_ADAPTOR = "NO_DATA_ADAPTOR";
public static final String NO_VALUE_HOLDER_ERROR = "NO_VALUE_HOLDER_ERROR";
public static final String NO_EDITABLE_VALUE_HOLDER_ERROR =
"NO_EDITABLE_VALUE_HOLDER_ERROR";
public static final String INVALID_VALIDATION_EXPRESSION =
"INVALID_VALIDATION_EXPRESSION";
Modified:
trunk/ui/scrollableDataTable/src/main/config/component/scrollable-data-table.xml
===================================================================
---
trunk/ui/scrollableDataTable/src/main/config/component/scrollable-data-table.xml 2008-03-21
17:15:41 UTC (rev 7075)
+++
trunk/ui/scrollableDataTable/src/main/config/component/scrollable-data-table.xml 2008-03-21
17:21:23 UTC (rev 7076)
@@ -278,10 +278,4 @@
<template>org/richfaces/scrollable-data-table-header-itself.jspx</template>
</renderer>
- <converter generate="false">
- <classname>org.richfaces.convert.selection.ClientSelectionConverter</classname>
- <forclass>org.richfaces.model.selection.ClientSelection</forclass>
- </converter>
-
-
</components>
\ No newline at end of file
Added: trunk/ui/scrollableDataTable/src/main/config/converter/selection.xml
===================================================================
--- trunk/ui/scrollableDataTable/src/main/config/converter/selection.xml
(rev 0)
+++ trunk/ui/scrollableDataTable/src/main/config/converter/selection.xml 2008-03-21
17:21:23 UTC (rev 7076)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE components PUBLIC "-//AJAX4JSF//CDK Generator config/EN"
"https://ajax4jsf.dev.java.net/nonav/dtds/component-config.dtd"
+
+>
+
+<components>
+ <converter generate="false">
+ <classname>org.richfaces.convert.selection.ClientSelectionConverter</classname>
+ <forclass>org.richfaces.model.selection.ClientSelection</forclass>
+ </converter>
+</components>
\ No newline at end of file