JBoss Rich Faces SVN: r16353 - in root/cdk/trunk/plugins/generator/src: main/java/org/richfaces/cdk/templatecompiler and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-01-22 07:44:51 -0500 (Fri, 22 Jan 2010)
New Revision: 16353
Removed:
root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/java/macros/
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/Argument.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaAnnotation.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaClass.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaField.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaLanguageElement.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaMethod.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaPackage.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/RuntimeImport.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassGenerator.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassVisitor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/Template.java
root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/java/class.ftl
root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/java/write-attribute.ftl
root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/java/write-attributes-set.ftl
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/RendererTemplateParserTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/XhtmlAttributesParsingTest.java
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/templatecompiler/dummy.template.xml
Log:
https://jira.jboss.org/jira/browse/RF-7732
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/Argument.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/Argument.java 2010-01-21 16:09:49 UTC (rev 16352)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/Argument.java 2010-01-22 12:44:51 UTC (rev 16353)
@@ -27,20 +27,28 @@
* @author Maksim Kaszynski
*/
public class Argument {
+
private String name;
- private Class<?> type;
+
+ private JavaClass type;
public Argument(String name, Class<?> type) {
super();
this.name = name;
- this.type = type;
+ this.type = new JavaClass(type);
}
+ public Argument(String name, String type) {
+ super();
+ this.name = name;
+ this.type = new JavaClass(type);
+ }
+
public static Argument arg(String name, Class<?> type) {
return new Argument(name, type);
}
- public Class<?> getType() {
+ public JavaClass getType() {
return type;
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaAnnotation.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaAnnotation.java 2010-01-21 16:09:49 UTC (rev 16352)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaAnnotation.java 2010-01-22 12:44:51 UTC (rev 16353)
@@ -32,19 +32,19 @@
*/
public class JavaAnnotation {
private List<String> arguments = new ArrayList<String>();
- private Class<?> type;
+ private JavaClass type;
- public JavaAnnotation(Class<?> type) {
+ public JavaAnnotation(JavaClass type) {
super();
this.type = type;
}
- public JavaAnnotation(Class<?> type, String... parameters) {
+ public JavaAnnotation(JavaClass type, String... parameters) {
this(type);
this.arguments = Arrays.asList(parameters);
}
- public Class<?> getType() {
+ public JavaClass getType() {
return type;
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaClass.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaClass.java 2010-01-21 16:09:49 UTC (rev 16352)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaClass.java 2010-01-22 12:44:51 UTC (rev 16353)
@@ -45,6 +45,8 @@
private JavaClass superClass = DEFAULT_SUPERCLASS;
private JavaPackage pakg;
+ private String simpleName;
+
public JavaClass() {
super();
}
@@ -53,22 +55,66 @@
this(clazz.getSimpleName(), new JavaPackage(clazz.getPackage()));
}
- public JavaClass(String shortName, JavaPackage pakg) {
- super(shortName);
+ public JavaClass(String name) {
+ this(getSimpleName(name), createPackage(name));
+ }
+
+ public JavaClass(String simpleName, JavaPackage pakg) {
+ super(getFullName(pakg, simpleName));
this.pakg = pakg;
+ this.simpleName = simpleName;
}
- public JavaClass(String shortName, JavaPackage pakg, Class<?> superClass) {
- this(shortName, pakg);
+ public JavaClass(String simpleName, JavaPackage pakg, Class<?> superClass) {
+ this(simpleName, pakg);
setSuperClass(new JavaClass(superClass));
}
+ private static String getFullName(JavaPackage javaPackage, String className) {
+ StringBuilder fullName = new StringBuilder();
+
+ fullName.append(javaPackage.getName());
+
+ if (fullName.length() != 0) {
+ fullName.append('.');
+ }
+ fullName.append(className);
+
+ return fullName.toString();
+ }
+
+ private static JavaPackage createPackage(String name) {
+ int lastDotIdx = name.lastIndexOf('.');
+
+ if (lastDotIdx != -1) {
+ return new JavaPackage(name.substring(0, lastDotIdx));
+ } else {
+ return new JavaPackage("");
+ }
+ }
+
+ private static String getSimpleName(String name) {
+ int lastDotIdx = name.lastIndexOf('.');
+
+ if (lastDotIdx != -1) {
+ return name.substring(lastDotIdx + 1);
+ } else {
+ return name;
+ }
+ }
+
public void addImport(String name) {
- imports.add(new RuntimeImport(name));
+ if (shouldAddToImports(name)) {
+ imports.add(new RuntimeImport(name));
+ }
}
+ public void addImport(JavaClass javaClass) {
+ addImport(javaClass.getName());
+ }
+
public void addImport(Class<?> claz) {
- if (shouldAddToImports(claz)) {
+ if (shouldAddToImports(claz.getName())) {
imports.add(new ClassImport(claz));
}
}
@@ -139,7 +185,7 @@
public void setSuperClass(JavaClass superClass) {
this.superClass = superClass;
- addImport(superClass.getFullName());
+ addImport(superClass.getName());
}
public void setPackage(JavaPackage s) {
@@ -162,37 +208,24 @@
return imports;
}
- public String getFullName() {
- StringBuilder fullName = new StringBuilder();
-
- fullName.append(getPackage().getName());
-
- if (fullName.length() != 0) {
- fullName.append('.');
- fullName.append(getName());
- }
-
- return fullName.toString();
+ public String getSimpleName() {
+ return simpleName;
}
-
- // FIXME: remodel this method so that it imports set is aligned when rendering
- private boolean shouldAddToImports(Class<?> clas) {
- boolean result = false;
-
- if (clas != null) {
- Package p = clas.getPackage();
- JavaPackage jp = getPackage();
-
- if (!(clas.isPrimitive() || p == null)) {
- String importPackageName = p.getName();
-
- if (importPackageName != null && importPackageName.length() != 0) {
- result = !(importPackageName.equals("java.lang")
- || (jp != null && importPackageName.equals(jp.getName())));
- }
- }
+
+ private boolean shouldAddToImports(String className) {
+ if (className == null || className.length() == 0) {
+ return false;
}
-
- return result;
+
+ //default package & primitive types
+ if (className.indexOf('.') == -1) {
+ return false;
+ }
+
+ if (className.matches("^java\\.lang\\.[^\\.]+$")) {
+ return false;
+ }
+
+ return true;
}
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaField.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaField.java 2010-01-21 16:09:49 UTC (rev 16352)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaField.java 2010-01-22 12:44:51 UTC (rev 16353)
@@ -28,23 +28,31 @@
* @author Maksim Kaszynski
*/
public class JavaField extends JavaLanguageElement {
- private Class<?> type;
+ private JavaClass type;
private Object value;
- private Class<?>[] genericArguments;
+ private JavaClass[] genericArguments;
public JavaField(Class<?> type, String name) {
+ this(new JavaClass(type), name, null);
+ }
+
+ public JavaField(JavaClass type, String name) {
this(type, name, null);
}
public JavaField(Class<?> type, String name, Object value) {
+ this(new JavaClass(type), name, value);
+ }
+
+ public JavaField(JavaClass type, String name, Object value) {
super(name);
this.type = type;
this.value = value;
}
- public Class<?> getType() {
+ public JavaClass getType() {
return type;
}
@@ -59,14 +67,14 @@
/**
* @return the genericArguments
*/
- public Class<?>[] getGenericArguments() {
+ public JavaClass[] getGenericArguments() {
return genericArguments;
}
/**
* @param genericArguments the genericArguments to set
*/
- public void setGenericArguments(Class<?>[] genericArguments) {
+ public void setGenericArguments(JavaClass[] genericArguments) {
this.genericArguments = genericArguments;
}
@@ -74,7 +82,7 @@
StringBuilder result = new StringBuilder();
if (genericArguments != null) {
- for (Class<?> genericArgument : genericArguments) {
+ for (JavaClass genericArgument : genericArguments) {
if (result.length() == 0) {
result.append('<');
} else {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaLanguageElement.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaLanguageElement.java 2010-01-21 16:09:49 UTC (rev 16352)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaLanguageElement.java 2010-01-22 12:44:51 UTC (rev 16353)
@@ -68,16 +68,24 @@
modifiers.add(modifier);
}
+ public void addAnnotation(Class<?> annotation) {
+ addAnnotation(new JavaClass(annotation));
+ }
+
+ public void addAnnotation(JavaClass annotation) {
+ addAnnotation(new JavaAnnotation(annotation));
+ }
+
public void addAnnotation(JavaAnnotation annotation) {
annotations.add(annotation);
}
public void addAnnotation(Class<?> annotation, String... arguments) {
- annotations.add(new JavaAnnotation(annotation, arguments));
+ addAnnotation(new JavaClass(annotation), arguments);
}
- public void addAnnotation(Class<?> annotation) {
- annotations.add(new JavaAnnotation(annotation));
+ public void addAnnotation(JavaClass annotation, String... arguments) {
+ annotations.add(new JavaAnnotation(annotation, arguments));
}
public void addComment(JavaComment comment) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaMethod.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaMethod.java 2010-01-21 16:09:49 UTC (rev 16352)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaMethod.java 2010-01-22 12:44:51 UTC (rev 16353)
@@ -32,12 +32,12 @@
private List<Argument> arguments = new ArrayList<Argument>();
private List<Class<? extends Throwable>> exceptions = new ArrayList<Class<? extends Throwable>>();
private MethodBody methodBody;
- private Class<?> returnType;
+ private JavaClass returnType;
public JavaMethod(String name) {
super(name);
- this.returnType = Void.TYPE;
+ this.returnType = new JavaClass(Void.TYPE);
}
public JavaMethod(String name, Argument... arguments) {
@@ -47,7 +47,7 @@
public JavaMethod(String name, Class<?> returnType, Argument... arguments) {
this(name);
- this.returnType = returnType;
+ this.returnType = new JavaClass(returnType);
this.arguments = Arrays.asList(arguments);
}
@@ -67,7 +67,7 @@
return methodBody;
}
- public Class<?> getReturnType() {
+ public JavaClass getReturnType() {
return returnType;
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaPackage.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaPackage.java 2010-01-21 16:09:49 UTC (rev 16352)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/JavaPackage.java 2010-01-22 12:44:51 UTC (rev 16353)
@@ -28,13 +28,17 @@
private String name;
public JavaPackage(Package pkg) {
- this(pkg.getName());
+ this(getPackageName(pkg));
}
public JavaPackage(String name) {
super();
this.name = name;
}
+
+ private static String getPackageName(Package pkg) {
+ return pkg != null ? pkg.getName() : "";
+ }
public String getName() {
return name;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/RuntimeImport.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/RuntimeImport.java 2010-01-21 16:09:49 UTC (rev 16352)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/builder/model/RuntimeImport.java 2010-01-22 12:44:51 UTC (rev 16353)
@@ -27,6 +27,7 @@
* @author Maksim Kaszynski
*/
public class RuntimeImport implements JavaImport {
+
private String name;
public RuntimeImport(String name) {
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassGenerator.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassGenerator.java 2010-01-21 16:09:49 UTC (rev 16352)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassGenerator.java 2010-01-22 12:44:51 UTC (rev 16353)
@@ -86,7 +86,7 @@
}
JavaClass javaClass = visitor.getGeneratedClass();
- String fullName = javaClass.getFullName();
+ String fullName = javaClass.getName();
File outFile = context.createOutputFile(
StandardOutputs.RENDERER_CLASSES, fullName.replace(
'.', '/')
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassVisitor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassVisitor.java 2010-01-21 16:09:49 UTC (rev 16352)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassVisitor.java 2010-01-22 12:44:51 UTC (rev 16353)
@@ -44,7 +44,6 @@
import org.richfaces.builder.model.JavaField;
import org.richfaces.builder.model.JavaMethod;
import org.richfaces.builder.model.JavaModifier;
-import org.richfaces.builder.model.JavaPackage;
import org.richfaces.builder.model.MethodBody;
import org.richfaces.builder.model.MethodBodyStatementsContainer;
import org.richfaces.cdk.CdkException;
@@ -117,13 +116,11 @@
private static final Logger LOG = LoggerFactory.getLogger();
- private static final String XHTML_EL_NAMESPACE = "http://richfaces.org/cdk/xhtml-el";
-
private static final Set<String> DEFAULT_NAMESPACES = new HashSet<String>();
static {
- DEFAULT_NAMESPACES.add(XHTML_EL_NAMESPACE);
- DEFAULT_NAMESPACES.add("http://www.w3.org/1999/xhtml");
+ DEFAULT_NAMESPACES.add(Template.XHTML_EL_NAMESPACE);
+ DEFAULT_NAMESPACES.add(Template.XHTML_NAMESPACE);
}
private MethodBodyStatementsContainer currentStatement;
@@ -148,13 +145,13 @@
//TODO - cache unmarshalled data
SchemaSet schemaSet = jaxbBinding.unmarshal("urn:attributes:xhtml-el.xml", null, SchemaSet.class);
- this.attributesSchema = schemaSet.getSchemas().get(XHTML_EL_NAMESPACE);
+ this.attributesSchema = schemaSet.getSchemas().get(Template.XHTML_EL_NAMESPACE);
}
private void initializeJavaClass() {
- this.generatedClass = createJavaClassByName(compositeInterface.getJavaClass());
+ this.generatedClass = new JavaClass(compositeInterface.getJavaClass());
this.generatedClass.addModifier(JavaModifier.PUBLIC);
- this.generatedClass.setSuperClass(createJavaClassByName(compositeInterface.getBaseClass()));
+ this.generatedClass.setSuperClass(new JavaClass(compositeInterface.getBaseClass()));
this.generatedClass.addImport(FacesContext.class);
this.generatedClass.addImport(ResponseWriter.class);
@@ -246,7 +243,7 @@
JavaClass javaClass = initialClass;
while (javaClass != null) {
- Type type = TypesFactory.getType(javaClass.getFullName(), classLoader);
+ Type type = TypesFactory.getType(javaClass.getName(), classLoader);
if (knownSuperClass.isAssignableFrom(type.getRawType())) {
result = type;
break;
@@ -263,8 +260,10 @@
}
private String createPassThroughAttributeCode(String attributeName, String[] eventNames) {
+ generatedClass.addImport("org.richfaces.renderkit.ComponentAttribute");
+
StringBuilder sb = new StringBuilder();
- sb.append("new org.richfaces.renderkit.ComponentAttribute(");
+ sb.append("new ComponentAttribute(");
sb.append('"');
sb.append(StringUtils.getEscapedString(attributeName));
@@ -308,17 +307,14 @@
passThroughField.addModifier(JavaModifier.STATIC);
passThroughField.addModifier(JavaModifier.FINAL);
- //TODO - refactor and remove class loading!
+ generatedClass.addImport("org.richfaces.renderkit.ComponentAttribute");
+ generatedClass.addImport("org.richfaces.renderkit.RenderKitUtils");
+
//TODO - get rid of FQNs for classes via imports
- try {
- passThroughField.setGenericArguments(new Class<?>[] { String.class,
- Class.forName("org.richfaces.renderkit.ComponentAttribute", false, classLoader) });
- } catch (ClassNotFoundException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
+ passThroughField.setGenericArguments(new JavaClass[] { new JavaClass(String.class),
+ new JavaClass("org.richfaces.renderkit.ComponentAttribute") });
- StringBuilder fieldValue = new StringBuilder("org.richfaces.renderkit.ComponentAttribute.createMap(");
+ StringBuilder fieldValue = new StringBuilder("ComponentAttribute.createMap(");
boolean isFirstArgument = true;
for (Map.Entry<String, Attribute> entry : attributesMap.entrySet()) {
if (isFirstArgument) {
@@ -386,21 +382,6 @@
createMethodContext();
}
- private JavaClass createJavaClassByName(String fullName) {
- String simpleName = null;
- String packageName = "";
- int lastDotIdx = fullName.lastIndexOf('.');
-
- if (lastDotIdx != -1) {
- simpleName = fullName.substring(lastDotIdx + 1);
- packageName = fullName.substring(0, lastDotIdx);
- } else {
- simpleName = fullName;
- }
-
- return new JavaClass(simpleName, new JavaPackage(packageName));
- }
-
private void defineObject(Type type, String name, String initializationExpression) {
currentStatement.addStatement(new DefineObjectStatement(type, name, initializationExpression));
localsTypesMap.put(name, type);
@@ -488,6 +469,8 @@
} else {
String attributeLocalName = attributeName.getLocalPart();
if (writtenAttributes.add(attributeLocalName)) {
+ //TODO externalize
+ generatedClass.addImport("org.richfaces.renderkit.RenderKitUtils");
currentStatement.addStatement(new WriteAttributeStatement(attributeLocalName, compileEl(
attributeValue.toString(), String.class)));
}
@@ -514,8 +497,8 @@
if (!actualAttributesMap.isEmpty()) {
JavaField passThroughField = createPassThroughField(actualAttributesMap);
generatedClass.addField(passThroughField);
-
- // TODO: optimize batch attributes encoding
+ //TODO externalize
+ generatedClass.addImport("org.richfaces.renderkit.RenderKitUtils");
currentStatement.addStatement(new WriteAttributesSetStatement(passThroughField.getName()));
}
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/Template.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/Template.java 2010-01-21 16:09:49 UTC (rev 16352)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/Template.java 2010-01-22 12:44:51 UTC (rev 16353)
@@ -23,9 +23,10 @@
package org.richfaces.cdk.templatecompiler.model;
+import java.io.Serializable;
+
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
-import java.io.Serializable;
/**
* <p class="changed_added_4_0"></p>
@@ -42,6 +43,10 @@
public static final String COMPOSITE_NAMESPACE = "http://richfaces.org/cdk/jsf/composite";
+ public static final String XHTML_EL_NAMESPACE = "http://richfaces.org/cdk/xhtml-el";
+
+ public static final String XHTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
+
private static final long serialVersionUID = -6900382133123748812L;
private CompositeInterface compositeInterface;
Modified: root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/java/class.ftl
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/java/class.ftl 2010-01-21 16:09:49 UTC (rev 16352)
+++ root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/java/class.ftl 2010-01-22 12:44:51 UTC (rev 16353)
@@ -4,7 +4,7 @@
import ${import.name};
</#list>
-<@renderCommonJavaElementStuff element=modelItem />class ${modelItem.name} <#if modelItem.superClass.name != 'java.lang.Object'>extends ${modelItem.superClass.name} </#if>{
+<@renderCommonJavaElementStuff element=modelItem />class ${modelItem.simpleName} <#if modelItem.superClass.name != 'java.lang.Object'>extends ${modelItem.superClass.simpleName} </#if>{
<#list modelItem.fields as field>
<@renderCommonJavaElementStuff element=field />${field.type.simpleName}${field.genericSignature} ${field.name}<#if field.value??> = ${field.value}</#if>;
</#list>
Modified: root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/java/write-attribute.ftl
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/java/write-attribute.ftl 2010-01-21 16:09:49 UTC (rev 16352)
+++ root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/java/write-attribute.ftl 2010-01-22 12:44:51 UTC (rev 16353)
@@ -1,3 +1 @@
-<#import './macros/write-attribute.ftl' as writeAttributeTemplate />
-
-<@writeAttributeTemplate.writeAttributeMacro attributeName="${modelItem.attributeName}" attributeValue="${modelItem.valueExpression}" />
\ No newline at end of file
+RenderKitUtils.renderAttribute(${facesContextVariable}, "${modelItem.attributeName}", ${modelItem.valueExpression});
\ No newline at end of file
Modified: root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/java/write-attributes-set.ftl
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/java/write-attributes-set.ftl 2010-01-21 16:09:49 UTC (rev 16352)
+++ root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/java/write-attributes-set.ftl 2010-01-22 12:44:51 UTC (rev 16353)
@@ -1,4 +1,2 @@
-<#import './macros/write-attribute.ftl' as writeAttributeTemplate />
-
-org.richfaces.renderkit.RenderKitUtils.renderPassThroughAttributesOptimized(${facesContextVariable}, ${componentVariable},
+RenderKitUtils.renderPassThroughAttributes(${facesContextVariable}, ${componentVariable},
${modelItem.passThroughFieldName});
\ No newline at end of file
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/RendererTemplateParserTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/RendererTemplateParserTest.java 2010-01-21 16:09:49 UTC (rev 16352)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/RendererTemplateParserTest.java 2010-01-22 12:44:51 UTC (rev 16353)
@@ -65,11 +65,11 @@
private CdkContext cdkContext;
- private RenderKitModel getDefaultRenderkitFromModel() {
+ private RenderKitModel getRenderkitFromModel(String renderkitId) {
Map<Id, RenderKitModel> renderKits = cdkContext.getLibrary().getRenderKits();
assertNotNull(renderKits);
- RenderKitModel renderKit = renderKits.get(new RenderKitModel.Id(RenderKitFactory.HTML_BASIC_RENDER_KIT));
+ RenderKitModel renderKit = renderKits.get(new RenderKitModel.Id(renderkitId));
assertNotNull(renderKit);
return renderKit;
@@ -256,7 +256,7 @@
parser.mergeTemplateIntoModel(template);
- RenderKitModel renderKit = getDefaultRenderkitFromModel();
+ RenderKitModel renderKit = getRenderkitFromModel(RenderKitFactory.HTML_BASIC_RENDER_KIT);
RendererModel renderer = getFirstRendererFromRenderkit(renderKit);
assertEquals(new ClassDescription("org.richfaces.renderkit.html.BasicRendererImpl"), renderer
@@ -264,13 +264,13 @@
}
@Test
- public void parserTest() throws Exception {
+ public void dummyComponentTest() throws Exception {
Template template = parser.parseTemplate("urn:resource:org/richfaces/cdk/templatecompiler/dummy.template.xml");
assertNotNull(template);
parser.mergeTemplateIntoModel(template);
- RenderKitModel renderKit = getDefaultRenderkitFromModel();
+ RenderKitModel renderKit = getRenderkitFromModel("org.richfaces.CUSTOM_RENDERKIT");
RendererModel renderer = getFirstRendererFromRenderkit(renderKit);
assertEquals(new ClassDescription("org.richfaces.renderkit.html.DummyRendererImpl"), renderer
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/XhtmlAttributesParsingTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/XhtmlAttributesParsingTest.java 2010-01-21 16:09:49 UTC (rev 16352)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/XhtmlAttributesParsingTest.java 2010-01-22 12:44:51 UTC (rev 16353)
@@ -41,6 +41,7 @@
import org.richfaces.cdk.attributes.Schema;
import org.richfaces.cdk.attributes.SchemaSet;
import org.richfaces.cdk.attributes.Attribute.Kind;
+import org.richfaces.cdk.templatecompiler.model.Template;
import com.google.common.base.Predicate;
@@ -133,7 +134,7 @@
SchemaSet schemaSet = (SchemaSet) unmarshaller.unmarshal(parsedSchemaDataResource);
// TODO make constants
- xhtmlSchema = schemaSet.getSchemas().get("http://richfaces.org/cdk/xhtml-el");
+ xhtmlSchema = schemaSet.getSchemas().get(Template.XHTML_EL_NAMESPACE);
}
@After
@@ -185,4 +186,17 @@
}
}
+ @Test
+ public void testRequiredAttributes() throws Exception {
+ Collection<Attribute> requiredAttributes = findAttributesByPredicate(new Predicate<Attribute>() {
+
+ @Override
+ public boolean apply(Attribute input) {
+ return input.isRequired();
+ }
+ });
+
+ Collection<String> requiredAttributeNames = getNamesCollection(requiredAttributes);
+ System.out.println("XhtmlAttributesParsingTest.testRequiredAttributes(): " + requiredAttributeNames);
+ }
}
Modified: root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/templatecompiler/dummy.template.xml
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/templatecompiler/dummy.template.xml 2010-01-21 16:09:49 UTC (rev 16352)
+++ root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/templatecompiler/dummy.template.xml 2010-01-22 12:44:51 UTC (rev 16353)
@@ -7,6 +7,7 @@
<cc:interface>
<cdk:class>org.richfaces.renderkit.html.DummyRendererImpl</cdk:class>
<cdk:component-family>org.richfaces.Dummy</cdk:component-family>
+ <cdk:renderkit-id>org.richfaces.CUSTOM_RENDERKIT</cdk:renderkit-id>
<cc:attribute name="onclick">
<cc:clientBehavior event="click" />
15 years
JBoss Rich Faces SVN: r16352 - in branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test: resources/org/jboss/richfaces/integrationTest/calendar and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2010-01-21 11:09:49 -0500 (Thu, 21 Jan 2010)
New Revision: 16352
Modified:
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/calendar/OrganizerTestCase.java
branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/calendar/locators.properties
Log:
RFPL-352
* fixed locator
* fixed testPageSource method
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/calendar/OrganizerTestCase.java
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/calendar/OrganizerTestCase.java 2010-01-21 14:53:17 UTC (rev 16351)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/java/org/jboss/richfaces/integrationTest/calendar/OrganizerTestCase.java 2010-01-21 16:09:49 UTC (rev 16352)
@@ -31,7 +31,6 @@
import org.jboss.richfaces.integrationTest.AbstractSeleniumRichfacesTestCase;
import org.jboss.test.selenium.waiting.Condition;
import org.jboss.test.selenium.waiting.Wait;
-import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
/**
@@ -57,86 +56,86 @@
private final String LOC_DIALOG_CANCEL_BUTTON = getLoc("DIALOG_CANCEL_BUTTON");
private final String LOC_DIALOG_CROSS_BUTTON = getLoc("DIALOG_CROSS_BUTTON");
-// /**
-// * Tests that today's cell is highlighted. It goes through the table until
-// * it finds today's date.
-// */
-// @Test
-// public void testTodayIsHighlighted() {
-// String today = Integer.toString(Calendar.getInstance().get(Calendar.DAY_OF_MONTH));
-// String text = null;
-//
-// int fromLine = 1;
-// if (Integer.parseInt(today) > 15) {
-// fromLine = 3;
-// }
-//
-// for (int i = fromLine; i < 6; i++) {
-// for (int j = 0; j < 7; j++) {
-// text = selenium.getText(format(LOC_CELL_DATE_PREFORMATTED, i, j));
-// if (today.equals(text)) {
-// assertTrue(belongsClass("rich-calendar-today", format(LOC_CELL_PREFORMATTED, i, j)),
-// "Class attribute of the cell with today's date should contain \"rich-calendar-today\".");
-// return;
-// }
-// }
-// }
-// }
-//
-// /**
-// * Tests the last cell of the table. The last line is usually empty and the
-// * last cell of the last row has to be disabled.
-// */
-// @Test
-// public void testLastDayIsGrey() {
-// assertTrue(belongsClass("rich-calendar-boundary-dates", format(LOC_CELL_PREFORMATTED, 6, 6)),
-// "Class attribute of the last cell should contain \"rich-calendar-boundary-dates\".");
-// }
-//
-// /**
-// * Tests adding a new note to the organizer. First it checks the text of the
-// * selected cell (2nd week, 3rd day), checks that the dialog is hidden,
-// * clicks into the cell, and checks that the dialog is shown. Then it enters
-// * values into description and note fields and clicks the store button. In
-// * the end it checks that the organizer was changed.
-// */
-// @Test
-// public void testSaveNote() {
-// String text = selenium.getText(format(LOC_CELL_DESC_PREFORMATTED, 4, 3));
-// assertEquals(text, "Nothing planned", "The description in the cell (week 2, day 3).");
-//
-// assertFalse(isDisplayed(LOC_DIALOG), "Dialog should not be visible.");
-//
-// selenium.click(format(LOC_CELL_PREFORMATTED, 4, 3));
-//
-// // wait for JavaScript to show the dialog
-// Wait.until(new Condition() {
-// public boolean isTrue() {
-// return isDisplayed(LOC_DIALOG);
-// }
-// });
-//
-// assertTrue(isDisplayed(LOC_DIALOG), "Dialog should be visible.");
-//
-// selenium.type(LOC_DIALOG_DESCRIPTION, "some description");
-// selenium.type(LOC_DIALOG_NOTE, "note note note note note");
-// selenium.click(LOC_DIALOG_STORE_BUTTON);
-//
-// // wait for JavaScript to change the organizer
-// Wait.until(new Condition() {
-// public boolean isTrue() {
-// return !"Nothing planned".equals(selenium.getText(format(LOC_CELL_DESC_PREFORMATTED, 4, 3)));
-// }
-// });
-//
-// text = selenium.getText(format(LOC_CELL_DESC_PREFORMATTED, 4, 3));
-// assertEquals(text, "some description", "The description in the cell (week 2, day 3).");
-//
-// text = selenium.getText(format(LOC_CELL_NOTE_PREFORMATTED, 4, 3));
-// assertEquals(text, "note note note note note", "The note in the cell (week 2, day 3).");
-// }
+ /**
+ * Tests that today's cell is highlighted. It goes through the table until
+ * it finds today's date.
+ */
+ @Test
+ public void testTodayIsHighlighted() {
+ String today = Integer.toString(Calendar.getInstance().get(Calendar.DAY_OF_MONTH));
+ String text = null;
+ int fromLine = 1;
+ if (Integer.parseInt(today) > 15) {
+ fromLine = 3;
+ }
+
+ for (int i = fromLine; i < 6; i++) {
+ for (int j = 0; j < 7; j++) {
+ text = selenium.getText(format(LOC_CELL_DATE_PREFORMATTED, i, j));
+ if (today.equals(text)) {
+ assertTrue(belongsClass("rich-calendar-today", format(LOC_CELL_PREFORMATTED, i, j)),
+ "Class attribute of the cell with today's date should contain \"rich-calendar-today\".");
+ return;
+ }
+ }
+ }
+ }
+
/**
+ * Tests the last cell of the table. The last line is usually empty and the
+ * last cell of the last row has to be disabled.
+ */
+ @Test
+ public void testLastDayIsGrey() {
+ assertTrue(belongsClass("rich-calendar-boundary-dates", format(LOC_CELL_PREFORMATTED, 6, 6)),
+ "Class attribute of the last cell should contain \"rich-calendar-boundary-dates\".");
+ }
+
+ /**
+ * Tests adding a new note to the organizer. First it checks the text of the
+ * selected cell (2nd week, 3rd day), checks that the dialog is hidden,
+ * clicks into the cell, and checks that the dialog is shown. Then it enters
+ * values into description and note fields and clicks the store button. In
+ * the end it checks that the organizer was changed.
+ */
+ @Test
+ public void testSaveNote() {
+ String text = selenium.getText(format(LOC_CELL_DESC_PREFORMATTED, 4, 3));
+ assertEquals(text, "Nothing planned", "The description in the cell (week 2, day 3).");
+
+ assertFalse(isDisplayed(LOC_DIALOG), "Dialog should not be visible.");
+
+ selenium.click(format(LOC_CELL_PREFORMATTED, 4, 3));
+
+ // wait for JavaScript to show the dialog
+ Wait.until(new Condition() {
+ public boolean isTrue() {
+ return isDisplayed(LOC_DIALOG);
+ }
+ });
+
+ assertTrue(isDisplayed(LOC_DIALOG), "Dialog should be visible.");
+
+ selenium.type(LOC_DIALOG_DESCRIPTION, "some description");
+ selenium.type(LOC_DIALOG_NOTE, "note note note note note");
+ selenium.click(LOC_DIALOG_STORE_BUTTON);
+
+ // wait for JavaScript to change the organizer
+ Wait.until(new Condition() {
+ public boolean isTrue() {
+ return !"Nothing planned".equals(selenium.getText(format(LOC_CELL_DESC_PREFORMATTED, 4, 3)));
+ }
+ });
+
+ text = selenium.getText(format(LOC_CELL_DESC_PREFORMATTED, 4, 3));
+ assertEquals(text, "some description", "The description in the cell (week 2, day 3).");
+
+ text = selenium.getText(format(LOC_CELL_NOTE_PREFORMATTED, 4, 3));
+ assertEquals(text, "note note note note note", "The note in the cell (week 2, day 3).");
+ }
+
+ /**
* Tests the cancel button. First it checks the content of the cell in the
* 3rd week, 3rd day. Then it clicks into the cell, enters the description
* and note, and clicks the cancel button. In the end it verifies that the
@@ -212,46 +211,46 @@
assertEquals(text, "", "The note in the cell (week 3, day 5).");
}
-// /**
-// * Tests the "View Source". It checks that the source code is not visible,
-// * clicks on the link, and checks 8 lines of source code.
-// */
-// @Test
-// public void testPageSource() {
-// String[] strings = new String[] {
-// "<ui:composition xmlns=\"http://www.w3.org/1999/xhtml\"",
-// "<rich:messages/>",
-// "<a4j:jsFunction name=\"ajaxSubmit\" oncomplete=\"#{rich:component('panel')}.show()\" reRender=\"editContent\" />",
-// "<rich:calendar value=\"#{calendarBean.selectedDate}\"",
-// "cellWidth=\"100px\" cellHeight=\"100px\"",
-// "dataModel=\"#{calendarDataModel}\" onchanged=\"if (event.rich.date) {ajaxSubmit();}\" oncurrentdateselect=\"return false\"",
-// "<a4j:outputPanel layout=\"block\" id=\"cell\" onclick=\"#{rich:component('organizer')}.resetSelectedDate()\" style=\"height: 100%;\">",
-// "<rich:modalPanel id=\"panel\" resizeable=\"false\">", };
-//
-// abstractTestSource(1, "View Source", strings);
-// }
-//
-// /**
-// * Tests the source of CalendarDataModelImpl.java. It checks that the source
-// * code is not visible, clicks on the link, and checks 8 lines of source
-// * code.
-// */
-// @Test
-// public void testDataModelSource() {
-// String[] strings = new String[] {
-// "package org.richfaces.demo.calendar.modelImpl;",
-// "import org.richfaces.model.CalendarDataModelItem;",
-// "private CalendarDataModelItem[] items;",
-// "public CalendarDataModelItem[] getData(Date[] dateArray) {",
-// "protected CalendarDataModelItem createDataModelItem(Date date) {",
-// "item.setDay(c.get(Calendar.DAY_OF_MONTH));",
-// "setCurrentDescription((String)((HashMap)items[calendar.get(Calendar.DAY_OF_MONTH)-1].getData()).get(\"description\"));",
-// "public String getCurrentShortDescription() {", };
-//
-// abstractTestSource(1, "CalendarDataModelImpl.java", strings);
-// }
+ /**
+ * Tests the "View Source". It checks that the source code is not visible,
+ * clicks on the link, and checks 8 lines of source code.
+ */
+ @Test
+ public void testPageSource() {
+ String[] strings = new String[] {
+ "<ui:composition xmlns=\"http://www.w3.org/1999/xhtml\"",
+ "<rich:messages/>",
+ "<a4j:jsFunction name=\"ajaxSubmit\" oncomplete=\"#{rich:component('panel')}.show()\" reRender=\"editContent\" />",
+ "<rich:calendar value=\"#{calendarBean.selectedDate}\"",
+ "cellWidth=\"100px\" cellHeight=\"100px\"",
+ "dataModel=\"#{calendarDataModel}\" onchanged=\"if (event.rich.date) {ajaxSubmit();}\" oncurrentdateselect=\"return false\"",
+ "<a4j:outputPanel layout=\"block\" id=\"cell\" onclick=\"#{rich:component('organizer')}.resetSelectedDate()\"",
+ "<rich:modalPanel id=\"panel\" resizeable=\"false\">", };
+ abstractTestSource(1, "View Source", strings);
+ }
+
/**
+ * Tests the source of CalendarDataModelImpl.java. It checks that the source
+ * code is not visible, clicks on the link, and checks 8 lines of source
+ * code.
+ */
+ @Test
+ public void testDataModelSource() {
+ String[] strings = new String[] {
+ "package org.richfaces.demo.calendar.modelImpl;",
+ "import org.richfaces.model.CalendarDataModelItem;",
+ "private CalendarDataModelItem[] items;",
+ "public CalendarDataModelItem[] getData(Date[] dateArray) {",
+ "protected CalendarDataModelItem createDataModelItem(Date date) {",
+ "item.setDay(c.get(Calendar.DAY_OF_MONTH));",
+ "setCurrentDescription((String)((HashMap)items[calendar.get(Calendar.DAY_OF_MONTH)-1].getData()).get(\"description\"));",
+ "public String getCurrentShortDescription() {", };
+
+ abstractTestSource(1, "CalendarDataModelImpl.java", strings);
+ }
+
+ /**
* Tests the source of CalendarDataModelItemImpl.java. It checks that the
* source code is not visible, clicks on the link, and checks 8 lines of
* source code.
Modified: branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/calendar/locators.properties
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/calendar/locators.properties 2010-01-21 14:53:17 UTC (rev 16351)
+++ branches/community/3.3.X/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/calendar/locators.properties 2010-01-21 16:09:49 UTC (rev 16352)
@@ -25,9 +25,9 @@
FIELDSET=jquery=fieldset:eq(0)
CELL_PREFORMATTED=jquery=fieldset:eq(0) tr[id$=organizerWeekNum{0}] > td:eq({1})
-CELL_DATE_PREFORMATTED=jquery=fieldset:eq(0) tr[id$=organizerWeekNum{0}] > td:eq({1}) tr:eq(0)
-CELL_DESC_PREFORMATTED=jquery=fieldset:eq(0) tr[id$=organizerWeekNum{0}] > td:eq({1}) tr:eq(1)
-CELL_NOTE_PREFORMATTED=jquery=fieldset:eq(0) tr[id$=organizerWeekNum{0}] > td:eq({1}) tr:eq(2)
+CELL_DATE_PREFORMATTED=jquery=fieldset:eq(0) tr[id$=organizerWeekNum{0}] > td:eq({1}) div.organizer-cell div:eq(0)
+CELL_DESC_PREFORMATTED=jquery=fieldset:eq(0) tr[id$=organizerWeekNum{0}] > td:eq({1}) div.organizer-cell div:eq(2)
+CELL_NOTE_PREFORMATTED=jquery=fieldset:eq(0) tr[id$=organizerWeekNum{0}] > td:eq({1}) div.organizer-cell div:eq(3)
DIALOG=jquery=div#panelContainer
DIALOG_DESCRIPTION=jquery=div#panelContainer td.rich-mpnl-body tr:eq(0) input
15 years
JBoss Rich Faces SVN: r16351 - branches/community/3.3.X/ui/calendar/src/test/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2010-01-21 09:53:17 -0500 (Thu, 21 Jan 2010)
New Revision: 16351
Modified:
branches/community/3.3.X/ui/calendar/src/test/java/org/richfaces/component/CalendarComponentTest.java
Log:
Fix RF-8196
Modified: branches/community/3.3.X/ui/calendar/src/test/java/org/richfaces/component/CalendarComponentTest.java
===================================================================
--- branches/community/3.3.X/ui/calendar/src/test/java/org/richfaces/component/CalendarComponentTest.java 2010-01-21 12:33:14 UTC (rev 16350)
+++ branches/community/3.3.X/ui/calendar/src/test/java/org/richfaces/component/CalendarComponentTest.java 2010-01-21 14:53:17 UTC (rev 16351)
@@ -94,7 +94,7 @@
.createComponent(UICalendar.COMPONENT_TYPE);
calendar.setLocale(Locale.UK);
calendar.setDatePattern("d/MM/yyyy");
- calendar.setTimeZone(TimeZone.getTimeZone("GMT-4:00"));
+ //calendar.setTimeZone(TimeZone.getTimeZone("GMT-1:00"));
calendar.setButtonLabel("PopUp");
// XXX test popup false
15 years
JBoss Rich Faces SVN: r16350 - branches/community/3.3.X/samples/richfaces-demo/src/main/webapp/richfaces/fileUpload.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2010-01-21 07:33:14 -0500 (Thu, 21 Jan 2010)
New Revision: 16350
Modified:
branches/community/3.3.X/samples/richfaces-demo/src/main/webapp/richfaces/fileUpload/usage.xhtml
Log:
missed File.java source just added to example template.
Modified: branches/community/3.3.X/samples/richfaces-demo/src/main/webapp/richfaces/fileUpload/usage.xhtml
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/src/main/webapp/richfaces/fileUpload/usage.xhtml 2010-01-21 02:00:49 UTC (rev 16349)
+++ branches/community/3.3.X/samples/richfaces-demo/src/main/webapp/richfaces/fileUpload/usage.xhtml 2010-01-21 12:33:14 UTC (rev 16350)
@@ -33,7 +33,11 @@
<ui:param name="openlabel" value="View FileUploadBean.java Source" />
<ui:param name="sourcetype" value="java" />
</ui:include>
-
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath" value="/WEB-INF/src/org/richfaces/demo/fileUpload/File.java"/>
+ <ui:param name="openlabel" value="View File.java Source" />
+ <ui:param name="sourcetype" value="java" />
+ </ui:include>
</div>
</fieldset>
<fieldset class="demo_fieldset">
15 years
JBoss Rich Faces SVN: r16349 - branches/community/3.3.X/docs.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2010-01-20 21:00:49 -0500 (Wed, 20 Jan 2010)
New Revision: 16349
Added:
branches/community/3.3.X/docs/richfaces_3.3.3.beta1_javadocs.zip
Log:
Added javadoc zip for handing to helpdesk
Added: branches/community/3.3.X/docs/richfaces_3.3.3.beta1_javadocs.zip
===================================================================
(Binary files differ)
Property changes on: branches/community/3.3.X/docs/richfaces_3.3.3.beta1_javadocs.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years
JBoss Rich Faces SVN: r16348 - in root/cdk/trunk/plugins/generator/src: main/java/org/richfaces/cdk/parser/el and 12 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-01-20 20:40:04 -0500 (Wed, 20 Jan 2010)
New Revision: 16348
Added:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/ClientBehavior.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/RendererTemplateParserTest.java
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/templatecompiler/
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/templatecompiler/basic.template.xml
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/templatecompiler/dummy.template.xml
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Property.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELNodeConstants.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstEmptyTreeNode.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/JavaClassConfiguration.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassVisitor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererTemplateParser.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/Attribute.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CompositeImplementation.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CompositeInterface.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/ResourceDependency.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/Template.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/JAXBBinding.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/PropertyBase.java
root/cdk/trunk/plugins/generator/src/main/resources/META-INF/schema/cdk-composite.xsd
root/cdk/trunk/plugins/generator/src/main/resources/META-INF/schema/xhtml-el.xsd
root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/java/encode-method-preface.ftl
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/parser/el/test/ELParserTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/model/TemplateTest.java
Log:
https://jira.jboss.org/jira/browse/RF-7732
Minor corrections & TODOs for the rest of CDK code
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Property.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Property.java 2010-01-20 23:16:00 UTC (rev 16347)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Property.java 2010-01-21 01:40:04 UTC (rev 16348)
@@ -49,7 +49,9 @@
private boolean required = false;
private boolean readOnly = false;
private boolean passThrough = false;
- private Set<EventName> eventNames = Sets.newHashSet();
+
+ //TODO nick - ordering seems to be important!
+ private Set<EventName> eventNames = Sets.newLinkedHashSet();
private List<ClassDescription> signature = Lists.newArrayList();
private Set<String> aliases = Sets.newHashSet();
private String defaultValue;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELNodeConstants.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELNodeConstants.java 2010-01-20 23:16:00 UTC (rev 16347)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/ELNodeConstants.java 2010-01-21 01:40:04 UTC (rev 16348)
@@ -52,7 +52,6 @@
public static final String DOUBLE_VALUE_OF_FUNCTION = "Double.valueOf";
public static final String EXCLAMATION_MARK = "!";
public static final String GET_FUNCTION = "get";
- public static final String GET_UTILS_FUNCTION = "getUtils";
public static final String LEFT_BRACKET = "(";
public static final String LEFT_SQUARE_BRACKET = "[";
public static final String NEGATIVE = "-";
@@ -60,9 +59,9 @@
public static final String QUOTE = "\"";
public static final String RIGHT_BRACKET = ")";
public static final String RIGHT_SQUARE_BRACKET = "]";
- public static final String THIS_GET_UTILS_IS_EMPTY_FUNCTION = "this.getUtils().isEmpty";
public static final String THIS_PREFIX = "this";
public static final String GETTER_PREFIX = "get";
+ public static final String IS_EMPTY_FUNCTION = "isEmpty";
private ELNodeConstants() {
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstEmptyTreeNode.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstEmptyTreeNode.java 2010-01-20 23:16:00 UTC (rev 16347)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/parser/el/node/AstEmptyTreeNode.java 2010-01-21 01:40:04 UTC (rev 16348)
@@ -47,7 +47,7 @@
public void visit(StringBuilder sb, Map<String, Type> context, ELVisitor visitor) throws ParsingException {
visitor.setUseEmptinessCheck(true);
- sb.append(ELNodeConstants.THIS_GET_UTILS_IS_EMPTY_FUNCTION);
+ sb.append(ELNodeConstants.IS_EMPTY_FUNCTION);
sb.append(ELNodeConstants.LEFT_BRACKET);
String childOutput = getChildOutput(0, context, visitor);
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/JavaClassConfiguration.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/JavaClassConfiguration.java 2010-01-20 23:16:00 UTC (rev 16347)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/JavaClassConfiguration.java 2010-01-21 01:40:04 UTC (rev 16348)
@@ -23,19 +23,20 @@
package org.richfaces.cdk.templatecompiler;
+import java.io.IOException;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.richfaces.cdk.CdkContext;
+
import freemarker.ext.beans.BeanModel;
import freemarker.ext.beans.BeansWrapper;
import freemarker.template.Configuration;
import freemarker.template.Template;
import freemarker.template.TemplateException;
-import org.richfaces.cdk.CdkContext;
-import java.io.IOException;
-import java.io.StringWriter;
-import java.io.Writer;
-import java.util.HashMap;
-import java.util.Map;
-
/**
* <p class="changed_added_4_0"></p>
*
@@ -80,7 +81,6 @@
rootMap.put("componentVariable", RendererClassVisitor.COMPONENT_VARIABLE);
rootMap.put("responseWriterVariable", RendererClassVisitor.RESPONSE_WRITER_VARIABLE);
rootMap.put("clientIdVariable", RendererClassVisitor.CLIENT_ID_VARIABLE);
- rootMap.put("rendererUtilsVariable", RendererClassVisitor.RENDERER_UTILS_VARIABLE);
t.process(rootMap, writer);
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassVisitor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassVisitor.java 2010-01-20 23:16:00 UTC (rev 16347)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassVisitor.java 2010-01-21 01:40:04 UTC (rev 16348)
@@ -109,18 +109,12 @@
*
*/
static final String CLIENT_ID_VARIABLE = "clientId";
- /**
- *
- */
- static final String RENDERER_UTILS_VARIABLE = "utils";
/**
*
*/
private static final String PASS_THROUGH_ATTRIBUTES_FIELD_NAME = "PASS_THROUGH_ATTRIBUTES";
- private static final String RENDERER_UTILS_CLASS_NAME = "org.ajax4jsf.renderkit.RendererUtils";
-
private static final Logger LOG = LoggerFactory.getLogger();
private static final String XHTML_EL_NAMESPACE = "http://richfaces.org/cdk/xhtml-el";
@@ -152,6 +146,7 @@
this.compositeInterface = compositeInterface;
this.classLoader = classLoader;
+ //TODO - cache unmarshalled data
SchemaSet schemaSet = jaxbBinding.unmarshal("urn:attributes:xhtml-el.xml", null, SchemaSet.class);
this.attributesSchema = schemaSet.getSchemas().get(XHTML_EL_NAMESPACE);
}
@@ -164,7 +159,6 @@
this.generatedClass.addImport(FacesContext.class);
this.generatedClass.addImport(ResponseWriter.class);
this.generatedClass.addImport(UIComponent.class);
- this.generatedClass.addImport(RENDERER_UTILS_CLASS_NAME);
this.generatedClass.addAnnotation(Generated.class, "\"RichFaces CDK\"");
// TODO remove this after improving Java model
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererTemplateParser.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererTemplateParser.java 2010-01-20 23:16:00 UTC (rev 16347)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererTemplateParser.java 2010-01-21 01:40:04 UTC (rev 16348)
@@ -24,6 +24,13 @@
package org.richfaces.cdk.templatecompiler;
import java.io.File;
+import java.text.MessageFormat;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
import org.richfaces.cdk.CdkContext;
import org.richfaces.cdk.CdkException;
@@ -31,12 +38,19 @@
import org.richfaces.cdk.StandardSources;
import org.richfaces.cdk.model.ClassDescription;
import org.richfaces.cdk.model.ComponentLibrary;
+import org.richfaces.cdk.model.EventName;
+import org.richfaces.cdk.model.Property;
import org.richfaces.cdk.model.RenderKitModel;
import org.richfaces.cdk.model.RendererModel;
+import org.richfaces.cdk.templatecompiler.model.Attribute;
+import org.richfaces.cdk.templatecompiler.model.ClientBehavior;
import org.richfaces.cdk.templatecompiler.model.CompositeInterface;
import org.richfaces.cdk.templatecompiler.model.Template;
import org.richfaces.cdk.xmlconfig.JAXBBinding;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
+
/**
* <p class="changed_added_4_0">
* </p>
@@ -44,9 +58,63 @@
* @author asmirnov(a)exadel.com
*/
public class RendererTemplateParser implements ModelBuilder {
+
+ private static final Pattern PARAMETERS_STRING_PATTERN = Pattern.compile("\\( ( [^\\)]* ) \\) \\s*$",
+ Pattern.COMMENTS);
+
+ private static final Pattern COMMA_SEPARATED_PATTERN = Pattern.compile("\\s*,\\s*", Pattern.COMMENTS);
+
private CdkContext context;
+
private JAXBBinding jaxbBinding;
+ private Set<EventName> convert(Collection<ClientBehavior> clientBehaviors) {
+ if (clientBehaviors == null || clientBehaviors.isEmpty()) {
+ return null;
+ }
+
+ Set<EventName> result = Sets.newLinkedHashSet();
+
+ if (clientBehaviors != null) {
+ for (ClientBehavior clientBehavior : clientBehaviors) {
+ EventName eventName = new EventName();
+ eventName.setName(clientBehavior.getEvent());
+ eventName.setDefaultEvent(clientBehavior.isDefaultEvent());
+ result.add(eventName);
+ }
+ }
+
+ return result;
+ }
+
+ private List<ClassDescription> parseSignature(String signatureString) {
+ if (signatureString == null || signatureString.trim().length() == 0) {
+ return null;
+ }
+
+ List<ClassDescription> result = Lists.newArrayList();
+
+ if (signatureString != null) {
+ Matcher parametersStringMatcher = PARAMETERS_STRING_PATTERN.matcher(signatureString);
+ if (!parametersStringMatcher.find()) {
+ // TODO - handle exception
+ throw new IllegalArgumentException(MessageFormat.format("Signature string {0} cannot be parsed!",
+ signatureString));
+ }
+
+ String parametersString = parametersStringMatcher.group(1).trim();
+ if (parametersString.length() != 0) {
+ String[] parameters = COMMA_SEPARATED_PATTERN.split(parametersString);
+ for (String parameter : parameters) {
+ String trimmedParameter = parameter.trim();
+ result.add(new ClassDescription(trimmedParameter));
+ }
+ }
+ }
+
+ return result;
+ }
+
/*
* (non-Javadoc)
*
@@ -54,35 +122,83 @@
*/
@Override
public void build() throws CdkException {
- ComponentLibrary library = context.getLibrary();
-
Iterable<File> sources = getContext().getSources(StandardSources.RENDERER_TEMPLATES);
if (null != sources) {
for (File file : sources) {
Template template = parseTemplate(file);
- CompositeInterface compositeInterface = template.getInterface();
- // TODO - infer values ?
- RenderKitModel renderKit = library.addRenderKit(compositeInterface.getRenderKitId());
- RendererModel renderer =
- new RendererModel(new RendererModel.Type(compositeInterface.getRendererType()));
- renderKit.getRenderers().add(renderer);
- String componentType = compositeInterface.getComponentType();
+ mergeTemplateIntoModel(template);
+ }
+ }
+ }
- // component.getRenderers().add(renderer);
+ protected void mergeTemplateIntoModel(Template template) throws CdkException {
+ ComponentLibrary library = context.getLibrary();
+ CompositeInterface compositeInterface = template.getInterface();
+ // TODO - infer values ?
+ RenderKitModel renderKit = library.addRenderKit(compositeInterface.getRenderKitId());
+ RendererModel renderer = new RendererModel(new RendererModel.Type(compositeInterface.getRendererType()));
+ renderKit.getRenderers().add(renderer);
+ String componentType = compositeInterface.getComponentType();
- String family = compositeInterface.getComponentFamily();
+ // component.getRenderers().add(renderer);
- if (null != family) {
- renderer.setFamily(family);
+ String family = compositeInterface.getComponentFamily();
+
+ if (null != family) {
+ renderer.setFamily(family);
+ }
+
+ renderer.setRendererClass(new ClassDescription(compositeInterface.getJavaClass()));
+ renderer.setTemplate(template);
+
+ Map<String, Property> rendererAttributes = renderer.getAttributes();
+
+ List<Attribute> templateAttributes = compositeInterface.getAttributes();
+ if (templateAttributes != null) {
+ for (Attribute templateAttribute : templateAttributes) {
+ Property rendererProperty = new Property();
+ rendererProperty.setDefaultValue(templateAttribute.getDefaultValue());
+
+ // TODO is it the right one?
+ rendererProperty.setDescription(templateAttribute.getShortDescription());
+ rendererProperty.setDisplayname(templateAttribute.getDisplayName());
+
+ Set<EventName> eventNamesSet = convert(templateAttribute.getClientBehaviors());
+ if (eventNamesSet != null) {
+ rendererProperty.getEventNames().addAll(eventNamesSet);
}
- renderer.setRendererClass(new ClassDescription(compositeInterface.getJavaClass()));
- renderer.setTemplate(template);
+ // rendererProperty.setAliases(aliases)
+ // rendererProperty.setExtension(extension)
+ // rendererProperty.setGenerate(exists)
+ // rendererProperty.setHidden(hidden)
+ // rendererProperty.setIcon(icon)
+ // rendererProperty.setLiteral(literal)
+ // rendererProperty.setPassThrough(passThrough)
+ // rendererProperty.setReadOnly(readOnly)
+ // rendererProperty.setSuggestedValue(suggestedValue)
+
+ rendererProperty.setRequired(templateAttribute.isRequired());
+
+ List<ClassDescription> parsedSignature = parseSignature(templateAttribute.getMethodSignature());
+ if (parsedSignature != null) {
+ rendererProperty.getSignature().addAll(parsedSignature);
+ }
+
+ String templateAttributeType = templateAttribute.getType();
+ if (templateAttributeType != null) {
+ rendererProperty.setType(new ClassDescription(templateAttributeType));
+ }
+
+ rendererAttributes.put(templateAttribute.getName(), rendererProperty);
}
-
}
}
+ protected Template parseTemplate(String templateLocation) throws CdkException {
+ return jaxbBinding.unmarshal(templateLocation, "http://richfaces.org/cdk/cdk-template.xsd", Template.class);
+ }
+
protected Template parseTemplate(File file) throws CdkException {
return jaxbBinding.unmarshal(file, "http://richfaces.org/cdk/cdk-template.xsd", Template.class);
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/Attribute.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/Attribute.java 2010-01-20 23:16:00 UTC (rev 16347)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/Attribute.java 2010-01-21 01:40:04 UTC (rev 16348)
@@ -23,16 +23,17 @@
package org.richfaces.cdk.templatecompiler.model;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlType;
import java.io.Serializable;
+import java.util.List;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+
/**
* <p class="changed_added_4_0"></p>
*
* @author asmirnov(a)exadel.com
*/
-@XmlType(name = "uicomponent-attributeType", namespace = Template.COMPOSITE_NAMESPACE)
public class Attribute implements Serializable {
private static final long serialVersionUID = -8183353368681247171L;
@@ -67,6 +68,9 @@
@XmlAttribute
private String type = Object.class.getName();
+ @XmlElement(name = "clientBehavior", namespace = Template.COMPOSITE_NAMESPACE)
+ private List<ClientBehavior> clientBehaviors;
+
/**
* <p class="changed_added_4_0"></p>
*
@@ -247,4 +251,22 @@
public void setType(String type) {
this.type = type;
}
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ *
+ * @return the clientBehaviors
+ */
+ public List<ClientBehavior> getClientBehaviors() {
+ return clientBehaviors;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ *
+ * @param clientBehaviors the clientBehaviors to set
+ */
+ public void setClientBehaviors(List<ClientBehavior> clientBehaviors) {
+ this.clientBehaviors = clientBehaviors;
+ }
}
Added: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/ClientBehavior.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/ClientBehavior.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/ClientBehavior.java 2010-01-21 01:40:04 UTC (rev 16348)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.cdk.templatecompiler.model;
+
+import javax.xml.bind.annotation.XmlAttribute;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class ClientBehavior {
+
+ @XmlAttribute
+ private String event;
+
+ @XmlAttribute(name = "default")
+ private boolean defaultEvent;
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ *
+ * @return the event
+ */
+ public String getEvent() {
+ return event;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ *
+ * @param event the event to set
+ */
+ public void setEvent(String event) {
+ this.event = event;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ *
+ * @return the default
+ */
+ public boolean isDefaultEvent() {
+ return defaultEvent;
+ }
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ *
+ * @param default the default to set
+ */
+ public void setDefaultEvent(boolean defaultEvent) {
+ this.defaultEvent = defaultEvent;
+ }
+}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CompositeImplementation.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CompositeImplementation.java 2010-01-20 23:16:00 UTC (rev 16347)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CompositeImplementation.java 2010-01-21 01:40:04 UTC (rev 16348)
@@ -23,15 +23,16 @@
package org.richfaces.cdk.templatecompiler.model;
-import javax.xml.bind.annotation.XmlType;
import java.io.Serializable;
+import javax.xml.bind.annotation.XmlRootElement;
+
/**
* <p class="changed_added_4_0"></p>
*
* @author asmirnov(a)exadel.com
*/
-@XmlType(name = "ImplementationType", namespace = Template.COMPOSITE_NAMESPACE)
+@XmlRootElement(name = "implementation", namespace = Template.COMPOSITE_NAMESPACE)
public class CompositeImplementation extends ModelFragment implements Serializable {
private static final long serialVersionUID = -3046226976516170979L;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CompositeInterface.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CompositeInterface.java 2010-01-20 23:16:00 UTC (rev 16347)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CompositeInterface.java 2010-01-21 01:40:04 UTC (rev 16348)
@@ -23,19 +23,20 @@
package org.richfaces.cdk.templatecompiler.model;
+import java.io.Serializable;
+import java.util.List;
+
import javax.faces.render.RenderKitFactory;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
-import javax.xml.bind.annotation.XmlType;
-import java.util.List;
-import java.io.Serializable;
+import javax.xml.bind.annotation.XmlRootElement;
/**
* <p class="changed_added_4_0"></p>
*
* @author asmirnov(a)exadel.com
*/
-@XmlType(name = "InterfaceType", namespace = Template.COMPOSITE_NAMESPACE)
+@XmlRootElement(name = "interface", namespace = Template.COMPOSITE_NAMESPACE)
public class CompositeInterface implements Serializable {
private static final long serialVersionUID = -5578359507253872500L;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/ResourceDependency.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/ResourceDependency.java 2010-01-20 23:16:00 UTC (rev 16347)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/ResourceDependency.java 2010-01-21 01:40:04 UTC (rev 16348)
@@ -21,16 +21,17 @@
*/
package org.richfaces.cdk.templatecompiler.model;
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlType;
+import java.io.Serializable;
import java.text.MessageFormat;
-import java.io.Serializable;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlRootElement;
+
/**
* @author Nick Belaevski
* @since 4.0
*/
-@XmlType(name = "resourceDependencyType", namespace = Template.CDK_NAMESPACE)
+@XmlRootElement(name = "resourceDependency", namespace = Template.CDK_NAMESPACE)
public class ResourceDependency implements Serializable {
private static final long serialVersionUID = -7513798674871079584L;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/Template.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/Template.java 2010-01-20 23:16:00 UTC (rev 16347)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/Template.java 2010-01-21 01:40:04 UTC (rev 16348)
@@ -33,6 +33,7 @@
* @author asmirnov(a)exadel.com
*/
@XmlRootElement(name = "root", namespace = Template.CDK_NAMESPACE)
+//TODO add support for attribute files imports
public class Template implements Serializable {
public static final String JSTL_CORE_NAMESPACE = "http://richfaces.org/cdk/jstl/core";
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/JAXBBinding.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/JAXBBinding.java 2010-01-20 23:16:00 UTC (rev 16347)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/JAXBBinding.java 2010-01-21 01:40:04 UTC (rev 16348)
@@ -121,6 +121,7 @@
}
@SuppressWarnings("unchecked")
+ //TODO nick - schemaLocation is unused
public <T> T unmarshal(String schemaLocation, Class<T> bindClass, InputSource inputSource) throws CdkException {
T unmarshal = null;
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/PropertyBase.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/PropertyBase.java 2010-01-20 23:16:00 UTC (rev 16347)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/PropertyBase.java 2010-01-21 01:40:04 UTC (rev 16348)
@@ -138,7 +138,7 @@
*/
public static class PropertyExtension extends ConfigExtension {
private boolean passThrough = false;
- private Set<EventName> eventNames = Sets.newHashSet();
+ private Set<EventName> eventNames = Sets.newLinkedHashSet();
private List<ClassDescription> signature = Lists.newArrayList();
private Set<String> aliases = Sets.newHashSet();
private boolean generate;
Modified: root/cdk/trunk/plugins/generator/src/main/resources/META-INF/schema/cdk-composite.xsd
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/resources/META-INF/schema/cdk-composite.xsd 2010-01-20 23:16:00 UTC (rev 16347)
+++ root/cdk/trunk/plugins/generator/src/main/resources/META-INF/schema/cdk-composite.xsd 2010-01-21 01:40:04 UTC (rev 16348)
@@ -81,6 +81,7 @@
<xs:choice>
<xs:element ref="cc:attribute" />
<xs:element ref="cc:extension" />
+ <xs:element ref="cc:clientBehavior" />
<xs:any processContents="lax" namespace="##other" />
</xs:choice>
</xs:sequence>
@@ -205,8 +206,6 @@
<xs:attribute name="type">
<xs:annotation>
<xs:documentation>
- <xs:annotation name="type">
- </xs:annotation>
Declares that this attribute must be a ValueExpression whose
expected type
is given by the value of this attribute. If not
@@ -224,6 +223,24 @@
<xs:attributeGroup ref="cc:beanDescriptorAttributes" />
</xs:complexType>
+ <xs:complexType name="clientBehaviorExtensionType">
+ <xs:attribute name="event">
+ <xs:annotation>
+ <xs:documentation>
+ Names of the logical event supported by the component
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+
+ <xs:attribute name="default" type="xs:boolean">
+ <xs:annotation>
+ <xs:documentation>
+ Boolean attribute defining whether the specified logical event is the default component event
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:complexType>
+
<xs:complexType name="compositeExtensionType">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:any processContents="lax" />
@@ -275,5 +292,6 @@
<xs:element name="implementation" type="cc:compositeImplementationType" />
<xs:element name="extension" type="cc:compositeExtensionType" />
<xs:element name="attribute" type="cc:attributeExtensionType" />
+ <xs:element name="clientBehavior" type="cc:clientBehaviorExtensionType" />
</xs:schema>
Modified: root/cdk/trunk/plugins/generator/src/main/resources/META-INF/schema/xhtml-el.xsd
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/resources/META-INF/schema/xhtml-el.xsd 2010-01-20 23:16:00 UTC (rev 16347)
+++ root/cdk/trunk/plugins/generator/src/main/resources/META-INF/schema/xhtml-el.xsd 2010-01-21 01:40:04 UTC (rev 16348)
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
+
<!--
JBoss, Home of Professional Open Source
Copyright ${year}, Red Hat, Inc. and individual contributors
Modified: root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/java/encode-method-preface.ftl
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/java/encode-method-preface.ftl 2010-01-20 23:16:00 UTC (rev 16347)
+++ root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/java/encode-method-preface.ftl 2010-01-21 01:40:04 UTC (rev 16348)
@@ -1,3 +1,2 @@
ResponseWriter ${responseWriterVariable} = ${facesContextVariable}.getResponseWriter();
-String ${clientIdVariable} = ${componentVariable}.getClientId(${facesContextVariable});
-RendererUtils ${rendererUtilsVariable} = RendererUtils.getInstance();
\ No newline at end of file
+String ${clientIdVariable} = ${componentVariable}.getClientId(${facesContextVariable});
\ No newline at end of file
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/parser/el/test/ELParserTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/parser/el/test/ELParserTest.java 2010-01-20 23:16:00 UTC (rev 16347)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/parser/el/test/ELParserTest.java 2010-01-21 01:40:04 UTC (rev 16348)
@@ -413,7 +413,8 @@
@Test
public void testEmpty() throws Exception {
parseExpression("#{empty action.array}");
- assertEquals("this.getUtils().isEmpty(action.getArray())", visitor.getParsedExpression());
+ assertEquals("isEmpty(action.getArray())", visitor.getParsedExpression());
+ assertTrue(visitor.isUseEmptinessCheck());
assertEquals(Boolean.TYPE, visitor.getVariableType().getRawType());
}
Added: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/RendererTemplateParserTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/RendererTemplateParserTest.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/RendererTemplateParserTest.java 2010-01-21 01:40:04 UTC (rev 16348)
@@ -0,0 +1,296 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.cdk.templatecompiler;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.faces.event.ActionEvent;
+import javax.faces.render.RenderKitFactory;
+import javax.faces.validator.Validator;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.richfaces.cdk.CdkContext;
+import org.richfaces.cdk.CdkContextBase;
+import org.richfaces.cdk.CdkTestBase;
+import org.richfaces.cdk.model.ClassDescription;
+import org.richfaces.cdk.model.EventName;
+import org.richfaces.cdk.model.Property;
+import org.richfaces.cdk.model.RenderKitModel;
+import org.richfaces.cdk.model.RendererModel;
+import org.richfaces.cdk.model.RenderKitModel.Id;
+import org.richfaces.cdk.templatecompiler.model.Template;
+
+import com.google.common.collect.Lists;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class RendererTemplateParserTest extends CdkTestBase {
+
+ private RendererTemplateParser parser;
+
+ private CdkContext cdkContext;
+
+ private RenderKitModel getDefaultRenderkitFromModel() {
+ Map<Id, RenderKitModel> renderKits = cdkContext.getLibrary().getRenderKits();
+ assertNotNull(renderKits);
+
+ RenderKitModel renderKit = renderKits.get(new RenderKitModel.Id(RenderKitFactory.HTML_BASIC_RENDER_KIT));
+ assertNotNull(renderKit);
+
+ return renderKit;
+ }
+
+ private RendererModel getFirstRendererFromRenderkit(RenderKitModel renderKit) {
+ Collection<RendererModel> renderers = renderKit.getRenderers();
+ assertNotNull(renderers);
+
+ Iterator<RendererModel> renderersIterator = renderers.iterator();
+ assertTrue(renderersIterator.hasNext());
+
+ RendererModel renderer = renderersIterator.next();
+ assertNotNull(renderer);
+
+ return renderer;
+ }
+
+ private void assertNoSignature(Property property) {
+ List<ClassDescription> signature = property.getSignature();
+ assertNotNull(signature);
+ assertTrue(signature.isEmpty());
+ }
+
+ private void assertNoEventNames(Property property) {
+ Set<EventName> eventNames = property.getEventNames();
+ assertNotNull(eventNames);
+ assertTrue(eventNames.isEmpty());
+ }
+
+ private void assertNoDefaultValue(Property property) {
+ assertNull(property.getDefaultValue());
+ }
+
+ private void assertNotRequired(Property property) {
+ assertFalse(property.isRequired());
+ }
+
+ /**
+ * Checks the following conditions for attribute:<br />
+ * - signature is empty<br />
+ * - There's a single "change" event name that is not a default event<br />
+ *
+ * @param onchangeAttr
+ */
+ private void checkDummyComponentOnchange(Property onchangeAttr) {
+ assertNotNull(onchangeAttr);
+ assertNoSignature(onchangeAttr);
+
+ Set<EventName> changeEvents = onchangeAttr.getEventNames();
+ assertNotNull(changeEvents);
+
+ EventName changeEventName;
+ Iterator<EventName> changeEventsIterator = changeEvents.iterator();
+ assertTrue(changeEventsIterator.hasNext());
+
+ changeEventName = changeEventsIterator.next();
+ assertEquals("change", changeEventName.getName());
+ assertFalse(changeEventName.isDefaultEvent());
+
+ assertFalse(changeEventsIterator.hasNext());
+ }
+
+ /**
+ * Checks the following conditions for attribute:<br />
+ *
+ * - signature is empty<br />
+ * - First event name is "click" and it's not a default event<br />
+ * - Second event name is "action" and it is a default event<br />
+ *
+ * @param onclickAttr
+ */
+ private void checkDummyComponentOnclick(Property onclickAttr) {
+ assertNotNull(onclickAttr);
+ assertNoSignature(onclickAttr);
+
+ Set<EventName> clickEvents = onclickAttr.getEventNames();
+ assertNotNull(clickEvents);
+
+ EventName clickEventName;
+ Iterator<EventName> clickEventsIterator = clickEvents.iterator();
+ assertTrue(clickEventsIterator.hasNext());
+
+ clickEventName = clickEventsIterator.next();
+ assertEquals("click", clickEventName.getName());
+ assertFalse(clickEventName.isDefaultEvent());
+
+ assertTrue(clickEventsIterator.hasNext());
+
+ clickEventName = clickEventsIterator.next();
+ assertEquals("action", clickEventName.getName());
+ assertTrue(clickEventName.isDefaultEvent());
+
+ assertFalse(clickEventsIterator.hasNext());
+ }
+
+ /**
+ * Checks that method signature satisfies the following declaration: <code>java.lang.String action()</code>
+ *
+ * @param actionProperty
+ */
+ private void checkDummyComponentAction(Property actionProperty) {
+ assertNotNull(actionProperty);
+ assertNoEventNames(actionProperty);
+
+ assertEquals(Lists.newArrayList(), actionProperty.getSignature());
+ }
+
+ /**
+ * Checks that method signature satisfies the following declaration:
+ * <code>void actionListener(javax.faces.event.ActionEvent)</code>
+ *
+ * @param actionListenerProperty
+ */
+ private void checkDummyComponentActionListener(Property actionListenerProperty) {
+ assertNotNull(actionListenerProperty);
+ assertNoEventNames(actionListenerProperty);
+
+ assertEquals(Lists.newArrayList(new ClassDescription(ActionEvent.class)), actionListenerProperty.getSignature());
+ }
+
+ /**
+ * Checks that method signature satisfies the following declaration:
+ * <code>float coolMethod(int, java.lang.String, javax.faces.validator.Validator)</code>
+ *
+ * @param actionListenerProperty
+ */
+ private void checkDummyComponentCoolMethod(Property coolMethodProperty) {
+ assertNotNull(coolMethodProperty);
+ assertNoEventNames(coolMethodProperty);
+
+ ArrayList<ClassDescription> expectedSignature = Lists.newArrayList(new ClassDescription(int.class),
+ new ClassDescription(String.class), new ClassDescription(Validator.class));
+
+ assertEquals(expectedSignature, coolMethodProperty.getSignature());
+ }
+
+ /**
+ * @param property
+ */
+ private void checkDummyComponentIntegerAttribute(Property integerAttribute) {
+ assertNotNull(integerAttribute);
+ assertNoEventNames(integerAttribute);
+ assertNoSignature(integerAttribute);
+ assertNotRequired(integerAttribute);
+
+ assertEquals(new ClassDescription(Integer.class), integerAttribute.getType());
+ assertEquals("-1", integerAttribute.getDefaultValue());
+ }
+
+ /**
+ * @param property
+ */
+ private void checkDummyComponentRequiredAttribute(Property requiredAttribute) {
+ assertNotNull(requiredAttribute);
+ assertNoEventNames(requiredAttribute);
+ assertNoSignature(requiredAttribute);
+ assertNoDefaultValue(requiredAttribute);
+
+ assertTrue(requiredAttribute.isRequired());
+ assertEquals("That's a required attribute", requiredAttribute.getDescription());
+ assertEquals("Required Attribute", requiredAttribute.getDisplayname());
+ }
+
+
+
+ @Before
+ public void setUp() throws Exception {
+ parser = new RendererTemplateParser();
+ cdkContext = new CdkContextBase(createClassLoader());
+ parser.init(cdkContext);
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ parser = null;
+ cdkContext = null;
+ }
+
+ @Test
+ public void basicComponentTest() throws Exception {
+ Template template = parser.parseTemplate("urn:resource:org/richfaces/cdk/templatecompiler/basic.template.xml");
+ assertNotNull(template);
+
+ parser.mergeTemplateIntoModel(template);
+
+ RenderKitModel renderKit = getDefaultRenderkitFromModel();
+ RendererModel renderer = getFirstRendererFromRenderkit(renderKit);
+
+ assertEquals(new ClassDescription("org.richfaces.renderkit.html.BasicRendererImpl"), renderer
+ .getRendererClass());
+ }
+
+ @Test
+ public void parserTest() throws Exception {
+ Template template = parser.parseTemplate("urn:resource:org/richfaces/cdk/templatecompiler/dummy.template.xml");
+ assertNotNull(template);
+
+ parser.mergeTemplateIntoModel(template);
+
+ RenderKitModel renderKit = getDefaultRenderkitFromModel();
+ RendererModel renderer = getFirstRendererFromRenderkit(renderKit);
+
+ assertEquals(new ClassDescription("org.richfaces.renderkit.html.DummyRendererImpl"), renderer
+ .getRendererClass());
+
+ assertEquals("org.richfaces.Dummy", renderer.getFamily());
+ assertSame(template, renderer.getTemplate());
+
+ Map<String, Property> attributes = renderer.getAttributes();
+ assertNotNull(attributes);
+
+ checkDummyComponentOnclick(attributes.get("onclick"));
+ checkDummyComponentOnchange(attributes.get("onchange"));
+ checkDummyComponentAction(attributes.get("action"));
+ checkDummyComponentActionListener(attributes.get("actionListener"));
+ checkDummyComponentCoolMethod(attributes.get("coolMethod"));
+ checkDummyComponentIntegerAttribute(attributes.get("integerAttribute"));
+ checkDummyComponentRequiredAttribute(attributes.get("requiredAttribute"));
+
+ assertEquals(7, attributes.size());
+ }
+
+}
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/model/TemplateTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/model/TemplateTest.java 2010-01-20 23:16:00 UTC (rev 16347)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/templatecompiler/model/TemplateTest.java 2010-01-21 01:40:04 UTC (rev 16348)
@@ -191,6 +191,10 @@
"<cc:attribute name=\"id\" required=\"true\" />" +
"<cc:attribute name=\"experts\" shortDescription=\"For use by experts\" displayName=\"Expert attribute\" expert=\"true\" />" +
"<cc:attribute name=\"preferred\" shortDescription=\"It's a preferred attribute\" displayName=\"Preferred attribute\" preferred=\"true\" />" +
+ "<cc:attribute name=\"onchange\">" +
+ "<cc:clientBehavior event=\"change\" />" +
+ "<cc:clientBehavior event=\"valueChange\" default=\"true\" />" +
+ "</cc:attribute>" +
TEMPLATE_MIDDLE + TEMPLATE_EPILOG);
CompositeInterface interfaceSection = template.getInterface();
@@ -198,7 +202,7 @@
List<Attribute> attributes = interfaceSection.getAttributes();
assertNotNull(attributes);
- assertEquals(9, attributes.size());
+ assertEquals(10, attributes.size());
Attribute attribute;
@@ -303,6 +307,26 @@
assertEquals("It's a preferred attribute", attribute.getShortDescription());
assertEquals("Preferred attribute", attribute.getDisplayName());
assertTrue(attribute.isPreferred());
+
+ attribute = attributes.get(9);
+ assertNotNull(attribute);
+ assertEquals("onchange", attribute.getName());
+
+ List<ClientBehavior> clientBehaviors = attribute.getClientBehaviors();
+ assertNotNull(clientBehaviors);
+ assertEquals(2, clientBehaviors.size());
+
+ ClientBehavior clientBehavior;
+
+ clientBehavior = clientBehaviors.get(0);
+ assertNotNull(clientBehavior);
+ assertEquals("change", clientBehavior.getEvent());
+ assertFalse(clientBehavior.isDefaultEvent());
+
+ clientBehavior = clientBehaviors.get(1);
+ assertNotNull(clientBehavior);
+ assertEquals("valueChange", clientBehavior.getEvent());
+ assertTrue(clientBehavior.isDefaultEvent());
}
@Test
Added: root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/templatecompiler/basic.template.xml
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/templatecompiler/basic.template.xml (rev 0)
+++ root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/templatecompiler/basic.template.xml 2010-01-21 01:40:04 UTC (rev 16348)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<cdk:root xmlns="http://richfaces.org/cdk/xhtml-el" xmlns:cdk="http://richfaces.org/cdk/core"
+ xmlns:c="http://richfaces.org/cdk/jstl/core" xmlns:cc="http://richfaces.org/cdk/jsf/composite"
+ xmlns:javaee="http://java.sun.com/xml/ns/javaee">
+
+ <cc:interface>
+ <cdk:class>org.richfaces.renderkit.html.BasicRendererImpl</cdk:class>
+ </cc:interface>
+
+ <cc:implementation />
+
+</cdk:root>
Added: root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/templatecompiler/dummy.template.xml
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/templatecompiler/dummy.template.xml (rev 0)
+++ root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/templatecompiler/dummy.template.xml 2010-01-21 01:40:04 UTC (rev 16348)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<cdk:root xmlns="http://richfaces.org/cdk/xhtml-el" xmlns:cdk="http://richfaces.org/cdk/core"
+ xmlns:c="http://richfaces.org/cdk/jstl/core" xmlns:cc="http://richfaces.org/cdk/jsf/composite"
+ xmlns:javaee="http://java.sun.com/xml/ns/javaee">
+
+ <cc:interface>
+ <cdk:class>org.richfaces.renderkit.html.DummyRendererImpl</cdk:class>
+ <cdk:component-family>org.richfaces.Dummy</cdk:component-family>
+
+ <cc:attribute name="onclick">
+ <cc:clientBehavior event="click" />
+ <cc:clientBehavior event="action" default="true" />
+ </cc:attribute>
+
+ <cc:attribute name="onchange">
+ <cc:clientBehavior event="change" />
+ </cc:attribute>
+
+ <cc:attribute name="action" method-signature="java.lang.String action( )" />
+ <cc:attribute name="actionListener" method-signature=" void actionListener( javax.faces.event.ActionEvent ) " />
+ <cc:attribute name="coolMethod" method-signature=" float coolMethod (
+ int,
+ java.lang.String , javax.faces.validator.Validator
+ ) " />
+
+ <cc:attribute name="integerAttribute" type="java.lang.Integer" default="-1" />
+ <cc:attribute name="requiredAttribute" shortDescription="That's a required attribute"
+ displayName="Required Attribute" required="true" />
+ </cc:interface>
+
+ <cc:implementation />
+
+</cdk:root>
15 years
JBoss Rich Faces SVN: r16347 - in root/docs/trunk: Component_Reference and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2010-01-20 18:16:00 -0500 (Wed, 20 Jan 2010)
New Revision: 16347
Modified:
root/docs/trunk/Component_Development_Kit_Guide/pom.xml
root/docs/trunk/Component_Reference/pom.xml
root/docs/trunk/Developer_Guide/pom.xml
root/docs/trunk/Migration_Guide/pom.xml
Log:
Fixed Hudson builds by using Maven 2.2.1, so removing other edits
Modified: root/docs/trunk/Component_Development_Kit_Guide/pom.xml
===================================================================
--- root/docs/trunk/Component_Development_Kit_Guide/pom.xml 2010-01-20 23:03:01 UTC (rev 16346)
+++ root/docs/trunk/Component_Development_Kit_Guide/pom.xml 2010-01-20 23:16:00 UTC (rev 16347)
@@ -30,24 +30,7 @@
<snapshots>
<enabled>false</enabled>
</snapshots>
- </repository>
- <repository>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- <updatePolicy>never</updatePolicy>
- </snapshots>
- <id>repository.jboss.com</id>
- <name>Jboss Repository for Maven</name>
- <url>http://repository.jboss.com/maven2/</url>
- <layout>default</layout>
</repository>
- <repository>
- <id>eclipse</id>
- <url>http://repo1.maven.org/eclipse/</url>
- </repository>
</repositories>
<pluginRepositories>
@@ -59,19 +42,6 @@
<snapshots>
<enabled>false</enabled>
</snapshots>
- </pluginRepository>
- <pluginRepository>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- <updatePolicy>never</updatePolicy>
- </snapshots>
- <id>repository.jboss.com</id>
- <name>Jboss Repository for Maven</name>
- <url>http://repository.jboss.com/maven2/</url>
- <layout>default</layout>
</pluginRepository>
</pluginRepositories>
@@ -289,15 +259,6 @@
</transformerParameters>
</options>
</configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.0.2</version>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
</plugin>
</plugins>
</build>
Modified: root/docs/trunk/Component_Reference/pom.xml
===================================================================
--- root/docs/trunk/Component_Reference/pom.xml 2010-01-20 23:03:01 UTC (rev 16346)
+++ root/docs/trunk/Component_Reference/pom.xml 2010-01-20 23:16:00 UTC (rev 16347)
@@ -30,24 +30,7 @@
<snapshots>
<enabled>false</enabled>
</snapshots>
- </repository>
- <repository>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- <updatePolicy>never</updatePolicy>
- </snapshots>
- <id>repository.jboss.com</id>
- <name>Jboss Repository for Maven</name>
- <url>http://repository.jboss.com/maven2/</url>
- <layout>default</layout>
</repository>
- <repository>
- <id>eclipse</id>
- <url>http://repo1.maven.org/eclipse/</url>
- </repository>
</repositories>
<pluginRepositories>
@@ -59,19 +42,6 @@
<snapshots>
<enabled>false</enabled>
</snapshots>
- </pluginRepository>
- <pluginRepository>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- <updatePolicy>never</updatePolicy>
- </snapshots>
- <id>repository.jboss.com</id>
- <name>Jboss Repository for Maven</name>
- <url>http://repository.jboss.com/maven2/</url>
- <layout>default</layout>
</pluginRepository>
</pluginRepositories>
@@ -289,15 +259,6 @@
</transformerParameters>
</options>
</configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.0.2</version>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
</plugin>
</plugins>
</build>
Modified: root/docs/trunk/Developer_Guide/pom.xml
===================================================================
--- root/docs/trunk/Developer_Guide/pom.xml 2010-01-20 23:03:01 UTC (rev 16346)
+++ root/docs/trunk/Developer_Guide/pom.xml 2010-01-20 23:16:00 UTC (rev 16347)
@@ -30,24 +30,7 @@
<snapshots>
<enabled>false</enabled>
</snapshots>
- </repository>
- <repository>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- <updatePolicy>never</updatePolicy>
- </snapshots>
- <id>repository.jboss.com</id>
- <name>Jboss Repository for Maven</name>
- <url>http://repository.jboss.com/maven2/</url>
- <layout>default</layout>
</repository>
- <repository>
- <id>eclipse</id>
- <url>http://repo1.maven.org/eclipse/</url>
- </repository>
</repositories>
<pluginRepositories>
@@ -59,19 +42,6 @@
<snapshots>
<enabled>false</enabled>
</snapshots>
- </pluginRepository>
- <pluginRepository>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- <updatePolicy>never</updatePolicy>
- </snapshots>
- <id>repository.jboss.com</id>
- <name>Jboss Repository for Maven</name>
- <url>http://repository.jboss.com/maven2/</url>
- <layout>default</layout>
</pluginRepository>
</pluginRepositories>
@@ -289,15 +259,6 @@
</transformerParameters>
</options>
</configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.0.2</version>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
</plugin>
</plugins>
</build>
Modified: root/docs/trunk/Migration_Guide/pom.xml
===================================================================
--- root/docs/trunk/Migration_Guide/pom.xml 2010-01-20 23:03:01 UTC (rev 16346)
+++ root/docs/trunk/Migration_Guide/pom.xml 2010-01-20 23:16:00 UTC (rev 16347)
@@ -30,24 +30,7 @@
<snapshots>
<enabled>false</enabled>
</snapshots>
- </repository>
- <repository>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- <updatePolicy>never</updatePolicy>
- </snapshots>
- <id>repository.jboss.com</id>
- <name>Jboss Repository for Maven</name>
- <url>http://repository.jboss.com/maven2/</url>
- <layout>default</layout>
</repository>
- <repository>
- <id>eclipse</id>
- <url>http://repo1.maven.org/eclipse/</url>
- </repository>
</repositories>
<pluginRepositories>
@@ -59,19 +42,6 @@
<snapshots>
<enabled>false</enabled>
</snapshots>
- </pluginRepository>
- <pluginRepository>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- <updatePolicy>never</updatePolicy>
- </snapshots>
- <id>repository.jboss.com</id>
- <name>Jboss Repository for Maven</name>
- <url>http://repository.jboss.com/maven2/</url>
- <layout>default</layout>
</pluginRepository>
</pluginRepositories>
@@ -289,15 +259,6 @@
</transformerParameters>
</options>
</configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.0.2</version>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
</plugin>
</plugins>
</build>
15 years
JBoss Rich Faces SVN: r16346 - in root/docs/trunk: Component_Reference and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2010-01-20 18:03:01 -0500 (Wed, 20 Jan 2010)
New Revision: 16346
Modified:
root/docs/trunk/Component_Development_Kit_Guide/pom.xml
root/docs/trunk/Component_Reference/pom.xml
root/docs/trunk/Developer_Guide/pom.xml
root/docs/trunk/Migration_Guide/pom.xml
Log:
Added apache plugin to poms
Modified: root/docs/trunk/Component_Development_Kit_Guide/pom.xml
===================================================================
--- root/docs/trunk/Component_Development_Kit_Guide/pom.xml 2010-01-20 15:10:34 UTC (rev 16345)
+++ root/docs/trunk/Component_Development_Kit_Guide/pom.xml 2010-01-20 23:03:01 UTC (rev 16346)
@@ -1,267 +1,306 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.richfaces</groupId>
- <artifactId>${docname}-${translation}</artifactId>
- <version>1.0</version>
- <packaging>jdocbook</packaging>
- <name>${bookname}-(${translation})</name>
-
- <parent>
- <groupId>org.jboss.richfaces</groupId>
- <artifactId>docs</artifactId>
- <version>1.0</version>
- </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.richfaces</groupId>
+ <artifactId>${docname}-${translation}</artifactId>
+ <version>1.0</version>
+ <packaging>jdocbook</packaging>
+ <name>${bookname}-(${translation})</name>
+
+ <parent>
+ <groupId>org.jboss.richfaces</groupId>
+ <artifactId>docs</artifactId>
+ <version>1.0</version>
+ </parent>
- <properties>
- <translation>en-US</translation>
- <docname>Component_Development_Kit_Guide</docname>
- <bookname>Component Development Kit Guide</bookname>
- </properties>
+ <properties>
+ <translation>en-US</translation>
+ <docname>Component_Development_Kit_Guide</docname>
+ <bookname>Component Development Kit Guide</bookname>
+ </properties>
- <repositories>
- <repository>
- <id>repository.jboss.org</id>
- <name>JBoss Repository</name>
- <layout>default</layout>
- <url>http://repository.jboss.org/maven2/</url>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
- </repositories>
+ <repositories>
+ <repository>
+ <id>repository.jboss.org</id>
+ <name>JBoss Repository</name>
+ <layout>default</layout>
+ <url>http://repository.jboss.org/maven2/</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ <repository>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ <updatePolicy>never</updatePolicy>
+ </snapshots>
+ <id>repository.jboss.com</id>
+ <name>Jboss Repository for Maven</name>
+ <url>http://repository.jboss.com/maven2/</url>
+ <layout>default</layout>
+ </repository>
+ <repository>
+ <id>eclipse</id>
+ <url>http://repo1.maven.org/eclipse/</url>
+ </repository>
+ </repositories>
- <pluginRepositories>
- <pluginRepository>
- <id>repository.jboss.org</id>
- <name>JBoss Repository</name>
- <layout>default</layout>
- <url>http://repository.jboss.org/maven2/</url>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </pluginRepository>
- </pluginRepositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>repository.jboss.org</id>
+ <name>JBoss Repository</name>
+ <layout>default</layout>
+ <url>http://repository.jboss.org/maven2/</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </pluginRepository>
+ <pluginRepository>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ <updatePolicy>never</updatePolicy>
+ </snapshots>
+ <id>repository.jboss.com</id>
+ <name>Jboss Repository for Maven</name>
+ <url>http://repository.jboss.com/maven2/</url>
+ <layout>default</layout>
+ </pluginRepository>
+ </pluginRepositories>
- <profiles>
+ <profiles>
- <!-- mvn compile -->
- <profile>
- <id>all</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jdocbook-plugin</artifactId>
- <version>2.2.0</version>
- <extensions>true</extensions>
- <configuration>
- <formats>
- <format>
- <formatName>pdf</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
- <finalName>${docname}.pdf</finalName>
- </format>
- <format>
- <formatName>html</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- <format>
- <formatName>html_single</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- </formats>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
+ <!-- mvn compile -->
+ <profile>
+ <id>all</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.2.0</version>
+ <extensions>true</extensions>
+ <configuration>
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
+ <finalName>${docname}.pdf</finalName>
+ </format>
+ <format>
+ <formatName>html</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>html_single</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
- <!-- mvn compile -Phtml -->
- <profile>
- <id>html</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jdocbook-plugin</artifactId>
- <version>2.2.0</version>
- <extensions>true</extensions>
- <configuration>
- <formats>
- <format>
- <formatName>html</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- </formats>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
+ <!-- mvn compile -Phtml -->
+ <profile>
+ <id>html</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.2.0</version>
+ <extensions>true</extensions>
+ <configuration>
+ <formats>
+ <format>
+ <formatName>html</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
- <!-- mvn compile -Phtml-single -->
- <profile>
- <id>html-single</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jdocbook-plugin</artifactId>
- <version>2.2.0</version>
- <extensions>true</extensions>
- <configuration>
- <formats>
- <format>
- <formatName>html_single</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- </formats>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
+ <!-- mvn compile -Phtml-single -->
+ <profile>
+ <id>html-single</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.2.0</version>
+ <extensions>true</extensions>
+ <configuration>
+ <formats>
+ <format>
+ <formatName>html_single</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
- <!-- mvn compile -Ppdf -->
- <profile>
- <id>pdf</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jdocbook-plugin</artifactId>
- <version>2.2.0</version>
- <extensions>true</extensions>
- <configuration>
- <formats>
- <format>
- <formatName>pdf</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
- <finalName>${docname}.pdf</finalName>
- </format>
- </formats>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <!-- mvn compile -Pdocs -->
- <!-- For compiling from parent pom.xml -->
- <profile>
- <id>docs</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jdocbook-plugin</artifactId>
- <version>2.2.0</version>
- <extensions>true</extensions>
- <configuration>
- <formats>
- <format>
- <formatName>pdf</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
- <finalName>${docname}.pdf</finalName>
- </format>
- <format>
- <formatName>html</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- <format>
- <formatName>html_single</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- </formats>
- <imageResource>
- <directory>${docname}/${translation}</directory>
- <includes>
- <include>images/*</include>
- </includes>
- </imageResource>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
+ <!-- mvn compile -Ppdf -->
+ <profile>
+ <id>pdf</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.2.0</version>
+ <extensions>true</extensions>
+ <configuration>
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
+ <finalName>${docname}.pdf</finalName>
+ </format>
+ </formats>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <!-- mvn compile -Pdocs -->
+ <!-- For compiling from parent pom.xml -->
+ <profile>
+ <id>docs</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.2.0</version>
+ <extensions>true</extensions>
+ <configuration>
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
+ <finalName>${docname}.pdf</finalName>
+ </format>
+ <format>
+ <formatName>html</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>html_single</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+ <imageResource>
+ <directory>${docname}/${translation}</directory>
+ <includes>
+ <include>images/*</include>
+ </includes>
+ </imageResource>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
- </profiles>
+ </profiles>
- <build>
- <plugins>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jdocbook-plugin</artifactId>
- <version>2.2.0</version>
- <extensions>true</extensions>
- <dependencies>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jbossorg-docbook-xslt</artifactId>
- <version>1.1.0</version>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jbossorg-jdocbook-style</artifactId>
- <version>1.1.0</version>
- <type>jdocbook-style</type>
- </dependency>
- </dependencies>
- <configuration>
- <sourceDocumentName>${docname}.xml</sourceDocumentName>
- <sourceDirectory>.</sourceDirectory>
- <imageResource>
- <directory>${translation}</directory>
- <includes>
- <include>images/*</include>
- </includes>
- </imageResource>
- <options>
- <xincludeSupported>true</xincludeSupported>
- <xmlTransformerType>saxon</xmlTransformerType>
- <!-- needed for uri-resolvers; can be ommitted if using 'current' uri scheme -->
- <!-- could also locate the docbook dependency and inspect its version... -->
- <docbookVersion>1.72.0</docbookVersion>
- <transformerParameters>
- <property>
- <name>javax.xml.parsers.DocumentBuilderFactory</name>
- <value>org.apache.xerces.jaxp.DocumentBuilderFactoryImpl</value>
- </property>
- <property>
- <name>javax.xml.parsers.SAXParserFactory</name>
- <value>org.apache.xerces.jaxp.SAXParserFactoryImpl</value>
- </property>
- </transformerParameters>
- </options>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.2.0</version>
+ <extensions>true</extensions>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-docbook-xslt</artifactId>
+ <version>1.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-jdocbook-style</artifactId>
+ <version>1.1.0</version>
+ <type>jdocbook-style</type>
+ </dependency>
+ </dependencies>
+ <configuration>
+ <sourceDocumentName>${docname}.xml</sourceDocumentName>
+ <sourceDirectory>.</sourceDirectory>
+ <imageResource>
+ <directory>${translation}</directory>
+ <includes>
+ <include>images/*</include>
+ </includes>
+ </imageResource>
+ <options>
+ <xincludeSupported>true</xincludeSupported>
+ <xmlTransformerType>saxon</xmlTransformerType>
+ <!-- needed for uri-resolvers; can be ommitted if using 'current' uri scheme -->
+ <!-- could also locate the docbook dependency and inspect its version... -->
+ <docbookVersion>1.72.0</docbookVersion>
+ <transformerParameters>
+ <property>
+ <name>javax.xml.parsers.DocumentBuilderFactory</name>
+ <value>org.apache.xerces.jaxp.DocumentBuilderFactoryImpl</value>
+ </property>
+ <property>
+ <name>javax.xml.parsers.SAXParserFactory</name>
+ <value>org.apache.xerces.jaxp.SAXParserFactoryImpl</value>
+ </property>
+ </transformerParameters>
+ </options>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.0.2</version>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
Modified: root/docs/trunk/Component_Reference/pom.xml
===================================================================
--- root/docs/trunk/Component_Reference/pom.xml 2010-01-20 15:10:34 UTC (rev 16345)
+++ root/docs/trunk/Component_Reference/pom.xml 2010-01-20 23:03:01 UTC (rev 16346)
@@ -1,267 +1,306 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.richfaces</groupId>
- <artifactId>${docname}-${translation}</artifactId>
- <version>1.0</version>
- <packaging>jdocbook</packaging>
- <name>${bookname}-(${translation})</name>
-
- <parent>
- <groupId>org.jboss.richfaces</groupId>
- <artifactId>docs</artifactId>
- <version>1.0</version>
- </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.richfaces</groupId>
+ <artifactId>${docname}-${translation}</artifactId>
+ <version>1.0</version>
+ <packaging>jdocbook</packaging>
+ <name>${bookname}-(${translation})</name>
+
+ <parent>
+ <groupId>org.jboss.richfaces</groupId>
+ <artifactId>docs</artifactId>
+ <version>1.0</version>
+ </parent>
- <properties>
- <translation>en-US</translation>
- <docname>Component_Reference</docname>
- <bookname>Component Reference</bookname>
- </properties>
+ <properties>
+ <translation>en-US</translation>
+ <docname>Component_Reference</docname>
+ <bookname>Component Reference</bookname>
+ </properties>
- <repositories>
- <repository>
- <id>repository.jboss.org</id>
- <name>JBoss Repository</name>
- <layout>default</layout>
- <url>http://repository.jboss.org/maven2/</url>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
- </repositories>
+ <repositories>
+ <repository>
+ <id>repository.jboss.org</id>
+ <name>JBoss Repository</name>
+ <layout>default</layout>
+ <url>http://repository.jboss.org/maven2/</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ <repository>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ <updatePolicy>never</updatePolicy>
+ </snapshots>
+ <id>repository.jboss.com</id>
+ <name>Jboss Repository for Maven</name>
+ <url>http://repository.jboss.com/maven2/</url>
+ <layout>default</layout>
+ </repository>
+ <repository>
+ <id>eclipse</id>
+ <url>http://repo1.maven.org/eclipse/</url>
+ </repository>
+ </repositories>
- <pluginRepositories>
- <pluginRepository>
- <id>repository.jboss.org</id>
- <name>JBoss Repository</name>
- <layout>default</layout>
- <url>http://repository.jboss.org/maven2/</url>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </pluginRepository>
- </pluginRepositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>repository.jboss.org</id>
+ <name>JBoss Repository</name>
+ <layout>default</layout>
+ <url>http://repository.jboss.org/maven2/</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </pluginRepository>
+ <pluginRepository>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ <updatePolicy>never</updatePolicy>
+ </snapshots>
+ <id>repository.jboss.com</id>
+ <name>Jboss Repository for Maven</name>
+ <url>http://repository.jboss.com/maven2/</url>
+ <layout>default</layout>
+ </pluginRepository>
+ </pluginRepositories>
- <profiles>
+ <profiles>
- <!-- mvn compile -->
- <profile>
- <id>all</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jdocbook-plugin</artifactId>
- <version>2.2.0</version>
- <extensions>true</extensions>
- <configuration>
- <formats>
- <format>
- <formatName>pdf</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
- <finalName>${docname}.pdf</finalName>
- </format>
- <format>
- <formatName>html</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- <format>
- <formatName>html_single</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- </formats>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
+ <!-- mvn compile -->
+ <profile>
+ <id>all</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.2.0</version>
+ <extensions>true</extensions>
+ <configuration>
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
+ <finalName>${docname}.pdf</finalName>
+ </format>
+ <format>
+ <formatName>html</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>html_single</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
- <!-- mvn compile -Phtml -->
- <profile>
- <id>html</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jdocbook-plugin</artifactId>
- <version>2.2.0</version>
- <extensions>true</extensions>
- <configuration>
- <formats>
- <format>
- <formatName>html</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- </formats>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
+ <!-- mvn compile -Phtml -->
+ <profile>
+ <id>html</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.2.0</version>
+ <extensions>true</extensions>
+ <configuration>
+ <formats>
+ <format>
+ <formatName>html</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
- <!-- mvn compile -Phtml-single -->
- <profile>
- <id>html-single</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jdocbook-plugin</artifactId>
- <version>2.2.0</version>
- <extensions>true</extensions>
- <configuration>
- <formats>
- <format>
- <formatName>html_single</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- </formats>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
+ <!-- mvn compile -Phtml-single -->
+ <profile>
+ <id>html-single</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.2.0</version>
+ <extensions>true</extensions>
+ <configuration>
+ <formats>
+ <format>
+ <formatName>html_single</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
- <!-- mvn compile -Ppdf -->
- <profile>
- <id>pdf</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jdocbook-plugin</artifactId>
- <version>2.2.0</version>
- <extensions>true</extensions>
- <configuration>
- <formats>
- <format>
- <formatName>pdf</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
- <finalName>${docname}.pdf</finalName>
- </format>
- </formats>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <!-- mvn compile -Pdocs -->
- <!-- For compiling from parent pom.xml -->
- <profile>
- <id>docs</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jdocbook-plugin</artifactId>
- <version>2.2.0</version>
- <extensions>true</extensions>
- <configuration>
- <formats>
- <format>
- <formatName>pdf</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
- <finalName>${docname}.pdf</finalName>
- </format>
- <format>
- <formatName>html</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- <format>
- <formatName>html_single</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- </formats>
- <imageResource>
- <directory>${docname}/${translation}</directory>
- <includes>
- <include>images/*</include>
- </includes>
- </imageResource>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
+ <!-- mvn compile -Ppdf -->
+ <profile>
+ <id>pdf</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.2.0</version>
+ <extensions>true</extensions>
+ <configuration>
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
+ <finalName>${docname}.pdf</finalName>
+ </format>
+ </formats>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <!-- mvn compile -Pdocs -->
+ <!-- For compiling from parent pom.xml -->
+ <profile>
+ <id>docs</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.2.0</version>
+ <extensions>true</extensions>
+ <configuration>
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
+ <finalName>${docname}.pdf</finalName>
+ </format>
+ <format>
+ <formatName>html</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>html_single</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+ <imageResource>
+ <directory>${docname}/${translation}</directory>
+ <includes>
+ <include>images/*</include>
+ </includes>
+ </imageResource>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
- </profiles>
+ </profiles>
- <build>
- <plugins>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jdocbook-plugin</artifactId>
- <version>2.2.0</version>
- <extensions>true</extensions>
- <dependencies>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jbossorg-docbook-xslt</artifactId>
- <version>1.1.0</version>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jbossorg-jdocbook-style</artifactId>
- <version>1.1.0</version>
- <type>jdocbook-style</type>
- </dependency>
- </dependencies>
- <configuration>
- <sourceDocumentName>${docname}.xml</sourceDocumentName>
- <sourceDirectory>.</sourceDirectory>
- <imageResource>
- <directory>${translation}</directory>
- <includes>
- <include>images/*</include>
- </includes>
- </imageResource>
- <options>
- <xincludeSupported>true</xincludeSupported>
- <xmlTransformerType>saxon</xmlTransformerType>
- <!-- needed for uri-resolvers; can be ommitted if using 'current' uri scheme -->
- <!-- could also locate the docbook dependency and inspect its version... -->
- <docbookVersion>1.72.0</docbookVersion>
- <transformerParameters>
- <property>
- <name>javax.xml.parsers.DocumentBuilderFactory</name>
- <value>org.apache.xerces.jaxp.DocumentBuilderFactoryImpl</value>
- </property>
- <property>
- <name>javax.xml.parsers.SAXParserFactory</name>
- <value>org.apache.xerces.jaxp.SAXParserFactoryImpl</value>
- </property>
- </transformerParameters>
- </options>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.2.0</version>
+ <extensions>true</extensions>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-docbook-xslt</artifactId>
+ <version>1.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-jdocbook-style</artifactId>
+ <version>1.1.0</version>
+ <type>jdocbook-style</type>
+ </dependency>
+ </dependencies>
+ <configuration>
+ <sourceDocumentName>${docname}.xml</sourceDocumentName>
+ <sourceDirectory>.</sourceDirectory>
+ <imageResource>
+ <directory>${translation}</directory>
+ <includes>
+ <include>images/*</include>
+ </includes>
+ </imageResource>
+ <options>
+ <xincludeSupported>true</xincludeSupported>
+ <xmlTransformerType>saxon</xmlTransformerType>
+ <!-- needed for uri-resolvers; can be ommitted if using 'current' uri scheme -->
+ <!-- could also locate the docbook dependency and inspect its version... -->
+ <docbookVersion>1.72.0</docbookVersion>
+ <transformerParameters>
+ <property>
+ <name>javax.xml.parsers.DocumentBuilderFactory</name>
+ <value>org.apache.xerces.jaxp.DocumentBuilderFactoryImpl</value>
+ </property>
+ <property>
+ <name>javax.xml.parsers.SAXParserFactory</name>
+ <value>org.apache.xerces.jaxp.SAXParserFactoryImpl</value>
+ </property>
+ </transformerParameters>
+ </options>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.0.2</version>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
Modified: root/docs/trunk/Developer_Guide/pom.xml
===================================================================
--- root/docs/trunk/Developer_Guide/pom.xml 2010-01-20 15:10:34 UTC (rev 16345)
+++ root/docs/trunk/Developer_Guide/pom.xml 2010-01-20 23:03:01 UTC (rev 16346)
@@ -1,267 +1,306 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.richfaces</groupId>
- <artifactId>${docname}-${translation}</artifactId>
- <version>1.0</version>
- <packaging>jdocbook</packaging>
- <name>${bookname}-(${translation})</name>
-
- <parent>
- <groupId>org.jboss.richfaces</groupId>
- <artifactId>docs</artifactId>
- <version>1.0</version>
- </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.richfaces</groupId>
+ <artifactId>${docname}-${translation}</artifactId>
+ <version>1.0</version>
+ <packaging>jdocbook</packaging>
+ <name>${bookname}-(${translation})</name>
+
+ <parent>
+ <groupId>org.jboss.richfaces</groupId>
+ <artifactId>docs</artifactId>
+ <version>1.0</version>
+ </parent>
- <properties>
- <translation>en-US</translation>
- <docname>Developer_Guide</docname>
- <bookname>Developer Guide</bookname>
- </properties>
+ <properties>
+ <translation>en-US</translation>
+ <docname>Developer_Guide</docname>
+ <bookname>Developer Guide</bookname>
+ </properties>
- <repositories>
- <repository>
- <id>repository.jboss.org</id>
- <name>JBoss Repository</name>
- <layout>default</layout>
- <url>http://repository.jboss.org/maven2/</url>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
- </repositories>
+ <repositories>
+ <repository>
+ <id>repository.jboss.org</id>
+ <name>JBoss Repository</name>
+ <layout>default</layout>
+ <url>http://repository.jboss.org/maven2/</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ <repository>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ <updatePolicy>never</updatePolicy>
+ </snapshots>
+ <id>repository.jboss.com</id>
+ <name>Jboss Repository for Maven</name>
+ <url>http://repository.jboss.com/maven2/</url>
+ <layout>default</layout>
+ </repository>
+ <repository>
+ <id>eclipse</id>
+ <url>http://repo1.maven.org/eclipse/</url>
+ </repository>
+ </repositories>
- <pluginRepositories>
- <pluginRepository>
- <id>repository.jboss.org</id>
- <name>JBoss Repository</name>
- <layout>default</layout>
- <url>http://repository.jboss.org/maven2/</url>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </pluginRepository>
- </pluginRepositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>repository.jboss.org</id>
+ <name>JBoss Repository</name>
+ <layout>default</layout>
+ <url>http://repository.jboss.org/maven2/</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </pluginRepository>
+ <pluginRepository>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ <updatePolicy>never</updatePolicy>
+ </snapshots>
+ <id>repository.jboss.com</id>
+ <name>Jboss Repository for Maven</name>
+ <url>http://repository.jboss.com/maven2/</url>
+ <layout>default</layout>
+ </pluginRepository>
+ </pluginRepositories>
- <profiles>
+ <profiles>
- <!-- mvn compile -->
- <profile>
- <id>all</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jdocbook-plugin</artifactId>
- <version>2.2.0</version>
- <extensions>true</extensions>
- <configuration>
- <formats>
- <format>
- <formatName>pdf</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
- <finalName>${docname}.pdf</finalName>
- </format>
- <format>
- <formatName>html</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- <format>
- <formatName>html_single</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- </formats>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
+ <!-- mvn compile -->
+ <profile>
+ <id>all</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.2.0</version>
+ <extensions>true</extensions>
+ <configuration>
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
+ <finalName>${docname}.pdf</finalName>
+ </format>
+ <format>
+ <formatName>html</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>html_single</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
- <!-- mvn compile -Phtml -->
- <profile>
- <id>html</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jdocbook-plugin</artifactId>
- <version>2.2.0</version>
- <extensions>true</extensions>
- <configuration>
- <formats>
- <format>
- <formatName>html</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- </formats>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
+ <!-- mvn compile -Phtml -->
+ <profile>
+ <id>html</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.2.0</version>
+ <extensions>true</extensions>
+ <configuration>
+ <formats>
+ <format>
+ <formatName>html</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
- <!-- mvn compile -Phtml-single -->
- <profile>
- <id>html-single</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jdocbook-plugin</artifactId>
- <version>2.2.0</version>
- <extensions>true</extensions>
- <configuration>
- <formats>
- <format>
- <formatName>html_single</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- </formats>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
+ <!-- mvn compile -Phtml-single -->
+ <profile>
+ <id>html-single</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.2.0</version>
+ <extensions>true</extensions>
+ <configuration>
+ <formats>
+ <format>
+ <formatName>html_single</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
- <!-- mvn compile -Ppdf -->
- <profile>
- <id>pdf</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jdocbook-plugin</artifactId>
- <version>2.2.0</version>
- <extensions>true</extensions>
- <configuration>
- <formats>
- <format>
- <formatName>pdf</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
- <finalName>${docname}.pdf</finalName>
- </format>
- </formats>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <!-- mvn compile -Pdocs -->
- <!-- For compiling from parent pom.xml -->
- <profile>
- <id>docs</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jdocbook-plugin</artifactId>
- <version>2.2.0</version>
- <extensions>true</extensions>
- <configuration>
- <formats>
- <format>
- <formatName>pdf</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
- <finalName>${docname}.pdf</finalName>
- </format>
- <format>
- <formatName>html</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- <format>
- <formatName>html_single</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- </formats>
- <imageResource>
- <directory>${docname}/${translation}</directory>
- <includes>
- <include>images/*</include>
- </includes>
- </imageResource>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
+ <!-- mvn compile -Ppdf -->
+ <profile>
+ <id>pdf</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.2.0</version>
+ <extensions>true</extensions>
+ <configuration>
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
+ <finalName>${docname}.pdf</finalName>
+ </format>
+ </formats>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <!-- mvn compile -Pdocs -->
+ <!-- For compiling from parent pom.xml -->
+ <profile>
+ <id>docs</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.2.0</version>
+ <extensions>true</extensions>
+ <configuration>
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
+ <finalName>${docname}.pdf</finalName>
+ </format>
+ <format>
+ <formatName>html</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>html_single</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+ <imageResource>
+ <directory>${docname}/${translation}</directory>
+ <includes>
+ <include>images/*</include>
+ </includes>
+ </imageResource>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
- </profiles>
+ </profiles>
- <build>
- <plugins>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jdocbook-plugin</artifactId>
- <version>2.2.0</version>
- <extensions>true</extensions>
- <dependencies>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jbossorg-docbook-xslt</artifactId>
- <version>1.1.0</version>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jbossorg-jdocbook-style</artifactId>
- <version>1.1.0</version>
- <type>jdocbook-style</type>
- </dependency>
- </dependencies>
- <configuration>
- <sourceDocumentName>${docname}.xml</sourceDocumentName>
- <sourceDirectory>.</sourceDirectory>
- <imageResource>
- <directory>${translation}</directory>
- <includes>
- <include>images/*</include>
- </includes>
- </imageResource>
- <options>
- <xincludeSupported>true</xincludeSupported>
- <xmlTransformerType>saxon</xmlTransformerType>
- <!-- needed for uri-resolvers; can be ommitted if using 'current' uri scheme -->
- <!-- could also locate the docbook dependency and inspect its version... -->
- <docbookVersion>1.72.0</docbookVersion>
- <transformerParameters>
- <property>
- <name>javax.xml.parsers.DocumentBuilderFactory</name>
- <value>org.apache.xerces.jaxp.DocumentBuilderFactoryImpl</value>
- </property>
- <property>
- <name>javax.xml.parsers.SAXParserFactory</name>
- <value>org.apache.xerces.jaxp.SAXParserFactoryImpl</value>
- </property>
- </transformerParameters>
- </options>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.2.0</version>
+ <extensions>true</extensions>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-docbook-xslt</artifactId>
+ <version>1.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-jdocbook-style</artifactId>
+ <version>1.1.0</version>
+ <type>jdocbook-style</type>
+ </dependency>
+ </dependencies>
+ <configuration>
+ <sourceDocumentName>${docname}.xml</sourceDocumentName>
+ <sourceDirectory>.</sourceDirectory>
+ <imageResource>
+ <directory>${translation}</directory>
+ <includes>
+ <include>images/*</include>
+ </includes>
+ </imageResource>
+ <options>
+ <xincludeSupported>true</xincludeSupported>
+ <xmlTransformerType>saxon</xmlTransformerType>
+ <!-- needed for uri-resolvers; can be ommitted if using 'current' uri scheme -->
+ <!-- could also locate the docbook dependency and inspect its version... -->
+ <docbookVersion>1.72.0</docbookVersion>
+ <transformerParameters>
+ <property>
+ <name>javax.xml.parsers.DocumentBuilderFactory</name>
+ <value>org.apache.xerces.jaxp.DocumentBuilderFactoryImpl</value>
+ </property>
+ <property>
+ <name>javax.xml.parsers.SAXParserFactory</name>
+ <value>org.apache.xerces.jaxp.SAXParserFactoryImpl</value>
+ </property>
+ </transformerParameters>
+ </options>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.0.2</version>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
Modified: root/docs/trunk/Migration_Guide/pom.xml
===================================================================
--- root/docs/trunk/Migration_Guide/pom.xml 2010-01-20 15:10:34 UTC (rev 16345)
+++ root/docs/trunk/Migration_Guide/pom.xml 2010-01-20 23:03:01 UTC (rev 16346)
@@ -1,267 +1,306 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.richfaces</groupId>
- <artifactId>${docname}-${translation}</artifactId>
- <version>1.0</version>
- <packaging>jdocbook</packaging>
- <name>${bookname}-(${translation})</name>
-
- <parent>
- <groupId>org.jboss.richfaces</groupId>
- <artifactId>docs</artifactId>
- <version>1.0</version>
- </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.richfaces</groupId>
+ <artifactId>${docname}-${translation}</artifactId>
+ <version>1.0</version>
+ <packaging>jdocbook</packaging>
+ <name>${bookname}-(${translation})</name>
+
+ <parent>
+ <groupId>org.jboss.richfaces</groupId>
+ <artifactId>docs</artifactId>
+ <version>1.0</version>
+ </parent>
- <properties>
- <translation>en-US</translation>
- <docname>Migration_Guide</docname>
- <bookname>Migration Guide</bookname>
- </properties>
+ <properties>
+ <translation>en-US</translation>
+ <docname>Migration_Guide</docname>
+ <bookname>Migration Guide</bookname>
+ </properties>
- <repositories>
- <repository>
- <id>repository.jboss.org</id>
- <name>JBoss Repository</name>
- <layout>default</layout>
- <url>http://repository.jboss.org/maven2/</url>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
- </repositories>
+ <repositories>
+ <repository>
+ <id>repository.jboss.org</id>
+ <name>JBoss Repository</name>
+ <layout>default</layout>
+ <url>http://repository.jboss.org/maven2/</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ <repository>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ <updatePolicy>never</updatePolicy>
+ </snapshots>
+ <id>repository.jboss.com</id>
+ <name>Jboss Repository for Maven</name>
+ <url>http://repository.jboss.com/maven2/</url>
+ <layout>default</layout>
+ </repository>
+ <repository>
+ <id>eclipse</id>
+ <url>http://repo1.maven.org/eclipse/</url>
+ </repository>
+ </repositories>
- <pluginRepositories>
- <pluginRepository>
- <id>repository.jboss.org</id>
- <name>JBoss Repository</name>
- <layout>default</layout>
- <url>http://repository.jboss.org/maven2/</url>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </pluginRepository>
- </pluginRepositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>repository.jboss.org</id>
+ <name>JBoss Repository</name>
+ <layout>default</layout>
+ <url>http://repository.jboss.org/maven2/</url>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </pluginRepository>
+ <pluginRepository>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ <updatePolicy>never</updatePolicy>
+ </snapshots>
+ <id>repository.jboss.com</id>
+ <name>Jboss Repository for Maven</name>
+ <url>http://repository.jboss.com/maven2/</url>
+ <layout>default</layout>
+ </pluginRepository>
+ </pluginRepositories>
- <profiles>
+ <profiles>
- <!-- mvn compile -->
- <profile>
- <id>all</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jdocbook-plugin</artifactId>
- <version>2.2.0</version>
- <extensions>true</extensions>
- <configuration>
- <formats>
- <format>
- <formatName>pdf</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
- <finalName>${docname}.pdf</finalName>
- </format>
- <format>
- <formatName>html</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- <format>
- <formatName>html_single</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- </formats>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
+ <!-- mvn compile -->
+ <profile>
+ <id>all</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.2.0</version>
+ <extensions>true</extensions>
+ <configuration>
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
+ <finalName>${docname}.pdf</finalName>
+ </format>
+ <format>
+ <formatName>html</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>html_single</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
- <!-- mvn compile -Phtml -->
- <profile>
- <id>html</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jdocbook-plugin</artifactId>
- <version>2.2.0</version>
- <extensions>true</extensions>
- <configuration>
- <formats>
- <format>
- <formatName>html</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- </formats>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
+ <!-- mvn compile -Phtml -->
+ <profile>
+ <id>html</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.2.0</version>
+ <extensions>true</extensions>
+ <configuration>
+ <formats>
+ <format>
+ <formatName>html</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
- <!-- mvn compile -Phtml-single -->
- <profile>
- <id>html-single</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jdocbook-plugin</artifactId>
- <version>2.2.0</version>
- <extensions>true</extensions>
- <configuration>
- <formats>
- <format>
- <formatName>html_single</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- </formats>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
+ <!-- mvn compile -Phtml-single -->
+ <profile>
+ <id>html-single</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.2.0</version>
+ <extensions>true</extensions>
+ <configuration>
+ <formats>
+ <format>
+ <formatName>html_single</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
- <!-- mvn compile -Ppdf -->
- <profile>
- <id>pdf</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jdocbook-plugin</artifactId>
- <version>2.2.0</version>
- <extensions>true</extensions>
- <configuration>
- <formats>
- <format>
- <formatName>pdf</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
- <finalName>${docname}.pdf</finalName>
- </format>
- </formats>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <!-- mvn compile -Pdocs -->
- <!-- For compiling from parent pom.xml -->
- <profile>
- <id>docs</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jdocbook-plugin</artifactId>
- <version>2.2.0</version>
- <extensions>true</extensions>
- <configuration>
- <formats>
- <format>
- <formatName>pdf</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
- <finalName>${docname}.pdf</finalName>
- </format>
- <format>
- <formatName>html</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- <format>
- <formatName>html_single</formatName>
- <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
- <finalName>index.html</finalName>
- </format>
- </formats>
- <imageResource>
- <directory>${docname}/${translation}</directory>
- <includes>
- <include>images/*</include>
- </includes>
- </imageResource>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
+ <!-- mvn compile -Ppdf -->
+ <profile>
+ <id>pdf</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.2.0</version>
+ <extensions>true</extensions>
+ <configuration>
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
+ <finalName>${docname}.pdf</finalName>
+ </format>
+ </formats>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <!-- mvn compile -Pdocs -->
+ <!-- For compiling from parent pom.xml -->
+ <profile>
+ <id>docs</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.2.0</version>
+ <extensions>true</extensions>
+ <configuration>
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
+ <finalName>${docname}.pdf</finalName>
+ </format>
+ <format>
+ <formatName>html</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>html_single</formatName>
+ <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+ <imageResource>
+ <directory>${docname}/${translation}</directory>
+ <includes>
+ <include>images/*</include>
+ </includes>
+ </imageResource>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
- </profiles>
+ </profiles>
- <build>
- <plugins>
- <plugin>
- <groupId>org.jboss.maven.plugins</groupId>
- <artifactId>maven-jdocbook-plugin</artifactId>
- <version>2.2.0</version>
- <extensions>true</extensions>
- <dependencies>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jbossorg-docbook-xslt</artifactId>
- <version>1.1.0</version>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jbossorg-jdocbook-style</artifactId>
- <version>1.1.0</version>
- <type>jdocbook-style</type>
- </dependency>
- </dependencies>
- <configuration>
- <sourceDocumentName>${docname}.xml</sourceDocumentName>
- <sourceDirectory>.</sourceDirectory>
- <imageResource>
- <directory>${translation}</directory>
- <includes>
- <include>images/*</include>
- </includes>
- </imageResource>
- <options>
- <xincludeSupported>true</xincludeSupported>
- <xmlTransformerType>saxon</xmlTransformerType>
- <!-- needed for uri-resolvers; can be ommitted if using 'current' uri scheme -->
- <!-- could also locate the docbook dependency and inspect its version... -->
- <docbookVersion>1.72.0</docbookVersion>
- <transformerParameters>
- <property>
- <name>javax.xml.parsers.DocumentBuilderFactory</name>
- <value>org.apache.xerces.jaxp.DocumentBuilderFactoryImpl</value>
- </property>
- <property>
- <name>javax.xml.parsers.SAXParserFactory</name>
- <value>org.apache.xerces.jaxp.SAXParserFactoryImpl</value>
- </property>
- </transformerParameters>
- </options>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.2.0</version>
+ <extensions>true</extensions>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-docbook-xslt</artifactId>
+ <version>1.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-jdocbook-style</artifactId>
+ <version>1.1.0</version>
+ <type>jdocbook-style</type>
+ </dependency>
+ </dependencies>
+ <configuration>
+ <sourceDocumentName>${docname}.xml</sourceDocumentName>
+ <sourceDirectory>.</sourceDirectory>
+ <imageResource>
+ <directory>${translation}</directory>
+ <includes>
+ <include>images/*</include>
+ </includes>
+ </imageResource>
+ <options>
+ <xincludeSupported>true</xincludeSupported>
+ <xmlTransformerType>saxon</xmlTransformerType>
+ <!-- needed for uri-resolvers; can be ommitted if using 'current' uri scheme -->
+ <!-- could also locate the docbook dependency and inspect its version... -->
+ <docbookVersion>1.72.0</docbookVersion>
+ <transformerParameters>
+ <property>
+ <name>javax.xml.parsers.DocumentBuilderFactory</name>
+ <value>org.apache.xerces.jaxp.DocumentBuilderFactoryImpl</value>
+ </property>
+ <property>
+ <name>javax.xml.parsers.SAXParserFactory</name>
+ <value>org.apache.xerces.jaxp.SAXParserFactoryImpl</value>
+ </property>
+ </transformerParameters>
+ </options>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.0.2</version>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
15 years
JBoss Rich Faces SVN: r16345 - branches/community/3.3.X/samples/richfaces-demo/src/main/webapp/richfaces/calendar/examples.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-01-20 10:10:34 -0500 (Wed, 20 Jan 2010)
New Revision: 16345
Modified:
branches/community/3.3.X/samples/richfaces-demo/src/main/webapp/richfaces/calendar/examples/organiser.xhtml
Log:
https://jira.jboss.org/jira/browse/RF-8195
Modified: branches/community/3.3.X/samples/richfaces-demo/src/main/webapp/richfaces/calendar/examples/organiser.xhtml
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/src/main/webapp/richfaces/calendar/examples/organiser.xhtml 2010-01-20 14:52:59 UTC (rev 16344)
+++ branches/community/3.3.X/samples/richfaces-demo/src/main/webapp/richfaces/calendar/examples/organiser.xhtml 2010-01-20 15:10:34 UTC (rev 16345)
@@ -33,9 +33,16 @@
</h:panelGroup>
</f:facet>
<a4j:outputPanel layout="block" id="cell" onclick="#{rich:component('organizer')}.resetSelectedDate()" style="height: 100%;" styleClass="organizer-cell">
- <h:outputText value="{day}" style="align:center"/><br />
- <h:outputText value="{data.shortDescription.escapeHTML()}" /><br />
- <h:outputText value="{data.description.escapeHTML()}"/>
+ <div>
+ <h:outputText value="{day}" style="align:center"/>
+ </div>
+ <div> </div>
+ <div>
+ <h:outputText value="{data.shortDescription.escapeHTML()}" />
+ </div>
+ <div>
+ <h:outputText value="{data.description.escapeHTML()}"/>
+ </div>
</a4j:outputPanel>
</rich:calendar>
</h:form>
15 years
JBoss Rich Faces SVN: r16344 - in root/cdk/trunk/plugins: generator/src/main/java/org/richfaces/cdk and 7 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-01-20 09:52:59 -0500 (Wed, 20 Jan 2010)
New Revision: 16344
Added:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/ModelElementBaseTemplateModel.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ConverterClassGenerator.java
root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/converter.ftl
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/AbstractClassGeneratorTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/ConverterClassGeneratorTest.java
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/generate/java/GeneratedConverterClass.java
Removed:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/ComponentTemplateModel.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/ValidatorTemplateModel.java
Modified:
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfConverter.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardOutputs.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ConverterProcessor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/LibraryModelWrapper.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentModel.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ConverterModel.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelElementBase.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ValidatorModel.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Visitable.java
root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/component.ftl
root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/validator.ftl
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/ComponentClassGeneratorTest.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/ValidatorClassGeneratorTest.java
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/generate/java/GeneratedClass.java
root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/generate/java/UIBar.java
Log:
https://jira.jboss.org/jira/browse/RF-8232
Tags support - converter class generator
Modified: root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfConverter.java
===================================================================
--- root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfConverter.java 2010-01-20 14:39:07 UTC (rev 16343)
+++ root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/JsfConverter.java 2010-01-20 14:52:59 UTC (rev 16344)
@@ -46,4 +46,5 @@
public Class<?> forClass() default Object.class;
+ public String converterClass() default "";
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardOutputs.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardOutputs.java 2010-01-20 14:39:07 UTC (rev 16343)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/StandardOutputs.java 2010-01-20 14:52:59 UTC (rev 16344)
@@ -35,6 +35,7 @@
public enum StandardOutputs implements OutputType {
COMPONENT_CLASSES(StandardOutputFolders.JAVA_CLASSES),
VALIDATOR_CLASSES(StandardOutputFolders.JAVA_CLASSES),
+ CONVERTER_CLASSES(StandardOutputFolders.JAVA_CLASSES),
RENDERER_CLASSES(StandardOutputFolders.JAVA_CLASSES),
EVENT_LISTENER_CLASSES(StandardOutputFolders.JAVA_CLASSES),
EVENT_SOURCE_CLASSES(StandardOutputFolders.JAVA_CLASSES),
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ConverterProcessor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ConverterProcessor.java 2010-01-20 14:39:07 UTC (rev 16343)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ConverterProcessor.java 2010-01-20 14:52:59 UTC (rev 16344)
@@ -28,6 +28,7 @@
import javax.annotation.processing.SupportedAnnotationTypes;
import javax.lang.model.element.TypeElement;
+import javax.lang.model.element.Modifier;
import javax.lang.model.type.MirroredTypeException;
import java.lang.annotation.Annotation;
@@ -50,9 +51,9 @@
} catch (MirroredTypeException e) {
converterModel.setConverterForClass(new ClassDescription(e.getTypeMirror().toString()));
}
- converterModel.setConverterClass(new ClassDescription(element.getQualifiedName().toString()));
setDescription(element, converterModel);
+ setClassNames(element, converterModel, converter);
getLibrary().getConverters().add(converterModel);
}
@@ -62,4 +63,23 @@
return JsfConverter.class;
}
+ // TODO same method in the ValidatorProcessor move their in one class
+ public static void setClassNames(TypeElement componentElement, ConverterModel converterModel, JsfConverter converter) {
+ String baseClass = componentElement.getQualifiedName().toString();
+ if (converter == null) {
+ converterModel.setClassNames(baseClass, null);
+ return;
+ }
+
+ String validatorClass = converter.converterClass();
+ if (validatorClass == null || validatorClass.isEmpty() || baseClass.equals(validatorClass)) {
+ if (componentElement.getModifiers().contains(Modifier.ABSTRACT)) {
+ throw new IllegalStateException("You can't use an abstract class as a validator. Please set the validatorClass or remove the 'abstract' modifier.");
+ } else {
+ converterModel.setClassNames(baseClass, null);
+ }
+ } else {
+ converterModel.setClassNames(validatorClass, baseClass);
+ }
+ }
}
Deleted: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/ComponentTemplateModel.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/ComponentTemplateModel.java 2010-01-20 14:39:07 UTC (rev 16343)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/ComponentTemplateModel.java 2010-01-20 14:52:59 UTC (rev 16344)
@@ -1,136 +0,0 @@
-/*
- * $Id$
- *
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-
-
-package org.richfaces.cdk.freemarker;
-
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.NoSuchElementException;
-import java.util.Set;
-
-import org.richfaces.cdk.model.ComponentModel;
-import org.richfaces.cdk.model.EventName;
-import org.richfaces.cdk.model.Property;
-
-import com.google.common.base.Predicate;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Sets;
-
-import freemarker.ext.beans.BeanModel;
-import freemarker.ext.beans.BeansWrapper;
-import freemarker.template.TemplateModel;
-import freemarker.template.TemplateModelException;
-
-/**
- * <p class="changed_added_4_0">
- * </p>
- *
- * @author asmirnov(a)exadel.com
- *
- */
-public class ComponentTemplateModel extends BeanModel implements TemplateModel {
- private final ComponentModel component;
- private Set<EventName> eventNames;
-
- /**
- * <p class="changed_added_4_0">
- * </p>
- *
- * @param object
- * @param wrapper
- */
- public ComponentTemplateModel(ComponentModel object, BeansWrapper wrapper) {
- super(object, wrapper);
- component = object;
- }
-
- @Override
- public TemplateModel get(String key) throws TemplateModelException {
- if ("attributes".equals(key)) {
- return attributes();
- } else if ("generatedAttributes".equals(key)) {
- return generatedAttributes();
- } else if ("eventNames".equals(key)) {
- return eventNames();
- } else if ("defaultEvent".equals(key)) {
- return defaultEvent();
- }
-
- return super.get(key);
- }
-
- private TemplateModel eventNames() throws TemplateModelException {
- Set<EventName> eventNames = getEventNames();
-
- return wrapper.wrap(eventNames);
- }
-
- private TemplateModel defaultEvent() throws TemplateModelException {
- Set<EventName> names = getEventNames();
-
- try {
- EventName defaultEvent = Iterables.find(names, new Predicate<EventName>() {
- @Override
- public boolean apply(EventName event) {
- return event.isDefaultEvent();
- }
- });
-
- return wrapper.wrap(defaultEvent);
- } catch (NoSuchElementException e) {
- return wrapper.wrap(null);
- }
- }
-
- private Set<EventName> getEventNames() {
- if (null == eventNames) {
- eventNames = Sets.newHashSet();
-
- for (Property property : component.getAttributes().values()) {
- eventNames.addAll(property.getEventNames());
- }
- }
-
- return eventNames;
- }
-
- private TemplateModel generatedAttributes() throws TemplateModelException {
- ArrayList<PropertyModel> models = new ArrayList<PropertyModel>();
- for (Map.Entry<String, Property> entry : component.getAttributes().entrySet()) {
- if(entry.getValue().isGenerate()){
- models.add(new PropertyModel(entry.getKey(), entry.getValue(), wrapper));
- }
- }
- return wrapper.wrap(models);
- }
- private TemplateModel attributes() throws TemplateModelException {
- ArrayList<PropertyModel> models = new ArrayList<PropertyModel>();
- for (Map.Entry<String, Property> entry : component.getAttributes().entrySet()) {
- models.add(new PropertyModel(entry.getKey(), entry.getValue(), wrapper));
- }
- return wrapper.wrap(models);
- }
-
-}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/LibraryModelWrapper.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/LibraryModelWrapper.java 2010-01-20 14:39:07 UTC (rev 16343)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/LibraryModelWrapper.java 2010-01-20 14:52:59 UTC (rev 16344)
@@ -25,13 +25,11 @@
package org.richfaces.cdk.freemarker;
-import org.richfaces.cdk.model.ComponentModel;
-import org.richfaces.cdk.model.ValidatorModel;
-
import freemarker.ext.beans.BeansWrapper;
import freemarker.template.ObjectWrapper;
import freemarker.template.TemplateModel;
import freemarker.template.TemplateModelException;
+import org.richfaces.cdk.model.ModelElementBase;
/**
* <p class="changed_added_4_0"></p>
@@ -50,18 +48,11 @@
@Override
public TemplateModel wrap(Object obj) throws TemplateModelException {
-
// TODO wrap specified model classes.
- TemplateModel templateModel;
-
- if (obj instanceof ComponentModel) {
- templateModel = new ComponentTemplateModel((ComponentModel) obj, this);
- } else if (obj instanceof ValidatorModel) {
- templateModel = new ValidatorTemplateModel((ValidatorModel) obj, this);
- } else {
- templateModel = super.wrap(obj);
+ if (obj instanceof ModelElementBase) {
+ return new ModelElementBaseTemplateModel((ModelElementBase) obj, this);
}
- return templateModel;
+ return super.wrap(obj);
}
}
Copied: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/ModelElementBaseTemplateModel.java (from rev 16329, root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/ComponentTemplateModel.java)
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/ModelElementBaseTemplateModel.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/ModelElementBaseTemplateModel.java 2010-01-20 14:52:59 UTC (rev 16344)
@@ -0,0 +1,135 @@
+/*
+ * $Id$
+ *
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+
+package org.richfaces.cdk.freemarker;
+
+import com.google.common.base.Predicate;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Sets;
+import freemarker.ext.beans.BeanModel;
+import freemarker.ext.beans.BeansWrapper;
+import freemarker.template.TemplateModel;
+import freemarker.template.TemplateModelException;
+import org.richfaces.cdk.model.EventName;
+import org.richfaces.cdk.model.ModelElementBase;
+import org.richfaces.cdk.model.Property;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Map;
+import java.util.NoSuchElementException;
+import java.util.Set;
+
+/**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public class ModelElementBaseTemplateModel extends BeanModel implements TemplateModel {
+ private final ModelElementBase model;
+ private Set<EventName> eventNames;
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param object
+ * @param wrapper
+ */
+ public ModelElementBaseTemplateModel(ModelElementBase object, BeansWrapper wrapper) {
+ super(object, wrapper);
+ model = object;
+ }
+
+ @Override
+ public TemplateModel get(String key) throws TemplateModelException {
+ if ("attributes".equals(key)) {
+ return attributes();
+ } else if ("generatedAttributes".equals(key)) {
+ return generatedAttributes();
+ } else if ("eventNames".equals(key)) {
+ return eventNames();
+ } else if ("defaultEvent".equals(key)) {
+ return defaultEvent();
+ }
+
+ return super.get(key);
+ }
+
+ private TemplateModel eventNames() throws TemplateModelException {
+ return wrapper.wrap(getEventNames());
+ }
+
+ private TemplateModel defaultEvent() throws TemplateModelException {
+ Set<EventName> names = getEventNames();
+
+ try {
+ EventName defaultEvent = Iterables.find(names, new Predicate<EventName>() {
+ @Override
+ public boolean apply(EventName event) {
+ return event.isDefaultEvent();
+ }
+ });
+
+ return wrapper.wrap(defaultEvent);
+ } catch (NoSuchElementException e) {
+ return wrapper.wrap(null);
+ }
+ }
+
+ private Set<EventName> getEventNames() {
+ if (null == eventNames) {
+ eventNames = Sets.newHashSet();
+
+ for (Property property : model.getAttributes().values()) {
+ eventNames.addAll(property.getEventNames());
+ }
+ }
+
+ return eventNames;
+ }
+
+ private TemplateModel generatedAttributes() throws TemplateModelException {
+ Map<String, Property> attributes = model.getAttributes();
+ Collection<PropertyModel> models = new ArrayList<PropertyModel>(attributes.size());
+ for (Map.Entry<String, Property> entry : attributes.entrySet()) {
+ if (entry.getValue().isGenerate()) {
+ models.add(new PropertyModel(entry.getKey(), entry.getValue(), wrapper));
+ }
+ }
+ return wrapper.wrap(models);
+ }
+ private TemplateModel attributes() throws TemplateModelException {
+ Map<String, Property> attributes = model.getAttributes();
+ Collection<PropertyModel> models = new ArrayList<PropertyModel>(attributes.size());
+ for (Map.Entry<String, Property> entry : attributes.entrySet()) {
+ models.add(new PropertyModel(entry.getKey(), entry.getValue(), wrapper));
+ }
+ return wrapper.wrap(models);
+ }
+
+}
Property changes on: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/ModelElementBaseTemplateModel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/ValidatorTemplateModel.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/ValidatorTemplateModel.java 2010-01-20 14:39:07 UTC (rev 16343)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/freemarker/ValidatorTemplateModel.java 2010-01-20 14:52:59 UTC (rev 16344)
@@ -1,130 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright , Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.richfaces.cdk.freemarker;
-
-import freemarker.ext.beans.BeanModel;
-import freemarker.ext.beans.BeansWrapper;
-import freemarker.template.TemplateModel;
-import freemarker.template.TemplateModelException;
-import org.richfaces.cdk.model.EventName;
-import org.richfaces.cdk.model.Property;
-import org.richfaces.cdk.model.ValidatorModel;
-
-import java.util.Set;
-import java.util.NoSuchElementException;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.List;
-
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Sets;
-import com.google.common.base.Predicate;
-
-/**
- * @author akolonitsky
- * @since Jan 18, 2010
- */
-public class ValidatorTemplateModel extends BeanModel implements TemplateModel {
- private final ValidatorModel component;
- private Set<EventName> eventNames;
-
- /**
- * <p class="changed_added_4_0">
- * </p>
- *
- * @param object
- * @param wrapper
- */
- public ValidatorTemplateModel(ValidatorModel object, BeansWrapper wrapper) {
- super(object, wrapper);
- component = object;
- }
-
- @Override
- public TemplateModel get(String key) throws TemplateModelException {
- if ("attributes".equals(key)) {
- return attributes();
- } else if ("generatedAttributes".equals(key)) {
- return generatedAttributes();
- } else if ("eventNames".equals(key)) {
- return eventNames();
- } else if ("defaultEvent".equals(key)) {
- return defaultEvent();
- }
-
- return super.get(key);
- }
-
- private TemplateModel eventNames() throws TemplateModelException {
- Set<EventName> eventNames = getEventNames();
-
- return wrapper.wrap(eventNames);
- }
-
- private TemplateModel defaultEvent() throws TemplateModelException {
- Set<EventName> names = getEventNames();
-
- try {
- EventName defaultEvent = Iterables.find(names, new Predicate<EventName>() {
- @Override
- public boolean apply(EventName event) {
- return event.isDefaultEvent();
- }
- });
-
- return wrapper.wrap(defaultEvent);
- } catch (NoSuchElementException e) {
- return wrapper.wrap(null);
- }
- }
-
- private Set<EventName> getEventNames() {
- if (null == eventNames) {
- eventNames = Sets.newHashSet();
-
- for (Property property : component.getAttributes().values()) {
- eventNames.addAll(property.getEventNames());
- }
- }
-
- return eventNames;
- }
-
- private TemplateModel generatedAttributes() throws TemplateModelException {
- List<PropertyModel> models = new ArrayList<PropertyModel>(component.getAttributes().size());
- for (Map.Entry<String, Property> entry : component.getAttributes().entrySet()) {
- if(entry.getValue().isGenerate()){
- models.add(new PropertyModel(entry.getKey(), entry.getValue(), wrapper));
- }
- }
- return wrapper.wrap(models);
- }
- private TemplateModel attributes() throws TemplateModelException {
- List<PropertyModel> models = new ArrayList<PropertyModel>(component.getAttributes().size());
- for (Map.Entry<String, Property> entry : component.getAttributes().entrySet()) {
- models.add(new PropertyModel(entry.getKey(), entry.getValue(), wrapper));
- }
- return wrapper.wrap(models);
- }
-
-}
Added: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ConverterClassGenerator.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ConverterClassGenerator.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/generate/java/ConverterClassGenerator.java 2010-01-20 14:52:59 UTC (rev 16344)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright , Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.richfaces.cdk.generate.java;
+
+import org.richfaces.cdk.CdkContext;
+import org.richfaces.cdk.CdkException;
+import org.richfaces.cdk.CdkWriter;
+import org.richfaces.cdk.StandardOutputs;
+import org.richfaces.cdk.freemarker.FreeMarkerRenderer;
+import org.richfaces.cdk.model.ComponentLibrary;
+import org.richfaces.cdk.model.ConverterModel;
+import org.richfaces.cdk.model.Visitable;
+
+import java.io.File;
+
+/**
+ * @author akolonitsky
+ * @since Jan 20, 2010
+ */
+public class ConverterClassGenerator extends FreeMarkerRenderer<ConverterModel, ComponentLibrary> implements CdkWriter {
+ @Override
+ public void init(CdkContext context) {
+ super.init(context);
+ }
+
+ @Override
+ protected boolean isMyComponent(Visitable visitable) {
+ if (visitable instanceof ConverterModel) {
+ return ((ConverterModel) visitable).isGenerate();
+ }
+
+ return false;
+ }
+
+ @Override
+ protected String getOutputFile(ConverterModel converter) throws CdkException {
+ return converter.getConverterClass().getName().replace('.', File.separatorChar) + ".java";
+ }
+
+ @Override
+ protected String getTemplateName() {
+ return "converter.ftl";
+ }
+
+ @Override
+ protected CdkContext.OutputType getOutputType() {
+ return StandardOutputs.CONVERTER_CLASSES;
+ }
+}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentModel.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentModel.java 2010-01-20 14:39:07 UTC (rev 16343)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentModel.java 2010-01-20 14:52:59 UTC (rev 16344)
@@ -36,13 +36,6 @@
/**
* <p class="changed_added_4_0">
- * Component attributes
- * </p>
- */
- private final ModelMap<String,Property> attributes = ModelMap.<String,Property>create();
-
- /**
- * <p class="changed_added_4_0">
* Renderer for the final component. This is bidirectional many to many
* relation.
* </p>
@@ -87,7 +80,7 @@
@Override
public void merge(ComponentModel otherComponent) {
//merge facets, renderers, events ...
- attributes.putAll(otherComponent.getAttributes());
+ getAttributes().putAll(otherComponent.getAttributes());
facets.putAll(otherComponent.getFacets());
ComponentLibrary.merge(events, otherComponent.getEvents());
ComponentLibrary.merge(renderers, otherComponent.getRenderers());
@@ -202,27 +195,6 @@
}
/**
- * <p class="changed_added_4_0">
- * Represents JSF component attributes and properties.
- * </p>
- *
- * @return the attributes
- */
- public Map<String,Property> getAttributes() {
- return attributes;
- }
-
- public Property addAttribute(String attributeName) {
- Property attribute = attributes.get(attributeName);
- if(null == attribute){
- attribute = new Property();
- attributes.put(attributeName, attribute);
- }
-
- return attribute;
- }
-
- /**
* <p class="changed_added_4_0"></p>
* @return the facets
*/
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ConverterModel.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ConverterModel.java 2010-01-20 14:39:07 UTC (rev 16343)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ConverterModel.java 2010-01-20 14:52:59 UTC (rev 16344)
@@ -25,8 +25,6 @@
import org.richfaces.cdk.CdkException;
-import java.util.Map;
-
/**
* <p class="changed_added_4_0"></p>
* @author asmirnov(a)exadel.com
@@ -36,14 +34,16 @@
private static final long serialVersionUID = -6238591637703737886L;
+ private boolean generate = false;
+
private String converterId;
private ClassDescription converterClass;
+ private ClassDescription baseClass;
+
private ClassDescription converterForClass;
- private final ModelMap<String,Property> attributes = ModelMap.<String,Property>create();
-
public ConverterModel() {
}
@@ -52,6 +52,14 @@
this.converterClass = converterClass;
}
+ public boolean isGenerate() {
+ return generate;
+ }
+
+ public void setGenerate(boolean generate) {
+ this.generate = generate;
+ }
+
public String getConverterId() {
return converterId;
}
@@ -78,26 +86,23 @@
this.converterClass = converterClass;
}
+ public ClassDescription getBaseClass() {
+ return baseClass;
+ }
- /**
- * <p class="changed_added_4_0">
- * Represents JSF component attributes and properties.
- * </p>
- *
- * @return the attributes
- */
- public Map<String,Property> getAttributes() {
- return attributes;
+ public void setBaseClass(ClassDescription baseClass) {
+ this.baseClass = baseClass;
}
- public Property addAttribute(String attributeName) {
- Property attribute = attributes.get(attributeName);
- if (null == attribute) {
- attribute = new Property();
- attributes.put(attributeName, attribute);
+ public void setClassNames(String converterClass, String baseClass) {
+ this.converterClass = new ClassDescription(converterClass);
+
+ if (baseClass != null) {
+ this.baseClass = new ClassDescription(baseClass);
+ this.generate = true;
+ } else {
+ this.generate = false;
}
-
- return attribute;
}
@Override
@@ -109,7 +114,7 @@
public void merge(ConverterModel other) {
ComponentLibrary.merge(this, other);
- attributes.putAll(other.getAttributes());
+ getAttributes().putAll(other.getAttributes());
}
@Override
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelElementBase.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelElementBase.java 2010-01-20 14:39:07 UTC (rev 16343)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ModelElementBase.java 2010-01-20 14:52:59 UTC (rev 16344)
@@ -1,5 +1,7 @@
package org.richfaces.cdk.model;
+import java.util.Map;
+
/**
* <p class="changed_added_4_0">Base class for the most JSF components taht have description
* attributes and support extensions in faces-config.</p>
@@ -30,6 +32,8 @@
*/
private Icon icon;
+ private final ModelMap<String,Property> attributes = ModelMap.<String,Property>create();
+
public ModelElementBase() {
super();
}
@@ -59,6 +63,28 @@
}
/**
+ * <p class="changed_added_4_0">
+ * Represents JSF component attributes and properties.
+ * </p>
+ *
+ * @return the attributes
+ */
+ public Map<String,Property> getAttributes() {
+ return attributes;
+ }
+
+ public Property addAttribute(String attributeName) {
+ Property attribute = attributes.get(attributeName);
+ if (null == attribute) {
+ attribute = new Property();
+ attributes.put(attributeName, attribute);
+ }
+
+ return attribute;
+ }
+
+
+ /**
* <p class="changed_added_4_0"></p>
*
* @return the extension
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ValidatorModel.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ValidatorModel.java 2010-01-20 14:39:07 UTC (rev 16343)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ValidatorModel.java 2010-01-20 14:52:59 UTC (rev 16344)
@@ -25,8 +25,6 @@
import org.richfaces.cdk.CdkException;
-import java.util.Map;
-
/**
* <p class="changed_added_4_0"></p>
* @author asmirnov(a)exadel.com
@@ -43,8 +41,6 @@
private ClassDescription baseClass;
- private final ModelMap<String,Property> attributes = ModelMap.<String,Property>create();
-
public ValidatorModel() {
}
@@ -97,23 +93,6 @@
}
}
- public Map<String,Property> getAttributes() {
- return attributes;
- }
-
- public Property addAttribute(String attributeName) {
- Property attribute;
-
- attribute = attributes.get(attributeName);
- if(null == attribute){
- attribute = new Property();
- attributes.put(attributeName, attribute);
- }
-
- return attribute;
- }
-
-
@Override
public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws CdkException {
return visitor.visit(this, param);
@@ -123,7 +102,7 @@
public void merge(ValidatorModel other) {
ComponentLibrary.merge(this, other);
- attributes.putAll(other.getAttributes());
+ getAttributes().putAll(other.getAttributes());
}
@Override
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Visitable.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Visitable.java 2010-01-20 14:39:07 UTC (rev 16343)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Visitable.java 2010-01-20 14:52:59 UTC (rev 16344)
@@ -11,6 +11,9 @@
* @param <P>
* @param visitor
* @param param
+ *
+ * @throws org.richfaces.cdk.CdkException
+ *
* @return
*/
public <R, P> R accept(LibraryVisitor<R, P> visitor, P param) throws CdkException;
Modified: root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/component.ftl
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/component.ftl 2010-01-20 14:39:07 UTC (rev 16343)
+++ root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/component.ftl 2010-01-20 14:52:59 UTC (rev 16344)
@@ -4,8 +4,6 @@
</#list>
</#macro>
/*
- * $Id$
- *
* License Agreement.
*
* Rich Faces - Natural Ajax for Java Server Faces (JSF)
Added: root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/converter.ftl
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/converter.ftl (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/converter.ftl 2010-01-20 14:52:59 UTC (rev 16344)
@@ -0,0 +1,136 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright , Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package ${converterClass.package};
+
+import javax.annotation.Generated;
+import javax.faces.component.StateHelper;
+import javax.faces.component.PartialStateHolder;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+
+/**
+ * ${description?if_exists}
+ **/
+@Generated({"RichFaces CDK", "4.0.0-SNAPSHOT"})
+public class ${converterClass.simpleName} extends ${baseClass} implements Converter, PartialStateHolder {
+
+ public Object getAsObject(FacesContext context, UIComponent component, String value) {
+ return null;
+ }
+
+ public String getAsString(FacesContext context, UIComponent component, Object value) {
+ return null;
+ }
+
+ protected enum Properties {
+ <#list generatedAttributes as attribute>${attribute.name}<#if attribute_has_next>${",\n "}</#if></#list>
+ }
+
+ <#list generatedAttributes as attribute>
+ /**
+ * ${attribute.description?if_exists}
+ **/
+ public ${attribute.type} ${attribute.getterName}(){
+ return (${attribute.type})getStateHelper().eval(Properties.${attribute.name});
+ }
+
+ /**
+ * Setter for ${attribute.name}
+ **/
+ public void ${attribute.setterName}(${attribute.type} ${attribute.name}){
+ getStateHelper().put(Properties.${attribute.name},${attribute.name});
+ }
+ </#list>
+
+
+
+ protected StateHelper getStateHelper() {
+ return getStateHelper(true);
+ }
+
+ protected StateHelper getStateHelper(boolean create) {
+ return null;
+ }
+
+ // ----------------------------------------------------- StateHolder Methods
+ @Override
+ public Object saveState(FacesContext context) {
+ if (context == null) {
+ throw new NullPointerException();
+ }
+ if (!initialStateMarked()) {
+ Object values[] = new Object[1];
+ <#list generatedAttributes as attribute>
+ values[${attribute_index}] = this.${attribute.getterName}();
+ </#list>
+
+ return values;
+ }
+ return null;
+ }
+
+ @Override
+ public void restoreState(FacesContext context, Object state) {
+ if (context == null) {
+ throw new NullPointerException();
+ }
+ if (state == null) {
+ return;
+ }
+
+ Object values[] = (Object[]) state;
+ <#list generatedAttributes as attribute>
+ ${attribute.setterName}((${attribute.type}) values[${attribute_index}]);
+ </#list>
+ }
+
+ private boolean transientValue = false;
+
+ @Override
+ public boolean isTransient() {
+ return this.transientValue;
+ }
+
+ @Override
+ public void setTransient(boolean transientValue) {
+ this.transientValue = transientValue;
+ }
+
+
+ private boolean initialState;
+
+ @Override
+ public void markInitialState() {
+ initialState = true;
+ }
+
+ @Override
+ public boolean initialStateMarked() {
+ return initialState;
+ }
+
+ @Override
+ public void clearInitialState() {
+ initialState = false;
+ }
+}
\ No newline at end of file
Modified: root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/validator.ftl
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/validator.ftl 2010-01-20 14:39:07 UTC (rev 16343)
+++ root/cdk/trunk/plugins/generator/src/main/resources/META-INF/templates/validator.ftl 2010-01-20 14:52:59 UTC (rev 16344)
@@ -1,6 +1,4 @@
/*
- * $Id: component.ftl 16229 2009-12-29 21:36:27Z alexsmirnov $
- *
* JBoss, Home of Professional Open Source
* Copyright , Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
Added: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/AbstractClassGeneratorTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/AbstractClassGeneratorTest.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/AbstractClassGeneratorTest.java 2010-01-20 14:52:59 UTC (rev 16344)
@@ -0,0 +1,107 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright , Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.richfaces.cdk.generate.java;
+
+import static org.easymock.EasyMock.anyObject;
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import org.junit.Assert;
+import org.richfaces.cdk.CdkContext;
+import org.richfaces.cdk.CdkTestBase;
+import org.richfaces.cdk.StandardSources;
+import org.richfaces.cdk.model.ClassDescription;
+import org.richfaces.cdk.model.EventName;
+import org.richfaces.cdk.model.ModelElementBase;
+import org.richfaces.cdk.model.Property;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.LineNumberReader;
+import java.io.Reader;
+import java.io.StringReader;
+import java.io.StringWriter;
+
+/**
+ * @author akolonitsky
+ * @since Jan 20, 2010
+ */
+public abstract class AbstractClassGeneratorTest extends CdkTestBase {
+ protected CdkContext createMockContext() throws Exception {
+ CdkContext cdkContext = createMock(CdkContext.class);
+
+ expect(cdkContext.getSourceFolders(StandardSources.JAVA_SOURCES)).andStubReturn(testSourceDirectory);
+ expect(cdkContext.getOutputFolder((org.richfaces.cdk.CdkContext.OutputType) anyObject())).andStubReturn(null);
+ expect(cdkContext.getLoader()).andStubReturn(createClassLoader());
+ replay(cdkContext);
+
+ return cdkContext;
+ }
+
+
+ protected static Property addAttribute(ModelElementBase model, String attributeName, Class<?> type, boolean generate) {
+ Property attribute = model.addAttribute(attributeName);
+ attribute.setType(new ClassDescription(type));
+ attribute.setGenerate(generate);
+ return attribute;
+ }
+
+ protected static EventName getEvent(String name, boolean defaultEvent) {
+ EventName event = new EventName();
+ event.setName(name);
+ event.setDefaultEvent(defaultEvent);
+ return event;
+ }
+
+ protected void compare(StringWriter writer, String fileName) throws IOException {
+ InputStream expectedFacesConfigFile = this.getClass().getResourceAsStream(fileName);
+ Assert.assertNotNull("File ("+fileName+") with expected result wasn't found.", expectedFacesConfigFile);
+
+ compareTextFiles(
+ new StringReader(writer.toString()),
+ new InputStreamReader(expectedFacesConfigFile));
+ }
+
+ protected static void compareTextFiles(Reader reference, Reader output) throws IOException {
+ LineNumberReader ref = new LineNumberReader(reference);
+ LineNumberReader out = new LineNumberReader(output);
+ String refLine = "", outLine = "";
+ while (refLine != null || outLine != null) {
+ if (refLine == null) {
+ Assert.fail("Output text is longer than reference text");
+ }
+ if (outLine == null) {
+ Assert.fail("Output text is shorter than reference text");
+ }
+
+ refLine = ref.readLine();
+ outLine = out.readLine();
+
+ if (refLine != null && outLine != null && !refLine.trim().equals(outLine.trim())) {
+ Assert.fail("Difference found on line " + ref.getLineNumber()
+ + ".\nReference text is: " + refLine + "\nOutput text is: " + outLine);
+ }
+ }
+ }
+}
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/ComponentClassGeneratorTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/ComponentClassGeneratorTest.java 2010-01-20 14:39:07 UTC (rev 16343)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/ComponentClassGeneratorTest.java 2010-01-20 14:52:59 UTC (rev 16344)
@@ -29,36 +29,25 @@
import java.io.StringWriter;
import java.io.Writer;
-import java.io.Reader;
-import java.io.LineNumberReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.StringReader;
-import java.io.InputStreamReader;
import java.util.Set;
import javax.faces.component.UIOutput;
import org.junit.Test;
-import org.junit.Assert;
import org.richfaces.cdk.CdkContext;
import org.richfaces.cdk.CdkException;
-import org.richfaces.cdk.CdkTestBase;
-import org.richfaces.cdk.StandardSources;
import org.richfaces.cdk.model.ClassDescription;
import org.richfaces.cdk.model.ComponentModel;
import org.richfaces.cdk.model.ComponentLibrary;
import org.richfaces.cdk.model.EventName;
import org.richfaces.cdk.model.Property;
-import org.xml.sax.SAXException;
-import org.custommonkey.xmlunit.Diff;
/**
* <p class="changed_added_4_0"></p>
* @author asmirnov(a)exadel.com
*
*/
-public class ComponentClassGeneratorTest extends CdkTestBase {
+public class ComponentClassGeneratorTest extends AbstractClassGeneratorTest {
/**
* Test method for {@link org.richfaces.cdk.generate.java.ComponentClassGenerator#getOutputFile(org.richfaces.cdk.model.ComponentModel)}.
@@ -95,14 +84,9 @@
attribute.setType(new ClassDescription(String.class));
Set<EventName> eventNames = attribute.getEventNames();
- EventName event = new EventName();
+ eventNames.add(getEvent("id", false));
+ eventNames.add(getEvent("action", true));
- event.setName("id");
- eventNames.add(event);
- event = new EventName();
- event.setName("action");
- event.setDefaultEvent(true);
- eventNames.add(event);
attribute.setGenerate(false);
generator.visit(component, library);
System.out.println(output);
@@ -110,46 +94,4 @@
compare(output, "UIBar.java");
}
-
- private CdkContext createMockContext() throws Exception {
- CdkContext cdkContext = createMock(CdkContext.class);
-
- expect(cdkContext.getSourceFolders(StandardSources.JAVA_SOURCES)).andStubReturn(testSourceDirectory);
- expect(cdkContext.getOutputFolder((org.richfaces.cdk.CdkContext.OutputType) anyObject())).andStubReturn(null);
- expect(cdkContext.getLoader()).andStubReturn(createClassLoader());
- replay(cdkContext);
-
- return cdkContext;
- }
-
- private void compare(StringWriter writer, String fileName) throws IOException {
- InputStream expectedFacesConfigFile = this.getClass().getResourceAsStream(fileName);
- Assert.assertNotNull("File ("+fileName+") with expected result wasn't found.", expectedFacesConfigFile);
-
- compareTextFiles(
- new StringReader(writer.toString()),
- new InputStreamReader(expectedFacesConfigFile));
- }
-
- public static void compareTextFiles(Reader reference, Reader output) throws IOException {
- LineNumberReader ref = new LineNumberReader(reference);
- LineNumberReader out = new LineNumberReader(output);
- String refLine = "", outLine = "";
- while (refLine != null || outLine != null) {
- if (refLine == null) {
- Assert.fail("Output text is longer than reference text");
- }
- if (outLine == null) {
- Assert.fail("Output text is shorter than reference text");
- }
-
- refLine = ref.readLine();
- outLine = out.readLine();
-
- if (refLine != null && outLine != null && !refLine.trim().equals(outLine.trim())) {
- Assert.fail("Difference found on line " + ref.getLineNumber()
- + ".\nReference text is: " + refLine + "\nOutput text is: " + outLine);
- }
- }
- }
}
Added: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/ConverterClassGeneratorTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/ConverterClassGeneratorTest.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/ConverterClassGeneratorTest.java 2010-01-20 14:52:59 UTC (rev 16344)
@@ -0,0 +1,86 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright , Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.richfaces.cdk.generate.java;
+
+import static org.easymock.EasyMock.verify;
+import org.junit.Test;
+import org.richfaces.cdk.CdkContext;
+import org.richfaces.cdk.CdkException;
+import org.richfaces.cdk.model.ClassDescription;
+import org.richfaces.cdk.model.ComponentLibrary;
+import org.richfaces.cdk.model.ConverterModel;
+import org.richfaces.cdk.model.EventName;
+import org.richfaces.cdk.model.Property;
+import org.richfaces.cdk.model.ValidatorModel;
+
+import java.io.StringWriter;
+import java.io.Writer;
+import java.util.Set;
+
+/**
+ * @author akolonitsky
+ * @since Jan 20, 2010
+ */
+public class ConverterClassGeneratorTest extends AbstractClassGeneratorTest {
+
+ /**
+ * Test method for {@link org.richfaces.cdk.generate.java.ComponentClassGenerator#getOutputFile(org.richfaces.cdk.model.ComponentModel)}.
+ * @throws Exception
+ */
+ @Test
+ public void testGetOutputFileValidator() throws Exception {
+ final StringWriter output = new StringWriter();
+ ConverterClassGenerator generator = new ConverterClassGenerator() {
+ @Override
+ protected Writer getOutput(ConverterModel c) throws CdkException {
+ return output;
+ }
+ };
+ CdkContext mockContext = createMockContext();
+
+ generator.init(mockContext);
+
+ ConverterModel converter = new ConverterModel();
+ converter.setConverterId("foo.bar");
+ converter.setClassNames("org.richfaces.cdk.generate.java.GeneratedConverterClass", "Object");
+
+ addAttribute(converter, "testValue", Object.class, true);
+ // TODO test with primitiv type 'boolean'
+ addAttribute(converter, "testFlag", Boolean.class, true);
+ Property attribute = addAttribute(converter, "id", String.class, false);
+
+ Set<EventName> eventNames = attribute.getEventNames();
+ eventNames.add(getEvent("id", false));
+ eventNames.add(getEvent("action", true));
+
+ ComponentLibrary library = new ComponentLibrary();
+ library.getConverters().add(converter);
+ generator.visit(converter, library);
+
+ System.out.println(output);
+
+ verify(mockContext);
+
+ // TODO - check generated file.
+ }
+}
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/ValidatorClassGeneratorTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/ValidatorClassGeneratorTest.java 2010-01-20 14:39:07 UTC (rev 16343)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/generate/java/ValidatorClassGeneratorTest.java 2010-01-20 14:52:59 UTC (rev 16344)
@@ -22,7 +22,6 @@
package org.richfaces.cdk.generate.java;
-import org.richfaces.cdk.CdkTestBase;
import org.richfaces.cdk.CdkException;
import org.richfaces.cdk.CdkContext;
import org.richfaces.cdk.StandardSources;
@@ -38,7 +37,6 @@
import static org.easymock.EasyMock.anyObject;
import static org.easymock.EasyMock.replay;
-import javax.faces.component.UIOutput;
import java.io.StringWriter;
import java.io.Writer;
import java.util.Set;
@@ -47,7 +45,7 @@
* @author akolonitsky
* @since Jan 15, 2010
*/
-public class ValidatorClassGeneratorTest extends CdkTestBase {
+public class ValidatorClassGeneratorTest extends AbstractClassGeneratorTest {
/**
* Test method for {@link org.richfaces.cdk.generate.java.ComponentClassGenerator#getOutputFile(org.richfaces.cdk.model.ComponentModel)}.
@@ -90,28 +88,4 @@
// TODO - check generated file.
}
- private EventName getEvent(String name, boolean defaultEvent) {
- EventName event = new EventName();
- event.setName(name);
- event.setDefaultEvent(defaultEvent);
- return event;
- }
-
- private Property addAttribute(ValidatorModel validator, String attributeName, Class<?> type, boolean generate) {
- Property attribute = validator.addAttribute(attributeName);
- attribute.setType(new ClassDescription(type));
- attribute.setGenerate(generate);
- return attribute;
- }
-
- private CdkContext createMockContext() throws Exception {
- CdkContext cdkContext = createMock(CdkContext.class);
-
- expect(cdkContext.getSourceFolders(StandardSources.JAVA_SOURCES)).andStubReturn(testSourceDirectory);
- expect(cdkContext.getOutputFolder((org.richfaces.cdk.CdkContext.OutputType) anyObject())).andStubReturn(null);
- expect(cdkContext.getLoader()).andStubReturn(createClassLoader());
- replay(cdkContext);
-
- return cdkContext;
- }
}
Modified: root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/generate/java/GeneratedClass.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/generate/java/GeneratedClass.java 2010-01-20 14:39:07 UTC (rev 16343)
+++ root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/generate/java/GeneratedClass.java 2010-01-20 14:52:59 UTC (rev 16344)
@@ -1,6 +1,4 @@
/*
- * $Id: component.ftl 16229 2009-12-29 21:36:27Z alexsmirnov $
- *
* JBoss, Home of Professional Open Source
* Copyright , Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
Added: root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/generate/java/GeneratedConverterClass.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/generate/java/GeneratedConverterClass.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/generate/java/GeneratedConverterClass.java 2010-01-20 14:52:59 UTC (rev 16344)
@@ -0,0 +1,145 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright , Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.cdk.generate.java;
+
+import javax.annotation.Generated;
+import javax.faces.component.StateHelper;
+import javax.faces.component.PartialStateHolder;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+
+/**
+ *
+ **/
+@Generated({"RichFaces CDK", "4.0.0-SNAPSHOT"})
+public class GeneratedConverterClass extends Object implements Converter, PartialStateHolder {
+ public Object getAsObject(FacesContext context, UIComponent component, String value) {
+ return null;
+ }
+
+ public String getAsString(FacesContext context, UIComponent component, Object value) {
+ return null;
+ }
+
+ protected enum Properties {
+ testValue,
+ testFlag
+ }
+
+ /**
+ *
+ **/
+ public java.lang.Object getTestValue(){
+ return (java.lang.Object)getStateHelper().eval(Properties.testValue);
+ }
+
+ /**
+ * Setter for testValue
+ **/
+ public void setTestValue(java.lang.Object testValue){
+ getStateHelper().put(Properties.testValue,testValue);
+ }
+ /**
+ *
+ **/
+ public java.lang.Boolean isTestFlag() {
+ return (java.lang.Boolean)getStateHelper().eval(Properties.testFlag);
+ }
+
+ /**
+ * Setter for testFlag
+ **/
+ public void setTestFlag(java.lang.Boolean testFlag){
+ getStateHelper().put(Properties.testFlag,testFlag);
+ }
+
+
+
+ protected StateHelper getStateHelper() {
+ return getStateHelper(true);
+ }
+
+ protected StateHelper getStateHelper(boolean create) {
+ return null;
+ }
+
+ // ----------------------------------------------------- StateHolder Methods
+ @Override
+ public Object saveState(FacesContext context) {
+ if (context == null) {
+ throw new NullPointerException();
+ }
+ if (!initialStateMarked()) {
+ Object values[] = new Object[1];
+ values[0] = this.getTestValue();
+ values[1] = this.isTestFlag();
+
+ return values;
+ }
+ return null;
+ }
+
+ @Override
+ public void restoreState(FacesContext context, Object state) {
+ if (context == null) {
+ throw new NullPointerException();
+ }
+ if (state == null) {
+ return;
+ }
+
+ Object values[] = (Object[]) state;
+ setTestValue((java.lang.Object) values[0]);
+ setTestFlag((java.lang.Boolean) values[1]);
+ }
+
+ private boolean transientValue = false;
+
+ @Override
+ public boolean isTransient() {
+ return this.transientValue;
+ }
+
+ @Override
+ public void setTransient(boolean transientValue) {
+ this.transientValue = transientValue;
+ }
+
+
+ private boolean initialState;
+
+ @Override
+ public void markInitialState() {
+ initialState = true;
+ }
+
+ @Override
+ public boolean initialStateMarked() {
+ return initialState;
+ }
+
+ @Override
+ public void clearInitialState() {
+ initialState = false;
+ }
+}
Modified: root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/generate/java/UIBar.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/generate/java/UIBar.java 2010-01-20 14:39:07 UTC (rev 16343)
+++ root/cdk/trunk/plugins/generator/src/test/resources/org/richfaces/cdk/generate/java/UIBar.java 2010-01-20 14:52:59 UTC (rev 16344)
@@ -1,6 +1,4 @@
/*
- * $Id: component.ftl 16229 2009-12-29 21:36:27Z alexsmirnov $
- *
* License Agreement.
*
* Rich Faces - Natural Ajax for Java Server Faces (JSF)
15 years