JBoss Rich Faces SVN: r15145 - root/framework/trunk/impl/src/main/java/org/ajax4jsf/config.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2009-08-10 08:22:54 -0400 (Mon, 10 Aug 2009)
New Revision: 15145
Modified:
root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/FrameworkConfiguration.java
Log:
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/FrameworkConfiguration.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/FrameworkConfiguration.java 2009-08-10 11:29:50 UTC (rev 15144)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/FrameworkConfiguration.java 2009-08-10 12:22:54 UTC (rev 15145)
@@ -65,7 +65,7 @@
if(isNumberValue(param, value)) {
return Integer.parseInt(value);
}
- logger.error("option value: " + param.getQualifiedName() + " is not Integer number set default value: " + param.getDefaultValue());
+ logger.error("option value: " + param.getQualifiedName() + " is not an integer number set default value: " + param.getDefaultValue());
return Integer.parseInt(param.getDefaultValue());
}
@@ -80,7 +80,7 @@
return Boolean.parseBoolean(value);
}
- logger.error("option value: " + param.getQualifiedName() + " is not boolean value set default value: " + param.getDefaultValue());
+ logger.error("option value: " + param.getQualifiedName() + " is not a boolean value set default value: " + param.getDefaultValue());
return Boolean.parseBoolean(param.getDefaultValue());
}
15 years, 5 months
JBoss Rich Faces SVN: r15144 - root/framework/trunk/impl/src/test/java/org/ajax4jsf/config.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2009-08-10 07:29:50 -0400 (Mon, 10 Aug 2009)
New Revision: 15144
Added:
root/framework/trunk/impl/src/test/java/org/ajax4jsf/config/FrameworkConfigurationTest.java
Log:
Added: root/framework/trunk/impl/src/test/java/org/ajax4jsf/config/FrameworkConfigurationTest.java
===================================================================
--- root/framework/trunk/impl/src/test/java/org/ajax4jsf/config/FrameworkConfigurationTest.java (rev 0)
+++ root/framework/trunk/impl/src/test/java/org/ajax4jsf/config/FrameworkConfigurationTest.java 2009-08-10 11:29:50 UTC (rev 15144)
@@ -0,0 +1,113 @@
+package org.ajax4jsf.config;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.faces.context.ExternalContext;
+
+import org.ajax4jsf.config.FrameworkConfiguration.InitParam;
+import org.richfaces.test.AbstractFacesTest;
+
+/**
+ * @author Anton Belevich
+ *
+ */
+public class FrameworkConfigurationTest extends AbstractFacesTest{
+
+ private MockInitializationBean mockBean;
+
+ private FrameworkConfiguration configuration;
+
+ Map <String, String> localInitParams;
+
+ Map <String, String> refenceInitParams;
+
+
+ public class MockInitializationBean {
+
+ private String styleStrategy = "ALL";
+ private boolean encryptResourceData = true;
+
+
+ public boolean getEncryptResourceData() {
+ return encryptResourceData;
+ }
+
+ public void setEncryptResourceData(boolean encryptResourceData) {
+ this.encryptResourceData = encryptResourceData;
+ }
+
+ public String getStyleStrategy() {
+ return styleStrategy;
+ }
+
+ public void setStyleStrategy(String styleStrategy) {
+ this.styleStrategy = styleStrategy;
+ }
+
+ }
+
+ public void testBooleanOption() {
+ boolean actual = configuration.isOptionEnabled(InitParam.COMPRESS_SCRIPT);
+ boolean expected = Boolean.parseBoolean(localInitParams.get(InitParam.COMPRESS_SCRIPT.name()));
+ assertEquals(expected, actual);
+ }
+
+ public void testBooleanOptionValueReference() {
+ boolean actual = configuration.isOptionEnabled(InitParam.ENCRYPT_RESOURCE_DATA);
+ boolean expected = mockBean.getEncryptResourceData();
+ assertEquals(expected, actual);
+ }
+
+ public void testNumberOption (){
+ int actual = configuration.getOptionNumber(InitParam.DEFAULT_EXPIRE);
+ int expected = Integer.parseInt(localInitParams.get(InitParam.DEFAULT_EXPIRE.name()));
+ assertEquals(expected, actual);
+ }
+
+ public void testStringOption() {
+ String actual = configuration.getOption(InitParam.SKIN);
+ String expected = (String)localInitParams.get(InitParam.SKIN.name());
+ assertEquals(expected, actual);
+ }
+
+ public void testStringOptionValueReference() {
+ String actual = configuration.getOptionValue(InitParam.LoadStyleStrategy);
+ String expected = mockBean.getStyleStrategy();
+ assertEquals(expected, actual);
+ }
+
+ @Override
+ public void setUp() throws Exception {
+ super.setUp();
+ mockBean = new MockInitializationBean();
+ setupFacesRequest();
+ ExternalContext externalContext = facesContext.getExternalContext();
+ configuration = FrameworkConfiguration.getInstance(externalContext);
+ facesContext.getExternalContext().getRequestMap().put("mockBean", mockBean);
+ }
+
+ @Override
+ protected void setupJsfInitParameters() {
+ super.setupJsfInitParameters();
+ localInitParams = new HashMap<String, String>();
+
+ localInitParams.put(InitParam.SKIN.name(), "blueSky");
+ localInitParams.put(InitParam.COMPRESS_SCRIPT.name(), "false");
+ localInitParams.put(InitParam.DEFAULT_EXPIRE.name(), "8500");
+
+ facesServer.addInitParameter(FrameworkConfiguration.InitParam.SKIN.getQualifiedName(), "blueSky");
+ facesServer.addInitParameter(FrameworkConfiguration.InitParam.LoadScriptStrategy.getQualifiedName(), "ALL");
+ facesServer.addInitParameter(FrameworkConfiguration.InitParam.COMPRESS_SCRIPT.getQualifiedName(), "false");
+ facesServer.addInitParameter(FrameworkConfiguration.InitParam.DEFAULT_EXPIRE.getQualifiedName(), "8500");
+ facesServer.addInitParameter(FrameworkConfiguration.InitParam.ENCRYPT_RESOURCE_DATA.getQualifiedName(), "#{mockBean.encryptResourceData}");
+ facesServer.addInitParameter(FrameworkConfiguration.InitParam.LoadStyleStrategy.getQualifiedName(), "#{mockBean.styleStrategy}");
+ }
+
+ @Override
+ public void tearDown() throws Exception {
+ super.tearDown();
+ mockBean = null;
+ }
+
+}
15 years, 5 months
JBoss Rich Faces SVN: r15143 - root/framework/trunk/impl/src/main/java/org/ajax4jsf/config.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2009-08-10 07:28:57 -0400 (Mon, 10 Aug 2009)
New Revision: 15143
Modified:
root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/FrameworkConfiguration.java
Log:
fix el resolve
Modified: root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/FrameworkConfiguration.java
===================================================================
--- root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/FrameworkConfiguration.java 2009-08-10 11:07:17 UTC (rev 15142)
+++ root/framework/trunk/impl/src/main/java/org/ajax4jsf/config/FrameworkConfiguration.java 2009-08-10 11:28:57 UTC (rev 15143)
@@ -25,12 +25,11 @@
private static final Logger logger = RichfacesLogger.CONFIG.getLogger();
-
private Map<InitParam, String> initParams = new EnumMap<InitParam, String>(InitParam.class);
- private static final Pattern ALLOWABLE_BOOLEANS = Pattern.compile("true|false");
+ private static final Pattern ALLOWABLE_BOOLEANS = Pattern.compile("true|false",Pattern.CASE_INSENSITIVE);
- private static final Pattern ALLOWABLE_NUMBER = Pattern.compile("[0-9]");
+ private static final Pattern ALLOWABLE_NUMBER = Pattern.compile("^\\d+$");
private FrameworkConfiguration(ExternalContext externalContext) {
@@ -48,44 +47,52 @@
}
private boolean isBooleanValue(InitParam param, String value) {
- return !ALLOWABLE_BOOLEANS.matcher(value).matches();
+ return ALLOWABLE_BOOLEANS.matcher(value).matches();
}
private boolean isNumberValue(InitParam param, String value) {
- return !ALLOWABLE_NUMBER.matcher(value).matches();
+ return ALLOWABLE_NUMBER.matcher(value).matches();
}
public int getOptionNumber(InitParam param) {
- int intValue = -1;
- String value = getOptionValue(param);
+
+ String value = getOption(param);
+
+ if(ELUtils.isValueReference(value)) {
+ return ((Integer)resolveELParam(FacesContext.getCurrentInstance(), value, java.lang.Integer.class)).intValue();
+ }
+
if(isNumberValue(param, value)) {
- if(ELUtils.isValueReference(value)) {
- intValue = ((Integer)resolveELParam(FacesContext.getCurrentInstance(), value, java.lang.Integer.class)).intValue();
- } else {
- intValue = Integer.parseInt(value);
- }
- } else {
- logger.error("option value is not Integer number");
- }
- return intValue;
+ return Integer.parseInt(value);
+ }
+ logger.error("option value: " + param.getQualifiedName() + " is not Integer number set default value: " + param.getDefaultValue());
+ return Integer.parseInt(param.getDefaultValue());
}
public boolean isOptionEnabled(InitParam param) {
- boolean isEnabled = false;
- String value = getOptionValue(param);
- if(isBooleanValue(param, value)) {
- if(ELUtils.isValueReference(value)) {
- isEnabled = ((Boolean)resolveELParam(FacesContext.getCurrentInstance(), value, java.lang.Boolean.class)).booleanValue();
- } else {
- isEnabled = Boolean.parseBoolean(value);
- }
- } else {
- logger.error("option value is not boolean value");
+ String value = getOption(param);
+
+ if(ELUtils.isValueReference(value)) {
+ return ((Boolean)resolveELParam(FacesContext.getCurrentInstance(), value, java.lang.Boolean.class)).booleanValue();
+ }
+
+ if(isBooleanValue(param, value)) {
+ return Boolean.parseBoolean(value);
+ }
+
+ logger.error("option value: " + param.getQualifiedName() + " is not boolean value set default value: " + param.getDefaultValue());
+ return Boolean.parseBoolean(param.getDefaultValue());
+ }
+
+ public String getOptionValue(InitParam param) {
+ String value = getOption(param);
+ if(ELUtils.isValueReference(value)) {
+ return (String)resolveELParam(FacesContext.getCurrentInstance(), value, java.lang.String.class);
}
- return isEnabled;
+ return value;
}
- public String getOptionValue(InitParam param) {
+ public String getOption(InitParam param) {
return initParams.get(param);
}
@@ -95,18 +102,21 @@
String paramValue = externalContext.getInitParameter(paramName);
String value = param.getDefaultValue();
- if (paramValue != null) {
+ if (paramValue != null && !"".equals(paramValue.trim())) {
value = paramValue;
- }
+ }
initParams.put(param, value);
}
}
- private Object resolveELParam(FacesContext context, String value, Class <?> expectedClass) {
+ public Object resolveELParam(FacesContext context, String value, Class <?> expectedClass) {
+
ExpressionFactory factory = context.getApplication().getExpressionFactory();
- ValueExpression valueExpression = factory.createValueExpression(value, expectedClass);
- return valueExpression.getValue(context.getELContext());
+ ValueExpression valueExpression = factory.createValueExpression(context.getELContext(), value, expectedClass);
+ Object returnValue = valueExpression.getValue(context.getELContext());
+
+ return returnValue;
}
public enum InitParam {
15 years, 5 months
JBoss Rich Faces SVN: r15142 - Reports/3.3.2 and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: tkuprevich
Date: 2009-08-10 07:07:17 -0400 (Mon, 10 Aug 2009)
New Revision: 15142
Added:
branches/community/3.3.X/test-applications/qa/Test Reports/3.3.2/RFTestReport3.3.2.CR1(08.03-07).xls
Removed:
branches/community/3.3.X/test-applications/qa/Test Reports/3.3.2/RFTestReport3.3.2.CR1.xls
Log:
Added: branches/community/3.3.X/test-applications/qa/Test Reports/3.3.2/RFTestReport3.3.2.CR1(08.03-07).xls
===================================================================
(Binary files differ)
Property changes on: branches/community/3.3.X/test-applications/qa/Test Reports/3.3.2/RFTestReport3.3.2.CR1(08.03-07).xls
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: branches/community/3.3.X/test-applications/qa/Test Reports/3.3.2/RFTestReport3.3.2.CR1.xls
===================================================================
(Binary files differ)
15 years, 5 months
JBoss Rich Faces SVN: r15141 - in root/cdk/trunk/plugins: annotations and 14 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2009-08-07 20:41:50 -0400 (Fri, 07 Aug 2009)
New Revision: 15141
Added:
root/cdk/trunk/plugins/annotations/
root/cdk/trunk/plugins/annotations/pom.xml
root/cdk/trunk/plugins/annotations/src/
root/cdk/trunk/plugins/annotations/src/main/
root/cdk/trunk/plugins/annotations/src/main/java/
root/cdk/trunk/plugins/annotations/src/main/java/org/
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Attribute.java
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Component.java
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Family.java
root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/package-info.java
root/cdk/trunk/plugins/annotations/src/test/
root/cdk/trunk/plugins/annotations/src/test/java/
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/util/
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/util/Strings.java
Removed:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/annotations/
Modified:
root/cdk/trunk/plugins/generator/pom.xml
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkCompiler.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkProcessor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ComponentProcessor.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Component.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentLibrary.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/InvalidNameException.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/JsfComponent.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Name.java
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/NamingConventions.java
root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/ProcessorTest.java
root/cdk/trunk/plugins/pom.xml
Log:
extract annotations to separate project
Added: root/cdk/trunk/plugins/annotations/pom.xml
===================================================================
--- root/cdk/trunk/plugins/annotations/pom.xml (rev 0)
+++ root/cdk/trunk/plugins/annotations/pom.xml 2009-08-08 00:41:50 UTC (rev 15141)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>maven-plugins</artifactId>
+ <groupId>org.richfaces.cdk</groupId>
+ <version>4.0.0-SNAPSHOT</version>
+ </parent>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>annotations</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <description>That project contains annotations for JSF classes</description>
+ <name>annotations</name>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <inherited>true</inherited>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ </dependencies>
+</project>
Added: root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Attribute.java
===================================================================
--- root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Attribute.java (rev 0)
+++ root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Attribute.java 2009-08-08 00:41:50 UTC (rev 15141)
@@ -0,0 +1,47 @@
+/*
+ * $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.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * <p class="changed_added_4_0"></p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+(a)Retention(RetentionPolicy.CLASS)
+(a)Target({ElementType.FIELD,ElementType.METHOD})
+@Inherited
+public @interface Attribute {
+
+ boolean hidden() default false;
+
+ boolean readOnly() default false;
+
+ String name() default "";
+}
Added: root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Component.java
===================================================================
--- root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Component.java (rev 0)
+++ root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Component.java 2009-08-08 00:41:50 UTC (rev 15141)
@@ -0,0 +1,65 @@
+/*
+ * $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.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @author asmirnov(a)exadel.com
+ *
+ */
+(a)Retention(RetentionPolicy.CLASS)
+(a)Target(ElementType.TYPE)
+@Inherited
+public @interface Component {
+
+ public static final String NAME = "org.richfaces.cdk.annotations.Component";
+
+ /**
+ * <p class="changed_added_4_0">
+ * Type of the component. If this value an empty, component type will be inferred from class name.
+ * </p>
+ *
+ * @return component type.
+ */
+ public String type() default "";
+
+
+ /**
+ * <p class="changed_added_4_0">
+ * Name of the final component class. May be empty, in that case name will be
+ * inferred from naming conventions.
+ * </p>
+ *
+ * @return
+ */
+ public String className() default "";
+}
Added: root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Family.java
===================================================================
--- root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Family.java (rev 0)
+++ root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/Family.java 2009-08-08 00:41:50 UTC (rev 15141)
@@ -0,0 +1,53 @@
+/*
+ * $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.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * <p class="changed_added_4_0">Defines family of component or renderer.</p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+(a)Retention(RetentionPolicy.CLASS)
+(a)Target(ElementType.TYPE)
+@Inherited
+public @interface Family {
+
+ public static final String NAME = "org.richfaces.cdk.annotations.Family";
+
+ /**
+ * <p class="changed_added_4_0">
+ * Family of the component. If this value an empty, it will be inferred.
+ * </p>
+ *
+ * @return component family.
+ */
+ public String value() default "";
+
+}
Added: root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/package-info.java
===================================================================
--- root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/package-info.java (rev 0)
+++ root/cdk/trunk/plugins/annotations/src/main/java/org/richfaces/cdk/annotations/package-info.java 2009-08-08 00:41:50 UTC (rev 15141)
@@ -0,0 +1,7 @@
+/**
+ * <h1>Java annotations used by the CDK.</h1>
+ *
+ */
+package org.richfaces.cdk.annotations;
+
+
Modified: root/cdk/trunk/plugins/generator/pom.xml
===================================================================
--- root/cdk/trunk/plugins/generator/pom.xml 2009-08-07 18:46:54 UTC (rev 15140)
+++ root/cdk/trunk/plugins/generator/pom.xml 2009-08-08 00:41:50 UTC (rev 15141)
@@ -26,18 +26,18 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
- <useManifestOnlyJar>false</useManifestOnlyJar>
+ <useManifestOnlyJar>false</useManifestOnlyJar>
<useSystemClassLoader>true</useSystemClassLoader>
</configuration>
</plugin>
- <!--
- plugin> <groupId>org.codehaus.mojo</groupId>
- <artifactId>jaxb2-maven-plugin</artifactId> <executions> <execution>
- <goals> <goal>xjc</goal> </goals> </execution> </executions>
- <configuration> <packageName>org.richfaces.cdk.model</packageName>
- </configuration> </plugin
- -->
- </plugins>
+ <!--
+ plugin> <groupId>org.codehaus.mojo</groupId>
+ <artifactId>jaxb2-maven-plugin</artifactId> <executions> <execution>
+ <goals> <goal>xjc</goal> </goals> </execution> </executions>
+ <configuration> <packageName>org.richfaces.cdk.model</packageName>
+ </configuration> </plugin
+ -->
+ </plugins>
</build>
<dependencies>
<dependency>
@@ -51,6 +51,11 @@
<artifactId>freemarker</artifactId>
<version>2.3.9</version>
</dependency>
+ <dependency>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>annotations</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ </dependency>
<!--
<dependency> <groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId> <version>2.1</version>
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkCompiler.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkCompiler.java 2009-08-07 18:46:54 UTC (rev 15140)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkCompiler.java 2009-08-08 00:41:50 UTC (rev 15141)
@@ -29,6 +29,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
+import java.util.List;
import java.util.Locale;
import javax.annotation.processing.Processor;
@@ -38,12 +39,15 @@
import javax.tools.JavaFileObject;
import javax.tools.StandardJavaFileManager;
import javax.tools.ToolProvider;
+import javax.tools.Diagnostic.Kind;
import javax.tools.JavaCompiler.CompilationTask;
import org.richfaces.cdk.CdkContext;
import org.richfaces.cdk.Logger;
import org.richfaces.cdk.LoggerFactory;
+import com.google.common.collect.Lists;
+
/**
* <p class="changed_added_4_0">
* That class compiles files from sources and process annotations
@@ -138,14 +142,18 @@
* @throws AptException
*/
public void process(Iterable<File> sources, Processor...processors) throws AptException {
- DiagnosticListener<JavaFileObject> listener = null /*new DiagnosticListener<JavaFileObject>() {
+ final List<String> messages = Lists.newArrayList();
+ DiagnosticListener<JavaFileObject> listener = new DiagnosticListener<JavaFileObject>() {
@Override
public void report(Diagnostic<? extends JavaFileObject> diagnostic) {
log.debug("LOG: " + diagnostic.getMessage(null));
+ if(Kind.ERROR.equals(diagnostic.getKind())){
+ messages.add(diagnostic.getMessage(null));
+ }
}
- }*/;
+ };
ArrayList<VirtualJavaFileObject> sourceObjects = new ArrayList<VirtualJavaFileObject>();
for (File file : sources) {
VirtualJavaFileObject sourceObject = new VirtualJavaFileSystemObject(file);
@@ -154,7 +162,9 @@
CompilationTask task = getJavaCompiler().getTask(null, getFileManager(), listener, getOptions(), null, sourceObjects);
task.setProcessors(Arrays.asList(processors));
task.setLocale(locale);
- task.call();
+ if(!task.call()){
+ throw new AptException("Compilation error: "+messages);
+ }
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkProcessor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkProcessor.java 2009-08-07 18:46:54 UTC (rev 15140)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/CdkProcessor.java 2009-08-08 00:41:50 UTC (rev 15141)
@@ -23,43 +23,77 @@
package org.richfaces.cdk.apt;
+import java.lang.annotation.Annotation;
import java.util.Set;
import javax.annotation.processing.AbstractProcessor;
import javax.annotation.processing.RoundEnvironment;
import javax.annotation.processing.SupportedSourceVersion;
import javax.lang.model.SourceVersion;
+import javax.lang.model.element.Element;
+import javax.lang.model.element.ElementKind;
import javax.lang.model.element.TypeElement;
import org.richfaces.cdk.CdkContext;
+import com.google.common.collect.Sets;
+
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0">
+ * Base class for all CDK Annotation processors. That class provides access to
+ * current CDK context and utility methods for Java source models.
+ * </p>
+ *
* @author asmirnov(a)exadel.com
- *
+ *
*/
-(a)SupportedSourceVersion(SourceVersion.RELEASE_5)
public abstract class CdkProcessor extends AbstractProcessor {
-
- private final CdkContext context;
- public CdkProcessor(CdkContext context) {
+ /**
+ * <p class="changed_added_4_0">CDK context.</p>
+ */
+ protected final CdkContext context;
+
+ /**
+ * <p class="changed_added_4_0"></p>
+ * @param context current CDK context
+ */
+ protected CdkProcessor(CdkContext context) {
super();
this.context = context;
}
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0">
+ * </p>
+ *
* @return the context
*/
protected CdkContext getContext() {
return context;
}
-
+
@Override
public SourceVersion getSupportedSourceVersion() {
- return SourceVersion.RELEASE_5;
+ // CDK supports Java 5 or 6 source code.
+ return SourceVersion.RELEASE_6;
}
-
+ /**
+ * <p class="changed_added_4_0">Get all classes annotated with particular annotation.</p>
+ * @param annotation annotation class.
+ * @param round current round environment.
+ * @return {@link Set} of all classes annotated with {@code annotation} type.
+ */
+ protected Set<? extends TypeElement> getClassesAnnotatedWith(Class<? extends Annotation> annotation,RoundEnvironment round){
+ Set<TypeElement> classes = Sets.newHashSet();
+ Set<? extends Element> annotatedWith = round.getElementsAnnotatedWith(annotation);
+ for (Element element : annotatedWith) {
+ if (ElementKind.CLASS.equals(element.getKind())) {
+ TypeElement classElement = (TypeElement) element;
+ classes.add(classElement);
+ }
+ }
+ return classes;
+ }
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ComponentProcessor.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ComponentProcessor.java 2009-08-07 18:46:54 UTC (rev 15140)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/ComponentProcessor.java 2009-08-08 00:41:50 UTC (rev 15141)
@@ -34,6 +34,8 @@
import org.richfaces.cdk.CdkContext;
import org.richfaces.cdk.annotations.Component;
import org.richfaces.cdk.model.ComponentLibrary;
+import org.richfaces.cdk.model.InvalidNameException;
+import org.richfaces.cdk.model.NamingConventions;
/**
* <p class="changed_added_4_0"></p>
@@ -61,12 +63,26 @@
public boolean process(Set<? extends TypeElement> annotations,
RoundEnvironment roundEnv) {
if(null != annotations && !annotations.isEmpty()){
- Set<? extends Element> annotatedComponents = roundEnv.getElementsAnnotatedWith(Component.class);
- for (Element component : annotatedComponents) {
- Component componentAnnotation = component.getAnnotation(Component.class);
- String componentType = componentAnnotation.type();
- String componentFamily = componentAnnotation.family();
- String componentClassName = componentAnnotation.className();
+ ComponentLibrary library = getLibrary();
+ NamingConventions namingUtils = library.getNamingUtils();
+ // Process all component classes.
+ Set<? extends TypeElement> componentClasses = getClassesAnnotatedWith(Component.class, roundEnv);
+ for (TypeElement component : componentClasses) {
+ try {
+ // Process class-level annotations.
+ // Calculate type
+ Component componentAnnotation = component.getAnnotation(Component.class);
+ String componentType = namingUtils.inferComponentType(componentAnnotation.type(),component.getQualifiedName().toString());
+ org.richfaces.cdk.model.Component componentModel = library
+ .getComponent(componentType, true);
+ // Calculate classes.
+ String componentClassName = componentAnnotation.className();
+ // Process attributes.
+ } catch (InvalidNameException e) {
+ // rise error and continue.
+ processingEnv.getMessager().printMessage(javax.tools.Diagnostic.Kind.ERROR, e.getMessage(), component);
+ continue;
+ }
}
return true;
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Component.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Component.java 2009-08-07 18:46:54 UTC (rev 15140)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Component.java 2009-08-08 00:41:50 UTC (rev 15141)
@@ -14,6 +14,7 @@
* @author asmirnov(a)exadel.com
*
*/
+@SuppressWarnings("serial")
public final class Component implements JsfComponent {
/**
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentLibrary.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentLibrary.java 2009-08-07 18:46:54 UTC (rev 15140)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/ComponentLibrary.java 2009-08-08 00:41:50 UTC (rev 15141)
@@ -23,101 +23,167 @@
package org.richfaces.cdk.model;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
+import org.richfaces.cdk.util.Strings;
+
import com.google.common.collect.Maps;
/**
- * <p class="changed_added_4_0">That class contains model of all JSF components asscoiated with that project</p>
- * <p>To keep consistence of library references, only library methods are allowed to components manipulations.</p>
+ * <p class="changed_added_4_0">
+ * That class contains model of all JSF components asscoiated with that project
+ * </p>
+ * <p>
+ * To keep consistence of library references, only library methods are allowed
+ * to components manipulations.
+ * </p>
+ *
* @author asmirnov(a)exadel.com
- *
+ *
*/
-public class ComponentLibrary {
-
+public class ComponentLibrary implements Serializable {
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ */
+ private static final long serialVersionUID = -6055670836731899832L;
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @author asmirnov(a)exadel.com
+ *
+ */
final class RichFacesConventions implements NamingConventions {
+ private final String[] COMPONENT_SUFFIXES = { "Base" };
+ private final String[] COMPONENT_PREFIXES = { "UI", "Abstract" };
+
@Override
- public String getComponentType(String className) throws InvalidNameException {
+ public String inferComponentType(String explicitType, String className)
+ throws InvalidNameException {
// check parameters.
- if(null == className || className.length()==0){
- throw new IllegalArgumentException();
+ if (Strings.isEmpty(explicitType)) {
+ if (Strings.isEmpty(className)) {
+ throw new IllegalArgumentException();
+ }
+ Name name = Name.create(className);
+ // Use base library prefix.
+ name.setPrefix(getBaseName());
+ // Component type does not contain class or markup parts.
+ name.setClassifier(null);
+ name.setMarkup(null);
+ String simpleName = name.getSimpleName();
+ // Remove common prefixes.
+ for (int i = 0; i < COMPONENT_PREFIXES.length; i++) {
+ if (simpleName.startsWith(COMPONENT_PREFIXES[i])) {
+ simpleName = simpleName.substring(COMPONENT_PREFIXES[i]
+ .length());
+ break;
+ }
+ }
+ // Remove common suffixes.
+ for (int i = 0; i < COMPONENT_SUFFIXES.length; i++) {
+ if (simpleName.endsWith(COMPONENT_SUFFIXES[i])) {
+ simpleName = simpleName.substring(0, simpleName
+ .length()
+ - COMPONENT_SUFFIXES[i].length());
+ break;
+ }
+ }
+ name.setSimpleName(simpleName);
+ return name.toString();
+ } else {
+ return explicitType;
}
- Name.create(className);
- //
- return null;
}
@Override
- public String getComponentClass(String componentType) {
+ public String inferUIComponentClass(String explicitClass, String componentType) {
// TODO Auto-generated method stub
return null;
}
-
+
}
+
/**
- * <p class="changed_added_4_0">JSF components in that library</p>
- */
- private final Map<Component.Type,Component> components = Maps.newHashMap();
-
- private final Collection<Component> componentsSet = Collections.unmodifiableCollection(components.values());
+ * <p class="changed_added_4_0">
+ * JSF components in that library
+ * </p>
+ */
+ private final Map<Component.Type, Component> components = Maps.newHashMap();
+ private final Collection<Component> componentsSet = Collections
+ .unmodifiableCollection(components.values());
+
/**
- * <p class="changed_added_4_0">JSF renderer associated with that library</p>
- */
+ * <p class="changed_added_4_0">
+ * JSF renderer associated with that library
+ * </p>
+ */
private final List<Renderer> renderers = new ArrayList<Renderer>();
-
+
private final List<Converter> converters = new ArrayList<Converter>();
-
+
private final List<Validator> validators = new ArrayList<Validator>();
-
+
private final List<Behavior> behaviors = new ArrayList<Behavior>();
private final List<Listener> listeners = new ArrayList<Listener>();
-
+
/**
- * <p class="changed_added_4_0">Tag library with references of all used tags</p>
- */
+ * <p class="changed_added_4_0">
+ * Tag library with references of all used tags
+ * </p>
+ */
private final TagLibrary tagLibrary;
-
+
/**
- * <p class="changed_added_4_0"></p>
- */
+ * <p class="changed_added_4_0">
+ * </p>
+ */
private final String baseName;
private NamingConventions namingConventions = new RichFacesConventions();
-
-
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0">
+ * </p>
+ *
* @param baseName
*/
public ComponentLibrary(String baseName) {
this.baseName = baseName;
this.tagLibrary = new TagLibrary(baseName);
}
+
/**
- * <p class="changed_added_4_0">Merge component library model with other.</p>
+ * <p class="changed_added_4_0">
+ * Merge component library model with other.
+ * </p>
+ *
* @param otherLibrary
*/
public void apply(ComponentLibrary otherLibrary) {
// TODO Auto-generated method stub
-
}
+
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0">
+ * </p>
+ *
* @return the components
*/
public Collection<Component> getComponents() {
return componentsSet;
}
-
/**
* <p class="changed_added_4_0">
* Lookup for component with given type. If such component did not exist and
@@ -125,72 +191,92 @@
* created
* </p>
*
- * @param type
+ * @param type
* @param create
* @return
*/
public Component getComponent(String type, boolean create) {
Component.Type componentType = new Component.Type(type);
Component component = components.get(componentType);
- if(null == component && create){
+ if (null == component && create) {
component = new Component(componentType);
components.put(componentType, component);
}
return component;
}
+
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0">
+ * </p>
+ *
* @return the renderers
*/
public List<Renderer> getRenderers() {
return renderers;
}
+
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0">
+ * </p>
+ *
* @return the converters
*/
public List<Converter> getConverters() {
return converters;
}
+
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0">
+ * </p>
+ *
* @return the validators
*/
public List<Validator> getValidators() {
return validators;
}
+
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0">
+ * </p>
+ *
* @return the behaviors
*/
public List<Behavior> getBehaviors() {
return behaviors;
}
+
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0">
+ * </p>
+ *
* @return the listeners
*/
public List<Listener> getListeners() {
return listeners;
}
+
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0">
+ * </p>
+ *
* @return the tagLibrary
*/
public TagLibrary getTagLibrary() {
return tagLibrary;
}
-
- public NamingConventions getNamingUtils(){
+
+ public NamingConventions getNamingUtils() {
return namingConventions;
}
+
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0">
+ * </p>
+ *
* @return the baseName
*/
protected String getBaseName() {
return baseName;
}
-
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/InvalidNameException.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/InvalidNameException.java 2009-08-07 18:46:54 UTC (rev 15140)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/InvalidNameException.java 2009-08-08 00:41:50 UTC (rev 15141)
@@ -26,17 +26,18 @@
import org.richfaces.cdk.CdkException;
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0">That exception indicates what some name does not meet CDK naming conventions.</p>
* @author asmirnov(a)exadel.com
*
*/
+@SuppressWarnings("serial")
public class InvalidNameException extends CdkException {
/**
* <p class="changed_added_4_0"></p>
*/
public InvalidNameException() {
- // TODO Auto-generated constructor stub
+ super();
}
/**
@@ -45,7 +46,6 @@
*/
public InvalidNameException(String message) {
super(message);
- // TODO Auto-generated constructor stub
}
/**
@@ -54,7 +54,6 @@
*/
public InvalidNameException(Throwable cause) {
super(cause);
- // TODO Auto-generated constructor stub
}
/**
@@ -64,7 +63,6 @@
*/
public InvalidNameException(String message, Throwable cause) {
super(message, cause);
- // TODO Auto-generated constructor stub
}
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/JsfComponent.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/JsfComponent.java 2009-08-07 18:46:54 UTC (rev 15140)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/JsfComponent.java 2009-08-08 00:41:50 UTC (rev 15141)
@@ -1,7 +1,9 @@
package org.richfaces.cdk.model;
-public interface JsfComponent {
+import java.io.Serializable;
+public interface JsfComponent extends Serializable {
+
/**
* <p class="changed_added_4_0">Marker interface for all JSF objects:
* {@code Validator}, {@code Converter}, {@code Behavior}, {@code
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Name.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Name.java 2009-08-07 18:46:54 UTC (rev 15140)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/Name.java 2009-08-08 00:41:50 UTC (rev 15141)
@@ -23,110 +23,156 @@
package org.richfaces.cdk.model;
-import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
- * <p class="changed_added_4_0">Represents parts of component type/family/classname according to CDK naming conventions.</p>
+ * <p class="changed_added_4_0">
+ * Represents parts of component type/family/classname according to CDK naming
+ * conventions.
+ * </p>
+ *
* @author asmirnov(a)exadel.com
- *
+ *
*/
public class Name {
-
+
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0">
+ * Standard package names for components, renderers, event listeners and taglib.
+ * </p>
+ *
* @author asmirnov(a)exadel.com
- *
+ *
*/
public enum Classifier {
- component,
- renderkit,
- event,
+ /**
+ * <p class="changed_added_4_0"></p>
+ */
+ component,
+ /**
+ * <p class="changed_added_4_0"></p>
+ */
+ renderkit,
+ /**
+ * <p class="changed_added_4_0"></p>
+ */
+ event,
+ /**
+ * <p class="changed_added_4_0"></p>
+ */
taglib;
}
- private static final Pattern namePattern = Pattern.compile("^(?:(.+)\\.)?(?:(" + Classifier.component
- + "|" + Classifier.renderkit + "|" + Classifier.event + "|" + Classifier.taglib + ")\\.(?:([^\\.]+)\\.)?)?([^\\.]+)$");
+ private static final Pattern namePattern = Pattern
+ .compile("^(?:(.+)\\.)?(?:(" + Classifier.component + "|"
+ + Classifier.renderkit + "|" + Classifier.event + "|"
+ + Classifier.taglib + ")\\.(?:([^\\.]+)\\.)?)?([^\\.]+)$");
/**
- * <p class="changed_added_4_0">represents library part prefix of name.</p>
- */
+ * <p class="changed_added_4_0">
+ * represents library part prefix of name.
+ * </p>
+ */
private String prefix;
-
+
/**
- * <p class="changed_added_4_0">Element type classifier - "component","event","renderkit","taglib"</p>
- */
+ * <p class="changed_added_4_0">
+ * Element type classifier - "component","event","renderkit","taglib"
+ * </p>
+ */
private Classifier classifier;
-
+
/**
- * <p class="changed_added_4_0">Markup-specific part of name ( "html","xhtml","wml" ... )</p>
- */
+ * <p class="changed_added_4_0">
+ * Markup-specific part of name ( "html","xhtml","wml" ... )
+ * </p>
+ */
private String markup;
-
+
/**
- * <p class="changed_added_4_0">Simple name ( last word after a period ).</p>
- */
+ * <p class="changed_added_4_0">
+ * Simple name ( last word after a period ).
+ * </p>
+ */
private String simpleName;
/**
- * <p class="changed_added_4_0">Creates RichFaces name representation from string.</p>
+ * <p class="changed_added_4_0">
+ * Creates RichFaces name representation from string.
+ * </p>
+ *
* @param name
* @return
* @throws InvalidNameException
*/
public static Name create(String name) throws InvalidNameException {
- Name cdkName = new Name();
- StringBuilder prefix = new StringBuilder(name.length());
- String[] parts = name.split("\\.");
- cdkName.setSimpleName(parts[parts.length-1]);
- if(parts.length>1){
- try{
- cdkName.setClassifier(Classifier.valueOf(parts[parts.length-2]));
- fillPrefix(prefix, parts,parts.length-2);
- } catch (IllegalArgumentException e) {
- if(parts.length>2){
- try{
- cdkName.setClassifier(Classifier.valueOf(parts[parts.length-3]));
- fillPrefix(prefix, parts,parts.length-3);
- cdkName.setMarkup(parts[parts.length-2]);
- } catch (IllegalArgumentException e1) {
- fillPrefix(prefix, parts,parts.length-1);
- }
-
- } else {
- prefix.append(parts[0]);
+ Name cdkName = new Name();
+ StringBuilder prefix = new StringBuilder(name.length());
+ String[] parts = name.split("\\.");
+ cdkName.setSimpleName(parts[parts.length - 1]);
+ if (parts.length > 1) {
+ try {
+ cdkName.setClassifier(Classifier
+ .valueOf(parts[parts.length - 2]));
+ fillPrefix(prefix, parts, parts.length - 2);
+ } catch (IllegalArgumentException e) {
+ if (parts.length > 2) {
+ try {
+ cdkName.setClassifier(Classifier
+ .valueOf(parts[parts.length - 3]));
+ fillPrefix(prefix, parts, parts.length - 3);
+ cdkName.setMarkup(parts[parts.length - 2]);
+ } catch (IllegalArgumentException e1) {
+ fillPrefix(prefix, parts, parts.length - 1);
}
+
+ } else {
+ prefix.append(parts[0]);
}
- if(prefix.length()>0){
- cdkName.setPrefix(prefix.toString());
- }
}
- return cdkName;
+ if (prefix.length() > 0) {
+ cdkName.setPrefix(prefix.toString());
+ }
+ }
+ return cdkName;
}
- private static void fillPrefix(StringBuilder prefix, String[] parts, int size) {
+ /**
+ * <p class="changed_added_4_0">Utility method that composes library prefix from first elements of array</p>
+ * @param prefix buffer that collects prefix.
+ * @param parts package name parts
+ * @param size size of prefix part of array.
+ */
+ private static void fillPrefix(StringBuilder prefix, String[] parts,
+ int size) {
for (int i = 0; i < size; i++) {
- if(i!=0){
+ if (i != 0) {
prefix.append('.');
}
prefix.append(parts[i]);
}
}
- public static Name create(String prefix,String name) throws InvalidNameException {
+ public static Name create(String prefix, String name)
+ throws InvalidNameException {
Name cdkName = create(name);
- if(prefix.equals(cdkName.getPrefix())){
+ if (prefix.equals(cdkName.getPrefix())) {
return new Name();
} else {
- throw new InvalidNameException("Nape "+name+" does not start with prefix "+prefix);
+ throw new InvalidNameException("Nape " + name
+ + " does not start with prefix " + prefix);
}
}
- public static Name create(String prefix, Classifier classifier, String name) throws InvalidNameException {
+ public static Name create(String prefix, Classifier classifier, String name)
+ throws InvalidNameException {
return new Name();
}
+
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0">
+ * </p>
+ *
* @return the prefix
*/
public String getPrefix() {
@@ -134,15 +180,20 @@
}
/**
- * <p class="changed_added_4_0"></p>
- * @param prefix the prefix to set
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param prefix
+ * the prefix to set
*/
public void setPrefix(String prefix) {
this.prefix = prefix;
}
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0">
+ * </p>
+ *
* @return the classifier
*/
public Classifier getClassifier() {
@@ -150,15 +201,20 @@
}
/**
- * <p class="changed_added_4_0"></p>
- * @param classifier the classifier to set
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param classifier
+ * the classifier to set
*/
public void setClassifier(Classifier classifier) {
this.classifier = classifier;
}
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0">
+ * </p>
+ *
* @return the markup
*/
public String getMarkup() {
@@ -166,15 +222,20 @@
}
/**
- * <p class="changed_added_4_0"></p>
- * @param markup the markup to set
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param markup
+ * the markup to set
*/
public void setMarkup(String markup) {
this.markup = markup;
}
/**
- * <p class="changed_added_4_0"></p>
+ * <p class="changed_added_4_0">
+ * </p>
+ *
* @return the simpleName
*/
public String getSimpleName() {
@@ -182,11 +243,30 @@
}
/**
- * <p class="changed_added_4_0"></p>
- * @param simpleName the simpleName to set
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @param simpleName
+ * the simpleName to set
*/
public void setSimpleName(String simpleName) {
this.simpleName = simpleName;
}
+ @Override
+ public String toString() {
+ StringBuilder result = new StringBuilder();
+ if(null != prefix){
+ result.append(prefix).append('.');
+ }
+ if(null != classifier){
+ result.append(classifier).append('.');
+ }
+ if(null != markup){
+ result.append(markup).append('.');
+ }
+ result.append(simpleName);
+ return result.toString();
+ }
+
}
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/NamingConventions.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/NamingConventions.java 2009-08-07 18:46:54 UTC (rev 15140)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/model/NamingConventions.java 2009-08-08 00:41:50 UTC (rev 15141)
@@ -36,26 +36,28 @@
public interface NamingConventions {
/**
- * <p class="changed_added_4_0">Calculates component type from the base class name.</p>
+ * <p class="changed_added_4_0">Calculates component type from explicit value or base class name.</p>
* <ul>
* <li><code><prefix>.component.Abstract<Name></code> => <code><prefix>.<Name></code> </li>
* <li><code><prefix>.component.<Name>Base</code> => <code><prefix>.<Name></code> </li>
* <li><code><prefix>.component.UI<Name></code> => <code><prefix>.<Name></code> </li>
* </ul>
+ * @param explicitType
* @param className
* @return
* @throws InvalidNameException if className does not match naming conventions.
*/
- public String getComponentType(String className) throws InvalidNameException;
+ public String inferComponentType(String explicitType, String className) throws InvalidNameException;
/**
- * <p class="changed_added_4_0">Calculates component base class from type.</p>
+ * <p class="changed_added_4_0">Calculates concrete component class from explicit value or type.</p>
* <ul>
* <li><code><prefix>.<Name></code> => <code><prefix>.component.UI<Name></code> </li>
* </ul>
+ * @param explicitClass
* @param className
* @return
*/
- public String getComponentClass(String componentType);
+ public String inferUIComponentClass(String explicitClass, String componentType);
}
Added: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/util/Strings.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/util/Strings.java (rev 0)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/util/Strings.java 2009-08-08 00:41:50 UTC (rev 15141)
@@ -0,0 +1,85 @@
+/*
+ * $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.util;
+
+/**
+ * <p class="changed_added_4_0">String manipulation utils.</p>
+ * @author asmirnov(a)exadel.com
+ *
+ */
+public final class Strings {
+
+ private Strings() {
+ // this is utility class with static methods only.
+ }
+
+ /**
+ * <p class="changed_added_4_0">Remove characters from string end</p>
+ * @param in input string
+ * @param size number of characters to remove.
+ * @return
+ */
+ public static String cut(String in, int size) {
+ if(size >0){
+ return in.substring(0, in.length()-size);
+ }
+ return in;
+ }
+
+ /**
+ * <p class="changed_added_4_0">Change case of the first character to lower, as it required by the Java Beans property and setter/getter method name conventions:</p>
+ * <p>"PropertyFoo" will be changed to "propertyFoo"</p>
+ * @param in
+ * @return {@code in} with first character changed to lower case.
+ */
+ public static String firstToLowerCase(String in) {
+ if(!isEmpty(in)){
+ in = in.substring(0,1).toLowerCase()+in.substring(1);
+ }
+ return in;
+ }
+
+ /**
+ * <p class="changed_added_4_0">Change case of the first character to upper, as it required by the Java Beans property and setter/getter method name conventions:</p>
+ * <p>"propertyFoo" will be changed to "PropertyFoo"</p>
+ * @param in
+ * @return {@code in} with first character changed to lower case.
+ */
+ public static String firstToUpperCase(String in) {
+ if(!isEmpty(in)){
+ in = in.substring(0,1).toUpperCase()+in.substring(1);
+ }
+ return in;
+ }
+
+ /**
+ * <p class="changed_added_4_0">Check string for null or empty value</p>
+ * @param type
+ * @return true if {@code type} is null or zero-length string.
+ */
+ public static boolean isEmpty(String type) {
+ return type == null || type.length()==0;
+ }
+
+}
Modified: root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/ProcessorTest.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/ProcessorTest.java 2009-08-07 18:46:54 UTC (rev 15140)
+++ root/cdk/trunk/plugins/generator/src/test/java/org/richfaces/cdk/apt/ProcessorTest.java 2009-08-08 00:41:50 UTC (rev 15141)
@@ -88,7 +88,9 @@
import org.richfaces.cdk.annotations.Attribute;
import org.richfaces.cdk.annotations.Component;
import org.richfaces.cdk.model.ComponentLibrary;
+import org.richfaces.cdk.model.InvalidNameException;
import org.richfaces.cdk.model.Property;
+import org.richfaces.cdk.util.Strings;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
@@ -128,66 +130,10 @@
@Override
public boolean process(Set<? extends TypeElement> annotations,
- RoundEnvironment environment) {
- System.out.println("Run Process at round: "+environment.processingOver());
- if(!environment.processingOver()){
- // Get all classes annotated by "component"
- Set<? extends Element> annotatedWith = environment.getElementsAnnotatedWith(Component.class);
- numOfComponents = annotatedWith.size();
- for (Element element : annotatedWith) {
- if (ElementKind.CLASS.equals(element.getKind())) {
- TypeElement classElement = (TypeElement) element;
- Component annotation = element
- .getAnnotation(Component.class);
- String type = annotation.type();
- // TODO - infer type for an empty one. Is thart method
- // for library or for environment ?
- if (isEmpty(type)) {
- classElement.getQualifiedName().toString();
- }
- org.richfaces.cdk.model.Component component = library
- .getComponent(type, true);
- Elements elementUtils = processingEnv.getElementUtils();
- Types typeUtils = processingEnv.getTypeUtils();
- component.setDescription(elementUtils
- .getDocComment(element));
- List<ExecutableElement> methodsIn = ElementFilter
- .methodsIn(elementUtils
- .getAllMembers(classElement));
- for (ExecutableElement method : methodsIn) {
- Attribute attribute = method
- .getAnnotation(Attribute.class);
- if (null != attribute) {
- TypeMirror returnType = method.getReturnType();
- String methodName = method.getSimpleName()
- .toString();
- List<? extends VariableElement> parameters = method
- .getParameters();
- Set<Modifier> modifiers = method.getModifiers();
- if (methodName.startsWith("get")
- && parameters.isEmpty()
- && modifiers.contains(Modifier.PUBLIC)) {
- // Bean getter method.
- String attributeName = methodName
- .substring(3, 4).toLowerCase()
- + methodName.substring(4);
- Property atribute = component
- .addAtribute(attributeName);
- atribute.setDescription(elementUtils
- .getDocComment(method));
- }
- }
-
- }
- }
- }
- }
- return true;
+ RoundEnvironment roundEnv) {
+ return false;
}
- private boolean isEmpty(String type) {
- return type == null || type.length()==0;
- }
}
@@ -313,38 +259,10 @@
CdkCompiler compiler = CdkCompiler.create(cdkContext);
compiler.process(ImmutableList.of(getJavaFile(COMPONENT_CLASS_JAVA)), processor);
verify(cdkContext);
- assertTrue(processor.isInitialized());
- assertEquals(1, processor.numOfComponents);
- assertEquals(1, library.getComponents().size());
- org.richfaces.cdk.model.Component component = library.getComponents().iterator().next();
- assertEquals(1, component.getAttributes().size());
-
+ assertTrue(processor.isInitialized());
}
/**
- * Test method for
- * {@link org.richfaces.cdk.apt.CdkProcessor#process(java.util.Set, javax.annotation.processing.RoundEnvironment)}
- * .
- *
- * @throws Exception
- */
- @Test
- public void testComponentProcessor() throws Exception {
- // Prepare Mock compilation context.
- CdkContext cdkContext = createMock(CdkContext.class);
- expect(cdkContext.getJavaSource()).andStubReturn(testSourceDirectory);
- expect(cdkContext.getJavaSourceOutput()).andStubReturn(null);
- expect(cdkContext.getResourceOutput()).andStubReturn(null);
- expect(cdkContext.getLoader()).andStubReturn(TestAnnotation2.class.getClassLoader());
- replay(cdkContext);
- ComponentLibrary library = new ComponentLibrary("org.richfaces.cdk.test");
- Processor processor = new ComponentProcessor(cdkContext,library);
- CdkCompiler compiler = CdkCompiler.create(cdkContext);
- compiler.process(ImmutableList.of(getJavaFile(COMPONENT_CLASS_JAVA)), processor);
- verify(cdkContext);
- }
-
- /**
* <p class="changed_added_4_0"></p>
*
* @param name
Modified: root/cdk/trunk/plugins/pom.xml
===================================================================
--- root/cdk/trunk/plugins/pom.xml 2009-08-07 18:46:54 UTC (rev 15140)
+++ root/cdk/trunk/plugins/pom.xml 2009-08-08 00:41:50 UTC (rev 15141)
@@ -1,25 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<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">
-
- <parent>
- <groupId>org.richfaces</groupId>
- <artifactId>cdk</artifactId>
- <version>4.0.0-SNAPSHOT</version>
- </parent>
-
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.cdk</groupId>
- <artifactId>maven-plugins</artifactId>
- <packaging>pom</packaging>
- <name>maven plugin CDK plugins</name>
-
-
- <modules>
- <module>generator</module>
- <module>maven-cdk-plugin</module>
- </modules>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<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">
+
+ <parent>
+ <groupId>org.richfaces</groupId>
+ <artifactId>cdk</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>maven-plugins</artifactId>
+ <packaging>pom</packaging>
+ <name>maven plugin CDK plugins</name>
+
+
+ <modules>
+ <module>generator</module>
+ <module>maven-cdk-plugin</module>
+ <module>annotations</module>
+ </modules>
+
</project>
\ No newline at end of file
15 years, 5 months
JBoss Rich Faces SVN: r15140 - in branches/community/3.3.X/docs: migrationguide/en/src/main/docbook and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: smukhina
Date: 2009-08-07 14:46:54 -0400 (Fri, 07 Aug 2009)
New Revision: 15140
Modified:
branches/community/3.3.X/docs/cdkguide/en/src/main/docbook/master.xml
branches/community/3.3.X/docs/migrationguide/en/src/main/docbook/master.xml
Log:
https://jira.jboss.org/jira/browse/RF-7641 links are updated for all guides
Modified: branches/community/3.3.X/docs/cdkguide/en/src/main/docbook/master.xml
===================================================================
--- branches/community/3.3.X/docs/cdkguide/en/src/main/docbook/master.xml 2009-08-07 17:50:20 UTC (rev 15139)
+++ branches/community/3.3.X/docs/cdkguide/en/src/main/docbook/master.xml 2009-08-07 18:46:54 UTC (rev 15140)
@@ -53,7 +53,7 @@
<!ENTITY realworld "../../realworld/html_single/index.html">
<!ENTITY tlddoc "../../tlddoc/index.html">
<!ENTITY apidoc "../../apidoc/index.html">
-<!ENTITY apidoc_framework "../../apidoc_framework/index.html"
+<!ENTITY apidoc_framework "../../apidoc_framework/index.html">
]>
Modified: branches/community/3.3.X/docs/migrationguide/en/src/main/docbook/master.xml
===================================================================
--- branches/community/3.3.X/docs/migrationguide/en/src/main/docbook/master.xml 2009-08-07 17:50:20 UTC (rev 15139)
+++ branches/community/3.3.X/docs/migrationguide/en/src/main/docbook/master.xml 2009-08-07 18:46:54 UTC (rev 15140)
@@ -34,7 +34,7 @@
<!ENTITY realworld "../../realworld/html_single/index.html">
<!ENTITY tlddoc "../../tlddoc/index.html">
<!ENTITY apidoc "../../apidoc/index.html">
- <!ENTITY apidoc_framework "../../apidoc_framework/index.html"
+ <!ENTITY apidoc_framework "../../apidoc_framework/index.html">
]>
<book>
15 years, 5 months
JBoss Rich Faces SVN: r15139 - branches/community/3.3.X/docs/photo_album_app_guide/en/src/main/docbook.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2009-08-07 13:50:20 -0400 (Fri, 07 Aug 2009)
New Revision: 15139
Modified:
branches/community/3.3.X/docs/photo_album_app_guide/en/src/main/docbook/master.xml
Log:
https://jira.jboss.org/jira/browse/RF-5768
updated
Modified: branches/community/3.3.X/docs/photo_album_app_guide/en/src/main/docbook/master.xml
===================================================================
--- branches/community/3.3.X/docs/photo_album_app_guide/en/src/main/docbook/master.xml 2009-08-07 17:49:24 UTC (rev 15138)
+++ branches/community/3.3.X/docs/photo_album_app_guide/en/src/main/docbook/master.xml 2009-08-07 17:50:20 UTC (rev 15139)
@@ -14,7 +14,6 @@
<!ENTITY shelfView SYSTEM "includes/shelfView.xml">
<!ENTITY albumView SYSTEM "includes/albumView.xml">
<!ENTITY errorsReports SYSTEM "includes/errorsReports.xml">
- <!ENTITY userPreferencesView SYSTEM "includes/userPreferencesView.xml">
<!ENTITY imageView SYSTEM "includes/imageView.xml">
<!ENTITY contextMenu SYSTEM "includes/contextMenu.xml">
<!ENTITY tooltips SYSTEM "includes/tooltips.xml">
15 years, 5 months
JBoss Rich Faces SVN: r15138 - branches/community/3.3.X/docs/photo_album_app_guide/en/src/main/docbook/modules.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2009-08-07 13:49:24 -0400 (Fri, 07 Aug 2009)
New Revision: 15138
Modified:
branches/community/3.3.X/docs/photo_album_app_guide/en/src/main/docbook/modules/getting_started.xml
branches/community/3.3.X/docs/photo_album_app_guide/en/src/main/docbook/modules/intro.xml
branches/community/3.3.X/docs/photo_album_app_guide/en/src/main/docbook/modules/overview.xml
Log:
https://jira.jboss.org/jira/browse/RF-5768
Modified: branches/community/3.3.X/docs/photo_album_app_guide/en/src/main/docbook/modules/getting_started.xml
===================================================================
--- branches/community/3.3.X/docs/photo_album_app_guide/en/src/main/docbook/modules/getting_started.xml 2009-08-07 17:47:45 UTC (rev 15137)
+++ branches/community/3.3.X/docs/photo_album_app_guide/en/src/main/docbook/modules/getting_started.xml 2009-08-07 17:49:24 UTC (rev 15138)
@@ -12,7 +12,7 @@
<title>Environment Configuration</title>
<para>
In order to download, build, modify, and deploy the Photo Album application
- you need the following installed and configured:
+ you need to have the following installed and configured:
</para>
<itemizedlist>
<listitem>
@@ -67,7 +67,7 @@
</listitem>
<listitem>
<para>
- <emphasis>Import the project into your IDE</emphasis>.
+ <emphasis>Import the project into Eclipse IDE</emphasis>.
You can just deploy Photo Album application onto the server, but
the convenient way is to import the project into your IDE.
We recommend Eclipse with JBoss Tools since this bundle is more preferable to
@@ -128,11 +128,11 @@
</tip>
</section>
<section>
- <title>Running Functional(Selenium) Tests</title>
+ <title>Running Functional(Selenium) Tests TBR</title>
<para>
- Before starting Selenium test please make sure that you have Firefox browser installed on your local machine and
- since the Photo Album application is designed to be deployed and run on JBoss Application server,
- so please make sure that the <jboss.installer.url> property of the project pom.xml (<code>examples/photoalbum/</code>) points to a existing JBoss Application server copy.
+ Before starting Selenium test please make sure that you have Firefox browser installed on your local machine, as
+ the Photo Album application is designed to be deployed and run on JBoss Application server,
+ so please make sure that the <jboss.installer.url> property of the project pom.xml (<code>examples/photoalbum/</code>) points to an existing JBoss Application server copy.
</para>
<para>
@@ -156,7 +156,7 @@
<section>
<title>Context Help</title>
<para>
- The Photo Album appellation was developed in the first place to demonstrate the mighty power of RichFaces thus most of UI elements in the application has a context help article that tells how a particular element works, providing technical details about it.
+ The Photo Album application was developed in the first place to demonstrate the mighty power of RichFaces thus most of UI elements in the application has a context help article that tells how a particular element works, providing technical details about it.
A context help article is displayed when you click on the question mark icon (
<inlinemediaobject>
<imageobject>
Modified: branches/community/3.3.X/docs/photo_album_app_guide/en/src/main/docbook/modules/intro.xml
===================================================================
--- branches/community/3.3.X/docs/photo_album_app_guide/en/src/main/docbook/modules/intro.xml 2009-08-07 17:47:45 UTC (rev 15137)
+++ branches/community/3.3.X/docs/photo_album_app_guide/en/src/main/docbook/modules/intro.xml 2009-08-07 17:49:24 UTC (rev 15138)
@@ -18,7 +18,7 @@
or shelves and shelves can not keep another shelves and can not be stored in albums.
</para>
<para>
- The Photo Album web application is designed and developed with RichFaces. This application demonstrates:
+ The Photo Album web application is designed and developed with RichFaces and by RichFaces team. This application demonstrates:
</para>
<itemizedlist>
<listitem>
Modified: branches/community/3.3.X/docs/photo_album_app_guide/en/src/main/docbook/modules/overview.xml
===================================================================
--- branches/community/3.3.X/docs/photo_album_app_guide/en/src/main/docbook/modules/overview.xml 2009-08-07 17:47:45 UTC (rev 15137)
+++ branches/community/3.3.X/docs/photo_album_app_guide/en/src/main/docbook/modules/overview.xml 2009-08-07 17:49:24 UTC (rev 15138)
@@ -7,12 +7,12 @@
</keywordset>
</chapterinfo>
- <title>Application Overview</title>
+ <title>Application Overview TBR</title>
<section id="pageFlows">
<title>Page flows</title>
<para>
- The page flow of the application is illustrated on the diagram.
+ The page flow of the application is illustrated in the diagram.
</para>
<figure>
<title>Page Flow diagram</title>
@@ -31,9 +31,8 @@
<section>
<title>Registering</title>
<para>
- Registering in is basically the first step a user takes in the application. Have a look at a piece of code from <code>\includes\index\</code>
- </para>
-
+ Registering in is basically the first step a user takes in the application if he/she wants to have access to all features of the application. Have a look at a piece of code from <code>\includes\index\index.xhtml</code>:
+ </para>
<programlisting role="XML"><![CDATA[...
<h:panelGroup rendered="#{!identity.loggedIn}" styleClass="top-right-bottom-menu-item-link" layout="block">
<h:form style="margin: 0px">
@@ -41,27 +40,36 @@
</h:form>
</h:panelGroup>
...]]></programlisting>
- <para>When the button is hit the <code>goToRegister</code> method is evoked and the <code>START_REGISTER_EVENT</code> is raised. These action display the registration form that is included from <code>\includes\register.xhtml</code>. </para>
+ <para>When the button is hit the <code>goToRegister</code> method of the <code>Authenticator</code> class is invoked and the <code>START_REGISTER_EVENT</code> is raised. These action display the registration form that is included from <code>\includes\register.xhtml</code>. </para>
-
+
<para>The <emphasis role="bold"><property><a4j:commandLink></property></emphasis> displays the link to the registration form and invokes the <code>goToRegister</code> method.
</para>
- <para>When all fields are filled out with correct values the <code>register(user)</code> is triggered and a new user is set. </para>
+ <para>When all fields are filled out with correct values the <code>authenticator.register(user)</code> is triggered and a new user object is declared. </para>
</section>
<section>
<title>Navigation Between Pages</title>
<para>
- Technically, user do not browse between pages of the application: every content page is included into the content area of <code>index.xhtml</code> file.
+ Technically, user does not browse between pages of the application: every content page is included into the content area of <code>index.xhtml</code> file after a certain action performed by user.
</para>
<programlisting role="XML"><![CDATA[...
<h:panelGroup styleClass="content_box" layout="block">
<ui:include src="#{model.mainArea.template}" />
</h:panelGroup>
...]]></programlisting>
+ <figure>
+ <title>Content Area</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/contentArea.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
<para>
- The <code>NavigationEnum</code> class encapsulated all possible states, that can be applied to content area ("mainArea") on the page.
+ The <code>NavigationEnum</code> enumeration encapsulated all possible states, that can be applied to content area ("mainArea") on the page.
</para>
@@ -89,12 +97,14 @@
...
}
]]></programlisting>
+
<para>
This class specifies which file is included depending on some user action.
- The template to be loaded is identified according to some condition in a Controller (<code>Controllor.java</code>) method and is saved to the Model (<code>Model.java</code>). During <code>index.xhtml</code> page rendering the value is taken from the Model to define what should be rendered to the page.
- </para>
- </section>
+ The template to be loaded is identified according to some condition in the Controller
+ (<code>Controllor.java</code>) class and is saved to the Model (<code>Model.java</code>). During <code>index.xhtml</code> page rendering the value is taken from the Model to define what should be rendered to the page.
+ </para>
+ </section>
</section>
<section id="dataModel">
15 years, 5 months
JBoss Rich Faces SVN: r15137 - branches/community/3.3.X/docs/photo_album_app_guide/en/src/main/docbook/includes.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2009-08-07 13:47:45 -0400 (Fri, 07 Aug 2009)
New Revision: 15137
Modified:
branches/community/3.3.X/docs/photo_album_app_guide/en/src/main/docbook/includes/navigationPanel.xml
Log:
https://jira.jboss.org/jira/browse/RF-5768
Modified: branches/community/3.3.X/docs/photo_album_app_guide/en/src/main/docbook/includes/navigationPanel.xml
===================================================================
--- branches/community/3.3.X/docs/photo_album_app_guide/en/src/main/docbook/includes/navigationPanel.xml 2009-08-07 17:47:23 UTC (rev 15136)
+++ branches/community/3.3.X/docs/photo_album_app_guide/en/src/main/docbook/includes/navigationPanel.xml 2009-08-07 17:47:45 UTC (rev 15137)
@@ -4,7 +4,7 @@
<title>Navigation tree</title>
<para>
The <emphasis role="bold"><property><rich:tree></property></emphasis> component takes one of the main places
- in the <property>Photo Album</property> and is tightly bounded with the application logic.
+ in the <property>Photo Album</property> and is tightly bound with the application logic.
It helps to represent
and implement inherently the "Shelves - Albums" hierarchy.
Shelf is the highest possible level in the tree hierarchy, that
15 years, 5 months
JBoss Rich Faces SVN: r15136 - branches/community/3.3.X/docs/photo_album_app_guide/en/src/main/docbook/includes.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2009-08-07 13:47:23 -0400 (Fri, 07 Aug 2009)
New Revision: 15136
Modified:
branches/community/3.3.X/docs/photo_album_app_guide/en/src/main/docbook/includes/skinnability.xml
Log:
https://jira.jboss.org/jira/browse/RF-5768
Modified: branches/community/3.3.X/docs/photo_album_app_guide/en/src/main/docbook/includes/skinnability.xml
===================================================================
--- branches/community/3.3.X/docs/photo_album_app_guide/en/src/main/docbook/includes/skinnability.xml 2009-08-07 17:45:14 UTC (rev 15135)
+++ branches/community/3.3.X/docs/photo_album_app_guide/en/src/main/docbook/includes/skinnability.xml 2009-08-07 17:47:23 UTC (rev 15136)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<section id="skinnability" xreflabel="skinnability">
<?dbhtml filename="skinnability.html"?>
- <title>Skinnability TBR</title>
+ <title>Skinnability</title>
<para>
The Photo Album application employs such feature of RichFaces framework as skinnability. If you have a look at the web.xml you will see that the <code>
15 years, 5 months