JBoss Rich Faces SVN: r18499 - in trunk/ui/misc: componentcontrol/src/main and 9 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-08-09 05:36:20 -0400 (Mon, 09 Aug 2010)
New Revision: 18499
Added:
trunk/ui/misc/dist/richfaces-ui-misc-ui/pom-componentcontrol.xml
trunk/ui/misc/dist/richfaces-ui-misc-ui/pom-functions.xml
trunk/ui/misc/dist/richfaces-ui-misc-ui/src/main/config/
trunk/ui/misc/dist/richfaces-ui-misc-ui/src/main/java/org/richfaces/component/
trunk/ui/misc/dist/richfaces-ui-misc-ui/src/main/java/org/richfaces/component/AbstractJQuery.java
trunk/ui/misc/dist/richfaces-ui-misc-ui/src/main/java/org/richfaces/component/JQueryAttachType.java
trunk/ui/misc/dist/richfaces-ui-misc-ui/src/main/java/org/richfaces/component/JQueryTiming.java
trunk/ui/misc/dist/richfaces-ui-misc-ui/src/main/java/org/richfaces/component/package-info-jquery.java
trunk/ui/misc/dist/richfaces-ui-misc-ui/src/main/java/org/richfaces/renderkit/
trunk/ui/misc/dist/richfaces-ui-misc-ui/src/main/java/org/richfaces/renderkit/JQueryRendererBase.java
trunk/ui/misc/dist/richfaces-ui-misc-ui/src/main/java/org/richfaces/taglib/
trunk/ui/misc/dist/richfaces-ui-misc-ui/src/main/resources/
Removed:
trunk/ui/misc/componentcontrol/pom.xml
trunk/ui/misc/componentcontrol/src/main/config/
trunk/ui/misc/componentcontrol/src/main/java/org/richfaces/component/
trunk/ui/misc/componentcontrol/src/main/java/org/richfaces/renderkit/
trunk/ui/misc/componentcontrol/src/main/java/org/richfaces/taglib/
trunk/ui/misc/componentcontrol/src/main/resources/
trunk/ui/misc/functions/pom.xml
trunk/ui/misc/jquery/src/main/java/org/richfaces/component/AbstractJQuery.java
trunk/ui/misc/jquery/src/main/java/org/richfaces/component/JQueryAttachType.java
trunk/ui/misc/jquery/src/main/java/org/richfaces/component/JQueryTiming.java
trunk/ui/misc/jquery/src/main/java/org/richfaces/component/package-info.java
trunk/ui/misc/jquery/src/main/java/org/richfaces/renderkit/JQueryRendererBase.java
Log:
Richfaces 4.0 restructurization of svn repository structure
Deleted: trunk/ui/misc/componentcontrol/pom.xml
===================================================================
--- trunk/ui/misc/componentcontrol/pom.xml 2010-08-09 09:00:57 UTC (rev 18498)
+++ trunk/ui/misc/componentcontrol/pom.xml 2010-08-09 09:36:20 UTC (rev 18499)
@@ -1,133 +0,0 @@
-<!--
- 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.
--->
-
-<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/maven-v4_0_0.xsd">
-
- <parent>
- <groupId>org.richfaces.ui.misc</groupId>
- <artifactId>richfaces-ui-misc-parent</artifactId>
- <version>4.0.0-SNAPSHOT</version>
- <relativePath>../parent/pom.xml</relativePath>
- </parent>
-
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.ui.misc</groupId>
- <artifactId>componentcontrol-ui</artifactId>
- <name>Richfaces UI Components: Component control UI</name>
- <packaging>jar</packaging>
- <build>
- <plugins>
- <plugin>
- <groupId>org.richfaces.cdk</groupId>
- <artifactId>maven-cdk-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
-
- <dependencies>
- <!-- runtime -->
- <dependency>
- <groupId>org.richfaces.core</groupId>
- <artifactId>richfaces-core-api</artifactId>
- </dependency>
- <dependency>
- <!-- todo remove this dependency or move to test scope -->
- <groupId>org.richfaces.core</groupId>
- <artifactId>richfaces-core-impl</artifactId>
- </dependency>
-
- <dependency>
- <!-- todo remove this dependency -->
- <groupId>org.richfaces.ui.core</groupId>
- <artifactId>richfaces-ui-core-ui</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.richfaces.cdk</groupId>
- <artifactId>annotations</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <!-- JSF with dependencies -->
- <dependency>
- <groupId>${jsf2.api.groupid}</groupId>
- <artifactId>${jsf2.api.artifactid}</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet.jsp</groupId>
- <artifactId>jsp-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.el</groupId>
- <artifactId>el-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>jstl</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <!-- tests -->
- <dependency>
- <groupId>${jsf2.impl.groupid}</groupId>
- <artifactId>${jsf2.impl.artifactid}</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <!-- todo api? -->
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.test-jsf</groupId>
- <artifactId>jsf-test-stage</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.test-jsf</groupId>
- <artifactId>htmlunit-client</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.test-jsf</groupId>
- <artifactId>jsf-mock</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/ui/misc/componentc...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/ui/misc/componentcontrol</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/</url>
- </scm>
-</project>
\ No newline at end of file
Copied: trunk/ui/misc/dist/richfaces-ui-misc-ui/pom-componentcontrol.xml (from rev 18498, trunk/ui/misc/componentcontrol/pom.xml)
===================================================================
--- trunk/ui/misc/dist/richfaces-ui-misc-ui/pom-componentcontrol.xml (rev 0)
+++ trunk/ui/misc/dist/richfaces-ui-misc-ui/pom-componentcontrol.xml 2010-08-09 09:36:20 UTC (rev 18499)
@@ -0,0 +1,133 @@
+<!--
+ 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.
+-->
+
+<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/maven-v4_0_0.xsd">
+
+ <parent>
+ <groupId>org.richfaces.ui.misc</groupId>
+ <artifactId>richfaces-ui-misc-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces.ui.misc</groupId>
+ <artifactId>componentcontrol-ui</artifactId>
+ <name>Richfaces UI Components: Component control UI</name>
+ <packaging>jar</packaging>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>maven-cdk-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <!-- runtime -->
+ <dependency>
+ <groupId>org.richfaces.core</groupId>
+ <artifactId>richfaces-core-api</artifactId>
+ </dependency>
+ <dependency>
+ <!-- todo remove this dependency or move to test scope -->
+ <groupId>org.richfaces.core</groupId>
+ <artifactId>richfaces-core-impl</artifactId>
+ </dependency>
+
+ <dependency>
+ <!-- todo remove this dependency -->
+ <groupId>org.richfaces.ui.core</groupId>
+ <artifactId>richfaces-ui-core-ui</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>annotations</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- JSF with dependencies -->
+ <dependency>
+ <groupId>${jsf2.api.groupid}</groupId>
+ <artifactId>${jsf2.api.artifactid}</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>jsp-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jstl</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- tests -->
+ <dependency>
+ <groupId>${jsf2.impl.groupid}</groupId>
+ <artifactId>${jsf2.impl.artifactid}</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <!-- todo api? -->
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.test-jsf</groupId>
+ <artifactId>jsf-test-stage</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.test-jsf</groupId>
+ <artifactId>htmlunit-client</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.test-jsf</groupId>
+ <artifactId>jsf-mock</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/ui/misc/componentc...</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/ui/misc/componentcontrol</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces/</url>
+ </scm>
+</project>
\ No newline at end of file
Copied: trunk/ui/misc/dist/richfaces-ui-misc-ui/pom-functions.xml (from rev 18498, trunk/ui/misc/functions/pom.xml)
===================================================================
--- trunk/ui/misc/dist/richfaces-ui-misc-ui/pom-functions.xml (rev 0)
+++ trunk/ui/misc/dist/richfaces-ui-misc-ui/pom-functions.xml 2010-08-09 09:36:20 UTC (rev 18499)
@@ -0,0 +1,127 @@
+<!--
+ 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.
+-->
+
+<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/maven-v4_0_0.xsd">
+
+ <parent>
+ <groupId>org.richfaces.ui.misc</groupId>
+ <artifactId>richfaces-ui-misc-parent</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces.ui.misc</groupId>
+ <artifactId>functions-ui</artifactId>
+ <name>Richfaces UI Components: Functions UI</name>
+ <packaging>jar</packaging>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>maven-cdk-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <!-- runtime -->
+ <dependency>
+ <groupId>org.richfaces.core</groupId>
+ <artifactId>richfaces-core-api</artifactId>
+ </dependency>
+ <dependency>
+ <!-- todo remove this dependency or move to test scope -->
+ <groupId>org.richfaces.core</groupId>
+ <artifactId>richfaces-core-impl</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>annotations</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- JSF with dependencies -->
+ <dependency>
+ <groupId>${jsf2.api.groupid}</groupId>
+ <artifactId>${jsf2.api.artifactid}</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>jsp-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jstl</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- tests -->
+ <dependency>
+ <groupId>${jsf2.impl.groupid}</groupId>
+ <artifactId>${jsf2.impl.artifactid}</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <!-- todo api? -->
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.test-jsf</groupId>
+ <artifactId>jsf-test-stage</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.test-jsf</groupId>
+ <artifactId>htmlunit-client</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.test-jsf</groupId>
+ <artifactId>jsf-mock</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/ui/misc/functions</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/ui/misc/functions</developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces/</url>
+ </scm>
+</project>
\ No newline at end of file
Copied: trunk/ui/misc/dist/richfaces-ui-misc-ui/src/main/config (from rev 18498, trunk/ui/misc/componentcontrol/src/main/config)
Copied: trunk/ui/misc/dist/richfaces-ui-misc-ui/src/main/java/org/richfaces/component (from rev 18498, trunk/ui/misc/componentcontrol/src/main/java/org/richfaces/component)
Copied: trunk/ui/misc/dist/richfaces-ui-misc-ui/src/main/java/org/richfaces/component/AbstractJQuery.java (from rev 18498, trunk/ui/misc/jquery/src/main/java/org/richfaces/component/AbstractJQuery.java)
===================================================================
--- trunk/ui/misc/dist/richfaces-ui-misc-ui/src/main/java/org/richfaces/component/AbstractJQuery.java (rev 0)
+++ trunk/ui/misc/dist/richfaces-ui-misc-ui/src/main/java/org/richfaces/component/AbstractJQuery.java 2010-08-09 09:36:20 UTC (rev 18499)
@@ -0,0 +1,63 @@
+/*
+ * 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.component;
+
+import javax.faces.component.UIComponentBase;
+
+import org.richfaces.cdk.annotations.Attribute;
+import org.richfaces.cdk.annotations.JsfComponent;
+import org.richfaces.cdk.annotations.JsfRenderer;
+
+/**
+ * @author nick
+ *
+ */
+@JsfComponent(type = AbstractJQuery.COMPONENT_TYPE, family = AbstractJQuery.COMPONENT_FAMILY,
+ renderer = @JsfRenderer(type = "org.richfaces.JQueryRenderer"))
+public abstract class AbstractJQuery extends UIComponentBase {
+
+ public static final String COMPONENT_TYPE = "org.richfaces.JQuery";
+
+ public static final String COMPONENT_FAMILY = "org.richfaces.JQuery";
+
+ //TODO nick - CDK should be doing this
+ public AbstractJQuery() {
+ setRendererType("org.richfaces.JQueryRenderer");
+ }
+
+ public abstract String getName();
+
+ public abstract String getSelector();
+
+ public abstract String getEvent();
+
+ public abstract String getQuery();
+
+ @Attribute(defaultValue = "JQueryAttachType.DEFAULT")
+ public abstract JQueryAttachType getAttachType();
+
+ @Attribute(defaultValue = "JQueryTiming.DEFAULT")
+ public abstract JQueryTiming getTiming();
+
+}
+
Copied: trunk/ui/misc/dist/richfaces-ui-misc-ui/src/main/java/org/richfaces/component/JQueryAttachType.java (from rev 18498, trunk/ui/misc/jquery/src/main/java/org/richfaces/component/JQueryAttachType.java)
===================================================================
--- trunk/ui/misc/dist/richfaces-ui-misc-ui/src/main/java/org/richfaces/component/JQueryAttachType.java (rev 0)
+++ trunk/ui/misc/dist/richfaces-ui-misc-ui/src/main/java/org/richfaces/component/JQueryAttachType.java 2010-08-09 09:36:20 UTC (rev 18499)
@@ -0,0 +1,35 @@
+/*
+ * 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.component;
+
+/**
+ * @author nick
+ *
+ */
+public enum JQueryAttachType {
+
+ bind, live, one;
+
+ public static final JQueryAttachType DEFAULT = bind;
+
+}
Copied: trunk/ui/misc/dist/richfaces-ui-misc-ui/src/main/java/org/richfaces/component/JQueryTiming.java (from rev 18498, trunk/ui/misc/jquery/src/main/java/org/richfaces/component/JQueryTiming.java)
===================================================================
--- trunk/ui/misc/dist/richfaces-ui-misc-ui/src/main/java/org/richfaces/component/JQueryTiming.java (rev 0)
+++ trunk/ui/misc/dist/richfaces-ui-misc-ui/src/main/java/org/richfaces/component/JQueryTiming.java 2010-08-09 09:36:20 UTC (rev 18499)
@@ -0,0 +1,35 @@
+/*
+ * 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.component;
+
+/**
+ * @author nick
+ *
+ */
+public enum JQueryTiming {
+
+ immediate, domready;
+
+ public static final JQueryTiming DEFAULT = domready;
+
+}
Copied: trunk/ui/misc/dist/richfaces-ui-misc-ui/src/main/java/org/richfaces/component/package-info-jquery.java (from rev 18498, trunk/ui/misc/jquery/src/main/java/org/richfaces/component/package-info.java)
===================================================================
--- trunk/ui/misc/dist/richfaces-ui-misc-ui/src/main/java/org/richfaces/component/package-info-jquery.java (rev 0)
+++ trunk/ui/misc/dist/richfaces-ui-misc-ui/src/main/java/org/richfaces/component/package-info-jquery.java 2010-08-09 09:36:20 UTC (rev 18499)
@@ -0,0 +1,26 @@
+/*
+ * 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.
+ */
+/**
+ * Implementation of RichFaces jQuery component
+ */
+(a)org.richfaces.cdk.annotations.TagLibrary(uri="http://richfaces.org/jquery", shortName="jquery")
+package org.richfaces.component;
Copied: trunk/ui/misc/dist/richfaces-ui-misc-ui/src/main/java/org/richfaces/renderkit (from rev 18498, trunk/ui/misc/componentcontrol/src/main/java/org/richfaces/renderkit)
Copied: trunk/ui/misc/dist/richfaces-ui-misc-ui/src/main/java/org/richfaces/renderkit/JQueryRendererBase.java (from rev 18498, trunk/ui/misc/jquery/src/main/java/org/richfaces/renderkit/JQueryRendererBase.java)
===================================================================
--- trunk/ui/misc/dist/richfaces-ui-misc-ui/src/main/java/org/richfaces/renderkit/JQueryRendererBase.java (rev 0)
+++ trunk/ui/misc/dist/richfaces-ui-misc-ui/src/main/java/org/richfaces/renderkit/JQueryRendererBase.java 2010-08-09 09:36:20 UTC (rev 18499)
@@ -0,0 +1,76 @@
+/*
+ * 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.renderkit;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.faces.application.ResourceDependencies;
+import javax.faces.application.ResourceDependency;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.render.Renderer;
+
+import org.ajax4jsf.javascript.ScriptUtils;
+import org.ajax4jsf.renderkit.RendererUtils;
+import org.richfaces.component.AbstractJQuery;
+import org.richfaces.component.JQueryTiming;
+import org.richfaces.component.JQueryAttachType;
+import org.richfaces.component.util.HtmlUtil;
+
+/**
+ * @author nick
+ *
+ */
+@ResourceDependencies({
+ @ResourceDependency(name = "jquery.js"),
+ @ResourceDependency(library = "org.richfaces", name = "jquery.component.js")
+})
+public abstract class JQueryRendererBase extends Renderer {
+
+ private RendererUtils rendererUtils = RendererUtils.getInstance();
+
+ protected String getEscapedSelector(FacesContext context, UIComponent component) {
+ String selector = (String) component.getAttributes().get("selector");
+
+ if (selector != null) {
+ selector = HtmlUtil.expandIdSelector(selector, component, context);
+ }
+
+ return selector;
+ }
+
+ protected String getOptionsAsJavascriptString(FacesContext context, UIComponent component) {
+ AbstractJQuery jQuery = (AbstractJQuery) component;
+
+ Map<String,Object> map = new HashMap<String, Object>();
+
+ rendererUtils.addToScriptHash(map, "selector", getEscapedSelector(context, jQuery));
+ rendererUtils.addToScriptHash(map, "event", jQuery.getEvent());
+ rendererUtils.addToScriptHash(map, "query", jQuery.getQuery());
+ rendererUtils.addToScriptHash(map, "attachType", jQuery.getAttachType(), JQueryAttachType.DEFAULT.toString());
+ rendererUtils.addToScriptHash(map, "timing", jQuery.getTiming(), JQueryTiming.DEFAULT.toString());
+
+ return ScriptUtils.toScript(map);
+ }
+}
Copied: trunk/ui/misc/dist/richfaces-ui-misc-ui/src/main/java/org/richfaces/taglib (from rev 18498, trunk/ui/misc/componentcontrol/src/main/java/org/richfaces/taglib)
Copied: trunk/ui/misc/dist/richfaces-ui-misc-ui/src/main/resources (from rev 18498, trunk/ui/misc/componentcontrol/src/main/resources)
Deleted: trunk/ui/misc/functions/pom.xml
===================================================================
--- trunk/ui/misc/functions/pom.xml 2010-08-09 09:00:57 UTC (rev 18498)
+++ trunk/ui/misc/functions/pom.xml 2010-08-09 09:36:20 UTC (rev 18499)
@@ -1,127 +0,0 @@
-<!--
- 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.
--->
-
-<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/maven-v4_0_0.xsd">
-
- <parent>
- <groupId>org.richfaces.ui.misc</groupId>
- <artifactId>richfaces-ui-misc-parent</artifactId>
- <version>4.0.0-SNAPSHOT</version>
- <relativePath>../parent/pom.xml</relativePath>
- </parent>
-
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.ui.misc</groupId>
- <artifactId>functions-ui</artifactId>
- <name>Richfaces UI Components: Functions UI</name>
- <packaging>jar</packaging>
- <build>
- <plugins>
- <plugin>
- <groupId>org.richfaces.cdk</groupId>
- <artifactId>maven-cdk-plugin</artifactId>
- </plugin>
- </plugins>
- </build>
-
- <dependencies>
- <!-- runtime -->
- <dependency>
- <groupId>org.richfaces.core</groupId>
- <artifactId>richfaces-core-api</artifactId>
- </dependency>
- <dependency>
- <!-- todo remove this dependency or move to test scope -->
- <groupId>org.richfaces.core</groupId>
- <artifactId>richfaces-core-impl</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.richfaces.cdk</groupId>
- <artifactId>annotations</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <!-- JSF with dependencies -->
- <dependency>
- <groupId>${jsf2.api.groupid}</groupId>
- <artifactId>${jsf2.api.artifactid}</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet.jsp</groupId>
- <artifactId>jsp-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.el</groupId>
- <artifactId>el-api</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>jstl</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <!-- tests -->
- <dependency>
- <groupId>${jsf2.impl.groupid}</groupId>
- <artifactId>${jsf2.impl.artifactid}</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <!-- todo api? -->
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.test-jsf</groupId>
- <artifactId>jsf-test-stage</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.test-jsf</groupId>
- <artifactId>htmlunit-client</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.test-jsf</groupId>
- <artifactId>jsf-mock</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/trunk/ui/misc/functions</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/trunk/ui/misc/functions</developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/</url>
- </scm>
-</project>
\ No newline at end of file
Deleted: trunk/ui/misc/jquery/src/main/java/org/richfaces/component/AbstractJQuery.java
===================================================================
--- trunk/ui/misc/jquery/src/main/java/org/richfaces/component/AbstractJQuery.java 2010-08-09 09:00:57 UTC (rev 18498)
+++ trunk/ui/misc/jquery/src/main/java/org/richfaces/component/AbstractJQuery.java 2010-08-09 09:36:20 UTC (rev 18499)
@@ -1,63 +0,0 @@
-/*
- * 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.component;
-
-import javax.faces.component.UIComponentBase;
-
-import org.richfaces.cdk.annotations.Attribute;
-import org.richfaces.cdk.annotations.JsfComponent;
-import org.richfaces.cdk.annotations.JsfRenderer;
-
-/**
- * @author nick
- *
- */
-@JsfComponent(type = AbstractJQuery.COMPONENT_TYPE, family = AbstractJQuery.COMPONENT_FAMILY,
- renderer = @JsfRenderer(type = "org.richfaces.JQueryRenderer"))
-public abstract class AbstractJQuery extends UIComponentBase {
-
- public static final String COMPONENT_TYPE = "org.richfaces.JQuery";
-
- public static final String COMPONENT_FAMILY = "org.richfaces.JQuery";
-
- //TODO nick - CDK should be doing this
- public AbstractJQuery() {
- setRendererType("org.richfaces.JQueryRenderer");
- }
-
- public abstract String getName();
-
- public abstract String getSelector();
-
- public abstract String getEvent();
-
- public abstract String getQuery();
-
- @Attribute(defaultValue = "JQueryAttachType.DEFAULT")
- public abstract JQueryAttachType getAttachType();
-
- @Attribute(defaultValue = "JQueryTiming.DEFAULT")
- public abstract JQueryTiming getTiming();
-
-}
-
Deleted: trunk/ui/misc/jquery/src/main/java/org/richfaces/component/JQueryAttachType.java
===================================================================
--- trunk/ui/misc/jquery/src/main/java/org/richfaces/component/JQueryAttachType.java 2010-08-09 09:00:57 UTC (rev 18498)
+++ trunk/ui/misc/jquery/src/main/java/org/richfaces/component/JQueryAttachType.java 2010-08-09 09:36:20 UTC (rev 18499)
@@ -1,35 +0,0 @@
-/*
- * 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.component;
-
-/**
- * @author nick
- *
- */
-public enum JQueryAttachType {
-
- bind, live, one;
-
- public static final JQueryAttachType DEFAULT = bind;
-
-}
Deleted: trunk/ui/misc/jquery/src/main/java/org/richfaces/component/JQueryTiming.java
===================================================================
--- trunk/ui/misc/jquery/src/main/java/org/richfaces/component/JQueryTiming.java 2010-08-09 09:00:57 UTC (rev 18498)
+++ trunk/ui/misc/jquery/src/main/java/org/richfaces/component/JQueryTiming.java 2010-08-09 09:36:20 UTC (rev 18499)
@@ -1,35 +0,0 @@
-/*
- * 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.component;
-
-/**
- * @author nick
- *
- */
-public enum JQueryTiming {
-
- immediate, domready;
-
- public static final JQueryTiming DEFAULT = domready;
-
-}
Deleted: trunk/ui/misc/jquery/src/main/java/org/richfaces/component/package-info.java
===================================================================
--- trunk/ui/misc/jquery/src/main/java/org/richfaces/component/package-info.java 2010-08-09 09:00:57 UTC (rev 18498)
+++ trunk/ui/misc/jquery/src/main/java/org/richfaces/component/package-info.java 2010-08-09 09:36:20 UTC (rev 18499)
@@ -1,26 +0,0 @@
-/*
- * 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.
- */
-/**
- * Implementation of RichFaces jQuery component
- */
-(a)org.richfaces.cdk.annotations.TagLibrary(uri="http://richfaces.org/jquery", shortName="jquery")
-package org.richfaces.component;
Deleted: trunk/ui/misc/jquery/src/main/java/org/richfaces/renderkit/JQueryRendererBase.java
===================================================================
--- trunk/ui/misc/jquery/src/main/java/org/richfaces/renderkit/JQueryRendererBase.java 2010-08-09 09:00:57 UTC (rev 18498)
+++ trunk/ui/misc/jquery/src/main/java/org/richfaces/renderkit/JQueryRendererBase.java 2010-08-09 09:36:20 UTC (rev 18499)
@@ -1,76 +0,0 @@
-/*
- * 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.renderkit;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.faces.application.ResourceDependencies;
-import javax.faces.application.ResourceDependency;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.render.Renderer;
-
-import org.ajax4jsf.javascript.ScriptUtils;
-import org.ajax4jsf.renderkit.RendererUtils;
-import org.richfaces.component.AbstractJQuery;
-import org.richfaces.component.JQueryTiming;
-import org.richfaces.component.JQueryAttachType;
-import org.richfaces.component.util.HtmlUtil;
-
-/**
- * @author nick
- *
- */
-@ResourceDependencies({
- @ResourceDependency(name = "jquery.js"),
- @ResourceDependency(library = "org.richfaces", name = "jquery.component.js")
-})
-public abstract class JQueryRendererBase extends Renderer {
-
- private RendererUtils rendererUtils = RendererUtils.getInstance();
-
- protected String getEscapedSelector(FacesContext context, UIComponent component) {
- String selector = (String) component.getAttributes().get("selector");
-
- if (selector != null) {
- selector = HtmlUtil.expandIdSelector(selector, component, context);
- }
-
- return selector;
- }
-
- protected String getOptionsAsJavascriptString(FacesContext context, UIComponent component) {
- AbstractJQuery jQuery = (AbstractJQuery) component;
-
- Map<String,Object> map = new HashMap<String, Object>();
-
- rendererUtils.addToScriptHash(map, "selector", getEscapedSelector(context, jQuery));
- rendererUtils.addToScriptHash(map, "event", jQuery.getEvent());
- rendererUtils.addToScriptHash(map, "query", jQuery.getQuery());
- rendererUtils.addToScriptHash(map, "attachType", jQuery.getAttachType(), JQueryAttachType.DEFAULT.toString());
- rendererUtils.addToScriptHash(map, "timing", jQuery.getTiming(), JQueryTiming.DEFAULT.toString());
-
- return ScriptUtils.toScript(map);
- }
-}
15 years, 9 months
JBoss Rich Faces SVN: r18498 - in trunk/ui/misc: functions and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-08-09 05:00:57 -0400 (Mon, 09 Aug 2010)
New Revision: 18498
Added:
trunk/ui/misc/dist/richfaces-ui-misc-ui/src/
Removed:
trunk/ui/misc/functions/src/
Log:
Richfaces 4.0 restructurization of svn repository structure
Copied: trunk/ui/misc/dist/richfaces-ui-misc-ui/src (from rev 18497, trunk/ui/misc/functions/src)
15 years, 9 months
JBoss Rich Faces SVN: r18497 - branches/development/docs/Component_Reference/src/main/docbook/en-US.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2010-08-09 00:18:49 -0400 (Mon, 09 Aug 2010)
New Revision: 18497
Modified:
branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Layout_and_appearance.xml
Log:
rich:jQuery started
Modified: branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Layout_and_appearance.xml
===================================================================
--- branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Layout_and_appearance.xml 2010-08-06 18:49:36 UTC (rev 18496)
+++ branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Layout_and_appearance.xml 2010-08-09 04:18:49 UTC (rev 18497)
@@ -57,8 +57,40 @@
The <sgmltag><rich:jQuery></sgmltag> component applies styles and custom behavior to both <acronym>JSF</acronym> (JavaServer Faces) objects and regular <acronym>DOM</acronym> (Document Object Model) objects. It uses the <phrase>jQuery</phrase> JavaScript framework to add functionality without conflicting with the <filename>prototype.js</filename> library.
</para>
<para>
-
+ The query triggered by the <sgmltag><rich:jQuery></sgmltag> component is specified using the <varname>query</varname> attribute. Any objects or lists of objects used in the query are specified using the <varname>selector</varname> attribute. The <varname>selector</varname> attribute uses syntax defined by the <orgname>World Wide Web Consortium (<acronym>W3C</acronym>)</orgname> for the <acronym>CSS</acronym> rule selector.
</para>
+ <para>
+ The query can be triggered in three different ways. Use the <varname>timing</varname> attribute to specify the point at which the query is triggered:
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term><literal>immediate</literal></term>
+ <listitem>
+ <para>
+ The query is triggered immediately.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><literal>onload</literal></term>
+ <listitem>
+ <para>
+ The query is triggered when the document is loaded.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><literal>onJScall</literal></term>
+ <listitem>
+ <para>
+ The query is triggered when a JavaScript function is invoked. The JavaScript function is specified using the <varname>name</varname> attribute.
+ </para>
+ <para>
+ If the <varname>name</varname> attribute is included when the <varname>timing</varname> attribute is set to either <literal>immediate</literal> or <literal>onload</literal>, the query can be triggered using the JavaScript function <emphasis>in addition</emphasis> to the specified trigger timing.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
</section>
<!-- TODO not in M2 -->
15 years, 9 months
JBoss Rich Faces SVN: r18496 - in root/sandbox/ui: notify and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-08-06 14:49:36 -0400 (Fri, 06 Aug 2010)
New Revision: 18496
Modified:
root/sandbox/ui/notify/demo/pom.xml
root/sandbox/ui/notify/pom.xml
root/sandbox/ui/notify/ui/pom.xml
root/sandbox/ui/pom.xml
root/sandbox/ui/schedule/demo/pom.xml
root/sandbox/ui/schedule/pom.xml
root/sandbox/ui/schedule/ui/pom.xml
Log:
Fixed build problems in sandbox/ui
Modified: root/sandbox/ui/notify/demo/pom.xml
===================================================================
--- root/sandbox/ui/notify/demo/pom.xml 2010-08-06 18:31:28 UTC (rev 18495)
+++ root/sandbox/ui/notify/demo/pom.xml 2010-08-06 18:49:36 UTC (rev 18496)
@@ -8,6 +8,7 @@
<groupId>org.richfaces.ui.notify</groupId>
<artifactId>richfaces-ui-notify-parent</artifactId>
<version>4.0.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.ui.notify</groupId>
Modified: root/sandbox/ui/notify/pom.xml
===================================================================
--- root/sandbox/ui/notify/pom.xml 2010-08-06 18:31:28 UTC (rev 18495)
+++ root/sandbox/ui/notify/pom.xml 2010-08-06 18:49:36 UTC (rev 18496)
@@ -1,80 +1,80 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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.
- -->
-<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>
-
- <parent>
- <groupId>org.richfaces</groupId>
- <artifactId>richfaces-parent</artifactId>
- <version>7</version>
- </parent>
-
- <groupId>org.richfaces.ui.notify</groupId>
- <artifactId>notify-aggregator</artifactId>
- <version>4.0.0-SNAPSHOT</version>
- <packaging>pom</packaging>
- <name>Richfaces UI Components: notify Aggregator</name>
-
- <modules>
- <module>bom</module>
- <module>parent</module>
- <module>ui</module>
- <module>demo</module>
- </modules>
-
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-release-plugin</artifactId>
- <configuration>
- <!-- The dist requires clean install for prepare -->
- <preparationGoals>clean install</preparationGoals>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-release-plugin</artifactId>
- <configuration>
- <!-- The dist requires clean install for prepare -->
- <preparationGoals>clean install</preparationGoals>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-enforcer-plugin</artifactId>
- <version>1.0-beta-1</version>
- <configuration>
- <fail>false</fail>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+ -->
+<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>
+
+ <parent>
+ <groupId>org.richfaces</groupId>
+ <artifactId>richfaces-parent</artifactId>
+ <version>9</version>
+ </parent>
+
+ <groupId>org.richfaces.ui.notify</groupId>
+ <artifactId>notify-aggregator</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+ <name>Richfaces UI Components: notify Aggregator</name>
+
+ <modules>
+ <module>bom</module>
+ <module>parent</module>
+ <module>ui</module>
+ <module>demo</module>
+ </modules>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-release-plugin</artifactId>
+ <configuration>
+ <!-- The dist requires clean install for prepare -->
+ <preparationGoals>clean install</preparationGoals>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-release-plugin</artifactId>
+ <configuration>
+ <!-- The dist requires clean install for prepare -->
+ <preparationGoals>clean install</preparationGoals>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <version>1.0-beta-1</version>
+ <configuration>
+ <fail>false</fail>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
</project>
\ No newline at end of file
Modified: root/sandbox/ui/notify/ui/pom.xml
===================================================================
--- root/sandbox/ui/notify/ui/pom.xml 2010-08-06 18:31:28 UTC (rev 18495)
+++ root/sandbox/ui/notify/ui/pom.xml 2010-08-06 18:49:36 UTC (rev 18496)
@@ -31,6 +31,7 @@
<groupId>org.richfaces.ui.notify</groupId>
<artifactId>richfaces-ui-notify-parent</artifactId>
<version>4.0.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.ui.notify</groupId>
Modified: root/sandbox/ui/pom.xml
===================================================================
--- root/sandbox/ui/pom.xml 2010-08-06 18:31:28 UTC (rev 18495)
+++ root/sandbox/ui/pom.xml 2010-08-06 18:49:36 UTC (rev 18496)
@@ -36,6 +36,7 @@
<name>Richfaces UI Components Sandbox Aggregator</name>
<modules>
- <module>inputs/trunk</module>
+ <module>notify</module>
+ <module>schedule</module>
</modules>
</project>
Modified: root/sandbox/ui/schedule/demo/pom.xml
===================================================================
--- root/sandbox/ui/schedule/demo/pom.xml 2010-08-06 18:31:28 UTC (rev 18495)
+++ root/sandbox/ui/schedule/demo/pom.xml 2010-08-06 18:49:36 UTC (rev 18496)
@@ -8,6 +8,7 @@
<groupId>org.richfaces.ui.schedule</groupId>
<artifactId>richfaces-ui-schedule-parent</artifactId>
<version>4.0.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.ui.schedule</groupId>
Modified: root/sandbox/ui/schedule/pom.xml
===================================================================
--- root/sandbox/ui/schedule/pom.xml 2010-08-06 18:31:28 UTC (rev 18495)
+++ root/sandbox/ui/schedule/pom.xml 2010-08-06 18:49:36 UTC (rev 18496)
@@ -1,99 +1,99 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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.
- -->
-
-<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>
-
- <parent>
- <groupId>org.richfaces</groupId>
- <artifactId>richfaces-parent</artifactId>
- <version>7</version>
- </parent>
-
- <groupId>org.richfaces.ui.schedule</groupId>
- <artifactId>richfaces-ui-schedule-aggregator</artifactId>
- <version>4.0.0-SNAPSHOT</version>
- <packaging>pom</packaging>
- <name>Richfaces UI Components: Schedule Aggregator</name>
-
- <modules>
- <module>bom</module>
- <module>parent</module>
- <module>ui</module>
- <module>demo</module>
- </modules>
-
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-release-plugin</artifactId>
- <configuration>
- <!--
- The dist requires clean install for prepare
- -->
- <preparationGoals>clean install</preparationGoals>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.richfaces.cdk</groupId>
- <artifactId>maven-cdk-plugin</artifactId>
- </plugin>
-
- <plugin>
- <artifactId>maven-checkstyle-plugin</artifactId>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-enforcer-plugin</artifactId>
- <version>1.0-beta-1</version>
- <configuration>
- <fail>false</fail>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-release-plugin</artifactId>
- <configuration>
- <!-- The dist requires clean install for prepare -->
- <preparationGoals>clean install</preparationGoals>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/root/ui-sandbox/schedul/...</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/root/ui-sandbox/schedule/trunk
- </developerConnection>
- <url>http://fisheye.jboss.org/browse/richfaces/</url>
- </scm>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+ -->
+
+<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>
+
+ <parent>
+ <groupId>org.richfaces</groupId>
+ <artifactId>richfaces-parent</artifactId>
+ <version>9</version>
+ </parent>
+
+ <groupId>org.richfaces.ui.schedule</groupId>
+ <artifactId>richfaces-ui-schedule-aggregator</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+ <name>Richfaces UI Components: Schedule Aggregator</name>
+
+ <modules>
+ <module>bom</module>
+ <module>parent</module>
+ <module>ui</module>
+ <module>demo</module>
+ </modules>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-release-plugin</artifactId>
+ <configuration>
+ <!--
+ The dist requires clean install for prepare
+ -->
+ <preparationGoals>clean install</preparationGoals>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>maven-cdk-plugin</artifactId>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <version>1.0-beta-1</version>
+ <configuration>
+ <fail>false</fail>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-release-plugin</artifactId>
+ <configuration>
+ <!-- The dist requires clean install for prepare -->
+ <preparationGoals>clean install</preparationGoals>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/richfaces/root/ui-sandbox/schedul/...</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/richfaces/root/ui-sandbox/schedule/trunk
+ </developerConnection>
+ <url>http://fisheye.jboss.org/browse/richfaces/</url>
+ </scm>
+
+</project>
Modified: root/sandbox/ui/schedule/ui/pom.xml
===================================================================
--- root/sandbox/ui/schedule/ui/pom.xml 2010-08-06 18:31:28 UTC (rev 18495)
+++ root/sandbox/ui/schedule/ui/pom.xml 2010-08-06 18:49:36 UTC (rev 18496)
@@ -7,6 +7,7 @@
<groupId>org.richfaces.ui.schedule</groupId>
<artifactId>richfaces-ui-schedule-parent</artifactId>
<version>4.0.0-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
</parent>
<groupId>org.richfaces.ui.schedule</groupId>
<artifactId>richfaces-ui-schedule-ui</artifactId>
15 years, 9 months
JBoss Rich Faces SVN: r18495 - in root/sandbox/cdk/maven-resources-plugin: src/it/richfaces-application and 10 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-08-06 14:31:28 -0400 (Fri, 06 Aug 2010)
New Revision: 18495
Added:
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/strings/
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/strings/Constants.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/VFS.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/VFSRoot.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/VFSType.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/VirtualFile.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/file/
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/file/FileVFSFile.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/file/FileVFSRoot.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/zip/
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/zip/ZipNode.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/zip/ZipVFSFile.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/zip/ZipVFSRoot.java
Removed:
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/util/ClasspathUtil.java
Modified:
root/sandbox/cdk/maven-resources-plugin/pom.xml
root/sandbox/cdk/maven-resources-plugin/src/it/richfaces-application/pom.xml
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/ProcessMojo.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/ResourceTaskFactory.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/faces/ResourceELResolver.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/ResourceUtil.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/ResourceWriterImpl.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/DynamicResourceWrapper.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/StaticResourceHandler.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/VFSResource.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/scan/impl/DynamicResourcesScanner.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/scan/impl/StaticResourcesScanner.java
Log:
Dynamic resources prerenderer: latest changes check-in
Modified: root/sandbox/cdk/maven-resources-plugin/pom.xml
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/pom.xml 2010-08-06 10:04:44 UTC (rev 18494)
+++ root/sandbox/cdk/maven-resources-plugin/pom.xml 2010-08-06 18:31:28 UTC (rev 18495)
@@ -104,19 +104,6 @@
<artifactId>slf4j-simple</artifactId>
<version>1.5.8</version>
</dependency>
-
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-vfs</artifactId>
- <version>3.0.0.CR5</version>
- </dependency>
-
- <!-- TODO use maven logging -->
- <dependency>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-log4j</artifactId>
- <version>2.2.0.CR1</version>
- </dependency>
</dependencies>
<build>
Modified: root/sandbox/cdk/maven-resources-plugin/src/it/richfaces-application/pom.xml
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/it/richfaces-application/pom.xml 2010-08-06 10:04:44 UTC (rev 18494)
+++ root/sandbox/cdk/maven-resources-plugin/src/it/richfaces-application/pom.xml 2010-08-06 18:31:28 UTC (rev 18495)
@@ -36,16 +36,20 @@
<include>text/css</include>
<include>image/.+</include>
</includedContentTypes>
- <!-- fileNameMappings>
+ <fileNameMappings>
<property>
- <name>^org\.richfaces\.renderkit\.html\.(images\.)?</name>
+ <name>^\Qorg.richfaces.renderkit.html\E</name>
<value>org.richfaces/images/</value>
</property>
<property>
+ <name>^\Qorg.richfaces.renderkit.html.images\E</name>
+ <value>org.richfaces/images/</value>
+ </property>
+ <property>
<name>^css/</name>
<value>org.richfaces/css/</value>
</property>
- </fileNameMappings -->
+ </fileNameMappings>
</configuration>
</execution>
</executions>
Modified: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/ProcessMojo.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/ProcessMojo.java 2010-08-06 10:04:44 UTC (rev 18494)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/ProcessMojo.java 2010-08-06 18:31:28 UTC (rev 18495)
@@ -26,10 +26,13 @@
import static com.google.common.collect.Collections2.transform;
import java.io.File;
+import java.io.IOException;
import java.net.MalformedURLException;
+import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Collection;
+import java.util.Collections;
import java.util.List;
import java.util.Locale;
import java.util.Properties;
@@ -47,7 +50,7 @@
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.project.MavenProject;
-import org.jboss.vfs.VirtualFile;
+import org.reflections.util.ClasspathHelper;
import org.richfaces.cdk.concurrent.CountingExecutorCompletionService;
import org.richfaces.cdk.faces.FacesImpl;
import org.richfaces.cdk.naming.FileNameMapperImpl;
@@ -59,9 +62,11 @@
import org.richfaces.cdk.resource.scan.impl.DynamicResourcesScanner;
import org.richfaces.cdk.resource.scan.impl.StaticResourcesScanner;
import org.richfaces.cdk.task.ResourceTaskFactoryImpl;
-import org.richfaces.cdk.util.ClasspathUtil;
import org.richfaces.cdk.util.MoreConstraints;
import org.richfaces.cdk.util.MorePredicates;
+import org.richfaces.cdk.vfs.VFS;
+import org.richfaces.cdk.vfs.VFSRoot;
+import org.richfaces.cdk.vfs.VirtualFile;
import com.google.common.base.Function;
import com.google.common.base.Predicate;
@@ -159,7 +164,7 @@
// TODO executor parameters
private static ExecutorService createExecutorService() {
- return Executors.newSingleThreadExecutor();
+ return Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors());
}
private Predicate<Resource> createResourcesFilter() {
@@ -180,8 +185,8 @@
return result.toURI().toURL();
}
- private void scanDynamicResources(Collection<URL> cpUrls) throws Exception {
- ResourcesScanner scanner = new DynamicResourcesScanner(cpUrls);
+ private void scanDynamicResources(Collection<VFSRoot> cpFiles) throws Exception {
+ ResourcesScanner scanner = new DynamicResourcesScanner(cpFiles);
scanner.scan();
foundResources.addAll(scanner.getResources());
}
@@ -192,6 +197,30 @@
foundResources.addAll(scanner.getResources());
}
+ private Collection<VFSRoot> fromUrls(Iterable<URL> urls) throws URISyntaxException, IOException {
+ Collection<VFSRoot> result = Lists.newArrayList();
+
+ for (URL url : urls) {
+ if (url == null) {
+ continue;
+ }
+
+ VFSRoot vfsRoot = VFS.getRoot(url);
+ vfsRoot.initialize();
+ result.add(vfsRoot);
+ }
+
+ return result;
+ }
+
+ private Collection<VFSRoot> getClasspathVfs() throws URISyntaxException, IOException {
+ return fromUrls(ClasspathHelper.getUrlsForCurrentClasspath());
+ }
+
+ private Collection<VFSRoot> getWebrootVfs() throws URISyntaxException, IOException {
+ return fromUrls(Collections.singletonList(resolveWebRoot()));
+ }
+
protected ClassLoader createProjectClassLoader(MavenProject project, boolean useCCL) {
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
@@ -215,23 +244,25 @@
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
-
ClassLoader cCL = Thread.currentThread().getContextClassLoader();
Faces faces = null;
ExecutorService executorService = null;
+
+ Collection<VFSRoot> webResources = null;
+ Collection<VFSRoot> cpResources = null;
+
+ try {
+ ClassLoader projectCL = createProjectClassLoader(project, true);
+ Thread.currentThread().setContextClassLoader(projectCL);
- try {
- URL webRootUrl = resolveWebRoot();
+ webResources = getWebrootVfs();
+ cpResources = getClasspathVfs();
+
+ Collection<VirtualFile> resourceRoots = ResourceUtil.getResourceRoots(cpResources, webResources);
- Collection<URL> cpUrls = ClasspathUtil.getFacesClasspathUrls();
- Collection<VirtualFile> resourceRoots = ResourceUtil.getResourceRoots(cpUrls, webRootUrl);
-
- scanDynamicResources(cpUrls);
+ scanDynamicResources(cpResources);
scanStaticResources(resourceRoots);
- ClassLoader projectCL = createProjectClassLoader(project, true);
- Thread.currentThread().setContextClassLoader(projectCL);
-
File outputDirFile = new File(outputDir);
if (!outputDirFile.exists()) {
outputDirFile = new File(project.getBuild().getDirectory(), outputDir);
@@ -274,6 +305,29 @@
} catch (Exception e) {
throw new MojoExecutionException(e.getMessage(), e);
} finally {
+
+ if (cpResources != null) {
+ for (VFSRoot vfsRoot : cpResources) {
+ try {
+ vfsRoot.close();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ }
+
+ if (webResources != null) {
+ for (VFSRoot vfsRoot : cpResources) {
+ try {
+ vfsRoot.close();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ }
+
// TODO review finally block
if (executorService != null) {
executorService.shutdown();
Modified: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/ResourceTaskFactory.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/ResourceTaskFactory.java 2010-08-06 10:04:44 UTC (rev 18494)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/ResourceTaskFactory.java 2010-08-06 18:31:28 UTC (rev 18495)
@@ -25,7 +25,6 @@
import javax.faces.application.Resource;
-
import com.google.common.base.Predicate;
/**
Modified: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/faces/ResourceELResolver.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/faces/ResourceELResolver.java 2010-08-06 10:04:44 UTC (rev 18494)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/faces/ResourceELResolver.java 2010-08-06 18:31:28 UTC (rev 18495)
@@ -21,6 +21,9 @@
*/
package org.richfaces.cdk.faces;
+import static org.richfaces.cdk.strings.Constants.SLASH_JOINER;
+import static org.richfaces.cdk.strings.Constants.SLASH_SPLITTER;
+
import java.beans.FeatureDescriptor;
import java.text.MessageFormat;
import java.util.Iterator;
@@ -34,8 +37,6 @@
import javax.faces.application.ResourceHandler;
import javax.faces.context.FacesContext;
-import com.google.common.base.Joiner;
-import com.google.common.base.Splitter;
import com.google.common.collect.Lists;
/**
@@ -67,8 +68,8 @@
}
private String relativize(String path, String basePath) {
- Iterator<String> pathItr = Splitter.on('/').split(path).iterator();
- Iterator<String> basePathItr = Splitter.on('/').split(basePath).iterator();
+ Iterator<String> pathItr = SLASH_SPLITTER.split(path).iterator();
+ Iterator<String> basePathItr = SLASH_SPLITTER.split(basePath).iterator();
List<String> resultPathSegments = Lists.newArrayList();
String firstNonMatchedSegment = skipEqualPathSegments(pathItr, basePathItr);
@@ -85,7 +86,7 @@
resultPathSegments.add(pathItr.next());
}
- return Joiner.on('/').join(resultPathSegments);
+ return SLASH_JOINER.join(resultPathSegments);
}
public Object getValue(ELContext context, Object base, Object property) {
Modified: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/ResourceUtil.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/ResourceUtil.java 2010-08-06 10:04:44 UTC (rev 18494)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/ResourceUtil.java 2010-08-06 18:31:28 UTC (rev 18495)
@@ -21,22 +21,19 @@
*/
package org.richfaces.cdk.resource;
+import static org.richfaces.cdk.strings.Constants.DOT_JOINER;
+
import java.io.IOException;
import java.net.URISyntaxException;
-import java.net.URL;
import java.util.Collection;
import java.util.Comparator;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import org.jboss.vfs.VFS;
-import org.jboss.vfs.VirtualFile;
-import org.jboss.vfs.util.automount.Automounter;
+import org.richfaces.cdk.vfs.VFSRoot;
+import org.richfaces.cdk.vfs.VirtualFile;
-import com.google.common.base.Joiner;
-import com.google.common.base.Predicates;
-import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.google.common.collect.Ordering;
import com.google.common.primitives.Ints;
@@ -65,8 +62,6 @@
}
}).nullsFirst();
- private static final Joiner DOT_JOINER = Joiner.on('.').skipNulls();
-
private String version;
private int[] versionVector;
@@ -98,7 +93,7 @@
public static VirtualFile getLatestVersion(VirtualFile file, boolean library) {
VersionKey latestVersionKey = null;
- List<VirtualFile> children = file.getChildren();
+ Collection<VirtualFile> children = file.getChildren();
for (VirtualFile child : children) {
if (library && child.isDirectory()) {
Matcher matcher = LIBRARY_VERSION_PATTERN.matcher(child.getName());
@@ -121,38 +116,32 @@
result = file;
}
- if (result.exists() && (library ^ result.isFile())) {
+ if (result != null && (library ^ result.isFile())) {
return result;
}
return null;
}
- private static VirtualFile getExistingChild(URL rootUrl, String path) throws URISyntaxException, IOException {
- VirtualFile root = VFS.getChild(rootUrl);
- Automounter.mount(root);
- VirtualFile child = root.getChild(path);
- if (child.exists()) {
- return child;
+ private static Collection<VirtualFile> getExistingChildren(Iterable<VFSRoot> files, String path) throws URISyntaxException, IOException {
+ Collection<VirtualFile> result = Lists.newArrayList();
+
+ for (VirtualFile file: files) {
+ VirtualFile child = file.getChild(path, true);
+ if (child != null) {
+ result.add(child);
+ }
}
- return null;
+ return result;
}
- public static Collection<VirtualFile> getResourceRoots(Iterable<URL> cpUrls, URL webrootUrl) throws URISyntaxException, IOException {
- Collection<VirtualFile> result = Lists.newArrayList();
-
- for (URL url : cpUrls) {
- result.add(getExistingChild(url, CLASSPATH_RESOURCES_LOCATION));
- }
+ public static Collection<VirtualFile> getResourceRoots(Iterable<VFSRoot> cpRoots, Iterable<VFSRoot> webRoots) throws URISyntaxException, IOException {
+ List<VirtualFile> result = Lists.newArrayList();
- if (webrootUrl != null) {
- result.add(getExistingChild(webrootUrl, WEB_RESOURCES_LOCATION));
- }
+ result.addAll(getExistingChildren(cpRoots, CLASSPATH_RESOURCES_LOCATION));
+ result.addAll(getExistingChildren(webRoots, WEB_RESOURCES_LOCATION));
- Iterables.removeIf(result, Predicates.isNull());
-
return result;
}
-
}
Modified: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/ResourceWriterImpl.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/ResourceWriterImpl.java 2010-08-06 10:04:44 UTC (rev 18494)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/ResourceWriterImpl.java 2010-08-06 18:31:28 UTC (rev 18495)
@@ -21,6 +21,8 @@
*/
package org.richfaces.cdk.resource;
+import static org.richfaces.cdk.strings.Constants.COLON_JOINER;
+
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
@@ -35,7 +37,6 @@
import org.richfaces.cdk.FileNameMapper;
import org.richfaces.cdk.ResourceWriter;
-import com.google.common.base.Joiner;
import com.google.common.base.Strings;
import com.google.common.io.ByteStreams;
@@ -55,7 +56,7 @@
}
private String getResourceQualifier(Resource resource) {
- return Joiner.on(':').skipNulls().join(resource.getLibraryName(), resource.getResourceName());
+ return COLON_JOINER.join(resource.getLibraryName(), resource.getResourceName());
}
private FileNameMapper getFileNameMapper() {
Modified: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/DynamicResourceWrapper.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/DynamicResourceWrapper.java 2010-08-06 10:04:44 UTC (rev 18494)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/DynamicResourceWrapper.java 2010-08-06 18:31:28 UTC (rev 18495)
@@ -21,6 +21,10 @@
*/
package org.richfaces.cdk.resource.handler.impl;
+import static org.richfaces.cdk.strings.Constants.DASH_JOINER;
+import static org.richfaces.cdk.strings.Constants.DOT_JOINER;
+import static org.richfaces.cdk.strings.Constants.SLASH_JOINER;
+
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
@@ -31,7 +35,6 @@
import org.richfaces.resource.VersionedResource;
-import com.google.common.base.Joiner;
import com.google.common.base.Strings;
/**
@@ -45,12 +48,6 @@
*/
private static final String ECSS_EXTENSION = ".ecss";
- private static final Joiner SLASH_JOINER = Joiner.on('/').skipNulls();
-
- private static final Joiner DOT_JOINER = Joiner.on('.').skipNulls();
-
- private static final Joiner DASH_JOINER = Joiner.on('-').skipNulls();
-
private Resource resource;
public DynamicResourceWrapper(Resource resource) {
Modified: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/StaticResourceHandler.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/StaticResourceHandler.java 2010-08-06 10:04:44 UTC (rev 18494)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/StaticResourceHandler.java 2010-08-06 18:31:28 UTC (rev 18495)
@@ -27,8 +27,8 @@
import javax.activation.MimetypesFileTypeMap;
import javax.faces.application.Resource;
-import org.jboss.vfs.VirtualFile;
import org.richfaces.cdk.resource.ResourceUtil;
+import org.richfaces.cdk.vfs.VirtualFile;
import com.google.common.base.Strings;
@@ -48,7 +48,7 @@
private VirtualFile findLibrary(String libraryName) {
for (VirtualFile file : roots) {
VirtualFile child = file.getChild(libraryName);
- if (!child.exists()) {
+ if (child == null) {
continue;
}
@@ -64,7 +64,7 @@
private VirtualFile findResource(Collection<VirtualFile> libraryDirs, String resourceName) {
for (VirtualFile libraryDir : libraryDirs) {
VirtualFile child = libraryDir.getChild(resourceName);
- if (child.exists()) {
+ if (child != null) {
VirtualFile resource = ResourceUtil.getLatestVersion(child, false);
if (resource != null) {
return resource;
@@ -89,7 +89,7 @@
VirtualFile resource = findResource(libraryDirs, resourceName);
if (resource != null) {
- Resource result = new VFSResource(resource, getRelativePath(resource));
+ Resource result = new VFSResource(resource, resource.getRelativePath());
result.setResourceName(resourceName);
result.setLibraryName(libraryName);
@@ -107,14 +107,4 @@
return null;
}
- private String getRelativePath(VirtualFile resource) {
- String relativePath = null;
- for (VirtualFile parent : resource.getParentFileList()) {
- if (roots.contains(parent)) {
- relativePath = resource.getPathNameRelativeTo(parent);
- break;
- }
- }
- return relativePath;
- }
}
Modified: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/VFSResource.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/VFSResource.java 2010-08-06 10:04:44 UTC (rev 18494)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/VFSResource.java 2010-08-06 18:31:28 UTC (rev 18495)
@@ -29,7 +29,7 @@
import javax.faces.application.Resource;
import javax.faces.context.FacesContext;
-import org.jboss.vfs.VirtualFile;
+import org.richfaces.cdk.vfs.VirtualFile;
/**
* @author Nick Belaevski
@@ -53,7 +53,7 @@
@Override
public InputStream getInputStream() throws IOException {
- return file.openStream();
+ return file.getInputStream();
}
@Override
Modified: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/scan/impl/DynamicResourcesScanner.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/scan/impl/DynamicResourcesScanner.java 2010-08-06 10:04:44 UTC (rev 18494)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/scan/impl/DynamicResourcesScanner.java 2010-08-06 18:31:28 UTC (rev 18495)
@@ -21,6 +21,7 @@
*/
package org.richfaces.cdk.resource.scan.impl;
+import java.io.IOException;
import java.net.URL;
import java.util.Collection;
import java.util.Set;
@@ -32,6 +33,8 @@
import org.richfaces.cdk.resource.scan.ResourcesScanner;
import org.richfaces.cdk.resource.scan.impl.reflections.MarkerResourcesScanner;
import org.richfaces.cdk.resource.scan.impl.reflections.ReflectionsExt;
+import org.richfaces.cdk.vfs.VFSRoot;
+import org.richfaces.cdk.vfs.VFSType;
import org.richfaces.resource.DynamicResource;
import com.google.common.base.Function;
@@ -55,17 +58,29 @@
private Collection<ResourceKey> resources = Sets.newHashSet();
- private Collection<URL> urls;
+ private Collection<VFSRoot> cpFiles;
- public DynamicResourcesScanner(Collection<URL> urls) {
+ public DynamicResourcesScanner(Collection<VFSRoot> cpFiles) {
super();
- this.urls = urls;
+ this.cpFiles = cpFiles;
}
- public void scan() {
+ public void scan() throws IOException {
+ Collection<URL> urls = Sets.newHashSet();
+ for (VFSRoot cpFile : cpFiles) {
+ if (cpFile.getType() == VFSType.zip) {
+ if (cpFile.getChild("META-INF/faces-config.xml") == null) {
+ continue;
+ }
+ }
+
+ URL url = cpFile.toURL();
+ urls.add(url);
+ }
+
ConfigurationBuilder configurationBuilder = new ConfigurationBuilder().setUrls(urls);
configurationBuilder.setScanners(new SubTypesScanner(), new TypeAnnotationsScanner(),
- new MarkerResourcesScanner());
+ new MarkerResourcesScanner()).useParallelExecutor();
ReflectionsExt refl = new ReflectionsExt(configurationBuilder);
Set<Class<?>> allClasses = Sets.newHashSet();
Modified: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/scan/impl/StaticResourcesScanner.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/scan/impl/StaticResourcesScanner.java 2010-08-06 10:04:44 UTC (rev 18494)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/scan/impl/StaticResourcesScanner.java 2010-08-06 18:31:28 UTC (rev 18495)
@@ -22,12 +22,11 @@
package org.richfaces.cdk.resource.scan.impl;
import java.util.Collection;
-import java.util.List;
-import org.jboss.vfs.VirtualFile;
import org.richfaces.cdk.ResourceKey;
import org.richfaces.cdk.resource.ResourceUtil;
import org.richfaces.cdk.resource.scan.ResourcesScanner;
+import org.richfaces.cdk.vfs.VirtualFile;
import com.google.common.collect.Sets;
@@ -50,7 +49,7 @@
return;
}
- List<VirtualFile> children = file.getChildren();
+ Collection<VirtualFile> children = file.getChildren();
for (VirtualFile child : children) {
if (child.isFile()) {
resources.add(new ResourceKey(child.getName()));
@@ -65,7 +64,7 @@
}
private void scanLibrary(String libraryName, VirtualFile dir) {
- List<VirtualFile> children = dir.getChildren();
+ Collection<VirtualFile> children = dir.getChildren();
for (VirtualFile child : children) {
if (child.isFile()) {
resources.add(new ResourceKey(child.getName(), libraryName));
Added: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/strings/Constants.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/strings/Constants.java (rev 0)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/strings/Constants.java 2010-08-06 18:31:28 UTC (rev 18495)
@@ -0,0 +1,45 @@
+/*
+ * 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.strings;
+
+import com.google.common.base.Joiner;
+import com.google.common.base.Splitter;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public final class Constants {
+
+ private Constants() {
+ }
+
+ public static final Joiner SLASH_JOINER = Joiner.on('/').skipNulls();
+
+ public static final Splitter SLASH_SPLITTER = Splitter.on('/').omitEmptyStrings();
+
+ public static final Joiner DOT_JOINER = Joiner.on('.').skipNulls();
+
+ public static final Joiner DASH_JOINER = Joiner.on('-').skipNulls();
+
+ public static final Joiner COLON_JOINER = Joiner.on(':').skipNulls();
+}
Deleted: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/util/ClasspathUtil.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/util/ClasspathUtil.java 2010-08-06 10:04:44 UTC (rev 18494)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/util/ClasspathUtil.java 2010-08-06 18:31:28 UTC (rev 18495)
@@ -1,73 +0,0 @@
-/*
- * 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.util;
-
-import java.net.URL;
-import java.util.Collection;
-
-import org.reflections.util.ClasspathHelper;
-import org.reflections.vfs.Vfs;
-import org.reflections.vfs.Vfs.Dir;
-import org.reflections.vfs.Vfs.File;
-import org.reflections.vfs.ZipDir;
-
-import com.google.common.base.Predicate;
-import com.google.common.collect.Collections2;
-import com.google.common.collect.Iterators;
-
-/**
- * @author Nick Belaevski
- *
- */
-public final class ClasspathUtil {
-
- private static final Predicate<File> IS_FACES_CONFIG = new Predicate<File>() {
-
- public boolean apply(File input) {
- return input.getRelativePath().endsWith("META-INF/faces-config.xml");
- }
-
- };
-
- private static final Predicate<URL> FACES_URL = new Predicate<URL>() {
-
- public boolean apply(URL input) {
- Dir dir = Vfs.fromURL(input);
- if (dir instanceof ZipDir) {
- return containsFacesConfig(dir);
- } else {
- return true;
- }
- }
- };
-
- private ClasspathUtil() {}
-
- private static boolean containsFacesConfig(Dir dir) {
- return Iterators.any(dir.getFiles().iterator(), IS_FACES_CONFIG);
- }
-
- public static Collection<URL> getFacesClasspathUrls() {
- return Collections2.filter(ClasspathHelper.getUrlsForCurrentClasspath(), FACES_URL);
- }
-
-}
Added: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/VFS.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/VFS.java (rev 0)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/VFS.java 2010-08-06 18:31:28 UTC (rev 18495)
@@ -0,0 +1,49 @@
+/*
+ * 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.vfs;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.net.URL;
+
+import org.richfaces.cdk.vfs.file.FileVFSRoot;
+import org.richfaces.cdk.vfs.zip.ZipVFSRoot;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public final class VFS {
+
+ private VFS() {
+ }
+
+ public static VFSRoot getRoot(URL url) throws URISyntaxException, IOException {
+ File file = new File(url.toURI());
+ if (file.isDirectory()) {
+ return new FileVFSRoot(file);
+ } else {
+ return new ZipVFSRoot(file);
+ }
+ }
+}
Added: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/VFSRoot.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/VFSRoot.java (rev 0)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/VFSRoot.java 2010-08-06 18:31:28 UTC (rev 18495)
@@ -0,0 +1,41 @@
+/*
+ * 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.vfs;
+
+import java.io.Closeable;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public interface VFSRoot extends Closeable, VirtualFile {
+
+ public void initialize() throws IOException;
+
+ public VFSType getType();
+
+ public URL toURL() throws MalformedURLException;
+
+}
Added: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/VFSType.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/VFSType.java (rev 0)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/VFSType.java 2010-08-06 18:31:28 UTC (rev 18495)
@@ -0,0 +1,31 @@
+/*
+ * 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.vfs;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public enum VFSType {
+
+ zip, file
+}
Added: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/VirtualFile.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/VirtualFile.java (rev 0)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/VirtualFile.java 2010-08-06 18:31:28 UTC (rev 18495)
@@ -0,0 +1,50 @@
+/*
+ * 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.vfs;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Collection;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public interface VirtualFile {
+
+ public boolean isFile();
+
+ public boolean isDirectory();
+
+ public InputStream getInputStream() throws IOException;
+
+ public String getName();
+
+ public String getRelativePath();
+
+ public Collection<VirtualFile> getChildren();
+
+ public VirtualFile getChild(String path);
+
+ public VirtualFile getChild(String path, boolean remounted);
+
+}
Added: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/file/FileVFSFile.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/file/FileVFSFile.java (rev 0)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/file/FileVFSFile.java 2010-08-06 18:31:28 UTC (rev 18495)
@@ -0,0 +1,121 @@
+/*
+ * 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.vfs.file;
+
+import static org.richfaces.cdk.strings.Constants.SLASH_JOINER;
+import static org.richfaces.cdk.strings.Constants.SLASH_SPLITTER;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Collection;
+import java.util.List;
+
+import org.richfaces.cdk.vfs.VirtualFile;
+
+import com.google.common.collect.Lists;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class FileVFSFile implements VirtualFile {
+
+ private File file;
+
+ private String relativePath;
+
+ public FileVFSFile(File file, String relativePath) {
+ super();
+ this.file = file;
+ this.relativePath = relativePath;
+ }
+
+ @Override
+ public boolean isFile() {
+ return file.isFile();
+ }
+
+ @Override
+ public boolean isDirectory() {
+ return file.isDirectory();
+ }
+
+ @Override
+ public InputStream getInputStream() throws IOException {
+ return new FileInputStream(file);
+ }
+
+ @Override
+ public String getName() {
+ return file.getName();
+ }
+
+ @Override
+ public String getRelativePath() {
+ return relativePath;
+ }
+
+ @Override
+ public Collection<VirtualFile> getChildren() {
+ List<VirtualFile> result = Lists.newArrayList();
+
+ String[] list = file.list();
+ if (list != null) {
+ for (String childName : list) {
+ File child = new File(file, childName);
+ result.add(new FileVFSFile(child, SLASH_JOINER.join(relativePath, childName)));
+ }
+ }
+
+ return result;
+ }
+
+ @Override
+ public VirtualFile getChild(String path) {
+ return getChild(path, false);
+ }
+
+ @Override
+ public VirtualFile getChild(String path, boolean isRemounted) {
+ Iterable<String> split = SLASH_SPLITTER.split(path);
+ File result = file;
+ for (String pathSeg : split) {
+ result = new File(result, pathSeg);
+
+ if (!result.exists()) {
+ break;
+ }
+ }
+
+ if (result.exists()) {
+ return new FileVFSFile(result, isRemounted ? null : SLASH_JOINER.join(relativePath, result.getName()));
+ }
+
+ return null;
+ }
+
+ protected File getFile() {
+ return file;
+ }
+}
Added: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/file/FileVFSRoot.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/file/FileVFSRoot.java (rev 0)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/file/FileVFSRoot.java 2010-08-06 18:31:28 UTC (rev 18495)
@@ -0,0 +1,75 @@
+/*
+ * 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.vfs.file;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.richfaces.cdk.vfs.VFSRoot;
+import org.richfaces.cdk.vfs.VFSType;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class FileVFSRoot extends FileVFSFile implements VFSRoot {
+
+ public FileVFSRoot(File dir) {
+ super(dir, null);
+
+ assert dir.isDirectory() && dir.exists();
+ }
+
+ @Override
+ public VFSType getType() {
+ return VFSType.file;
+ }
+
+ @Override
+ public void close() throws IOException {
+ //nothing to close
+ }
+
+ @Override
+ public InputStream getInputStream() throws IOException {
+ throw new IOException("Stream is not available");
+ }
+
+ @Override
+ public String getName() {
+ return null;
+ }
+
+ @Override
+ public void initialize() throws IOException {
+ //do nothing
+ }
+
+ @Override
+ public URL toURL() throws MalformedURLException {
+ return getFile().toURI().toURL();
+ }
+
+}
Added: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/zip/ZipNode.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/zip/ZipNode.java (rev 0)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/zip/ZipNode.java 2010-08-06 18:31:28 UTC (rev 18495)
@@ -0,0 +1,98 @@
+/*
+ * 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.vfs.zip;
+
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.zip.ZipEntry;
+
+final class ZipNode {
+
+ private Map<String, ZipNode> children;
+
+ private String name;
+
+ private ZipEntry zipEntry;
+
+ private boolean directory;
+
+ public ZipNode(String name) {
+ super();
+ this.name = name;
+ }
+
+ public ZipNode getOrCreateChild(String name) {
+ setDirectory(true);
+
+ if (children == null) {
+ children = new LinkedHashMap<String, ZipNode>();
+ }
+
+ String lcName = name.toLowerCase();
+
+ ZipNode node = children.get(lcName);
+ if (node == null) {
+ node = new ZipNode(name);
+ children.put(lcName, node);
+ }
+
+ return node;
+ }
+
+ public ZipNode getChild(String name) {
+ if (children == null) {
+ return null;
+ }
+
+ return children.get(name.toLowerCase());
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public Iterable<ZipNode> listChildren() {
+ if (children == null) {
+ return Collections.emptySet();
+ }
+ return children.values();
+ }
+
+ private void setDirectory(boolean directory) {
+ this.directory = directory;
+ }
+
+ public boolean isDirectory() {
+ return directory;
+ }
+
+ public void setZipEntry(ZipEntry zipEntry) {
+ this.zipEntry = zipEntry;
+ setDirectory(zipEntry.isDirectory());
+ }
+
+ public ZipEntry getZipEntry() {
+ return zipEntry;
+ }
+
+}
\ No newline at end of file
Added: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/zip/ZipVFSFile.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/zip/ZipVFSFile.java (rev 0)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/zip/ZipVFSFile.java 2010-08-06 18:31:28 UTC (rev 18495)
@@ -0,0 +1,133 @@
+/*
+ * 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.vfs.zip;
+
+import static org.richfaces.cdk.strings.Constants.SLASH_JOINER;
+import static org.richfaces.cdk.strings.Constants.SLASH_SPLITTER;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Collection;
+import java.util.List;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+import org.richfaces.cdk.vfs.VirtualFile;
+
+import com.google.common.collect.Lists;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class ZipVFSFile implements VirtualFile {
+
+ private ZipFile zipFile;
+
+ private ZipNode zipNode;
+
+ private String relativePath;
+
+ public ZipVFSFile(ZipFile zipFile, ZipNode zipNode, String relativePath) {
+ super();
+ this.zipFile = zipFile;
+ this.zipNode = zipNode;
+ this.relativePath = relativePath;
+ }
+
+ @Override
+ public boolean isFile() {
+ return !isDirectory();
+ }
+
+ @Override
+ public boolean isDirectory() {
+ return zipNode.isDirectory();
+ }
+
+ @Override
+ public InputStream getInputStream() throws IOException {
+ ZipEntry entry = zipNode.getZipEntry();
+ if (entry != null) {
+ synchronized (zipFile) {
+ return zipFile.getInputStream(entry);
+ }
+ }
+
+ throw new IOException("Input stream isn't available!");
+ }
+
+ @Override
+ public Collection<VirtualFile> getChildren() {
+ Iterable<ZipNode> children = zipNode.listChildren();
+
+ List<VirtualFile> result = Lists.newArrayList();
+
+ for (ZipNode child: children) {
+ result.add(new ZipVFSFile(zipFile, child, SLASH_JOINER.join(getRelativePath(), child.getName())));
+ }
+
+ return result;
+ }
+
+ @Override
+ public VirtualFile getChild(String path) {
+ return getChild(path, false);
+ }
+
+ @Override
+ public VirtualFile getChild(String path, boolean remounted) {
+ Iterable<String> split = SLASH_SPLITTER.split(path);
+ ZipNode node = zipNode;
+ for (String pathSeg : split) {
+ node = node.getChild(pathSeg);
+ if (node == null) {
+ return null;
+ }
+ }
+
+ String relativePath = null;
+ if (!remounted) {
+ relativePath = SLASH_JOINER.join(getRelativePath(), path);
+ }
+
+ return new ZipVFSFile(zipFile, node, relativePath);
+ }
+
+ @Override
+ public String getName() {
+ return zipNode.getName();
+ }
+
+ @Override
+ public String getRelativePath() {
+ return relativePath;
+ }
+
+ protected ZipFile getZipFile() {
+ return zipFile;
+ }
+
+ protected ZipNode getZipNode() {
+ return zipNode;
+ }
+}
Added: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/zip/ZipVFSRoot.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/zip/ZipVFSRoot.java (rev 0)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/vfs/zip/ZipVFSRoot.java 2010-08-06 18:31:28 UTC (rev 18495)
@@ -0,0 +1,93 @@
+/*
+ * 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.vfs.zip;
+
+import static org.richfaces.cdk.strings.Constants.SLASH_SPLITTER;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Enumeration;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+import org.richfaces.cdk.vfs.VFSRoot;
+import org.richfaces.cdk.vfs.VFSType;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class ZipVFSRoot extends ZipVFSFile implements VFSRoot {
+
+ private File file;
+
+ public ZipVFSRoot(File file) throws IOException {
+ super(new ZipFile(file), new ZipNode(null), null);
+
+ assert file.isFile() && file.exists();
+ this.file = file;
+ }
+
+ @Override
+ public void initialize() throws IOException {
+ Enumeration<? extends ZipEntry> entries = getZipFile().entries();
+ while (entries.hasMoreElements()) {
+ ZipEntry entry = entries.nextElement();
+
+ String entryName = entry.getName();
+ Iterable<String> split = SLASH_SPLITTER.split(entryName);
+ ZipNode node = getZipNode();
+ for (String pathSeg : split) {
+ if (".".equals(pathSeg) || "..".equals(pathSeg)) {
+ continue;
+ }
+
+ node = node.getOrCreateChild(pathSeg);
+ }
+
+ node.setZipEntry(entry);
+ }
+ }
+
+ @Override
+ public void close() throws IOException {
+ getZipFile().close();
+ }
+
+ @Override
+ public VFSType getType() {
+ return VFSType.zip;
+ }
+
+ public URL toURL() throws MalformedURLException {
+ return file.toURI().toURL();
+ };
+
+ @Override
+ public InputStream getInputStream() throws IOException {
+ throw new IOException("Stream is not available");
+ }
+
+}
15 years, 9 months
JBoss Rich Faces SVN: r18494 - root/tests/metamer/trunk/application/src/main/webapp/WEB-INF.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2010-08-06 06:04:44 -0400 (Fri, 06 Aug 2010)
New Revision: 18494
Added:
root/tests/metamer/trunk/application/src/main/webapp/WEB-INF/jboss-scanning.xml
Log:
* jboss-scanning.xml added so that Guava and SLF4J jars don't cause problems in JBoss AS
Added: root/tests/metamer/trunk/application/src/main/webapp/WEB-INF/jboss-scanning.xml
===================================================================
--- root/tests/metamer/trunk/application/src/main/webapp/WEB-INF/jboss-scanning.xml (rev 0)
+++ root/tests/metamer/trunk/application/src/main/webapp/WEB-INF/jboss-scanning.xml 2010-08-06 10:04:44 UTC (rev 18494)
@@ -0,0 +1,10 @@
+<scanning xmlns="urn:jboss:scanning:1.0">
+
+ <path name="WEB-INF/classes">
+ </path>
+
+ <path name="WEB-INF/lib/guava-r05.jar">
+ <exclude name="com.google.common.collect" />
+ </path>
+
+</scanning>
\ No newline at end of file
15 years, 9 months
JBoss Rich Faces SVN: r18493 - in root/tests/metamer/trunk/application/src/main/webapp: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2010-08-06 05:15:02 -0400 (Fri, 06 Aug 2010)
New Revision: 18493
Modified:
root/tests/metamer/trunk/application/src/main/webapp/resources/script/common.js
root/tests/metamer/trunk/application/src/main/webapp/templates/header.xhtml
Log:
* added logging executed JSF phases into a4j:log
Modified: root/tests/metamer/trunk/application/src/main/webapp/resources/script/common.js
===================================================================
--- root/tests/metamer/trunk/application/src/main/webapp/resources/script/common.js 2010-08-06 06:34:22 UTC (rev 18492)
+++ root/tests/metamer/trunk/application/src/main/webapp/resources/script/common.js 2010-08-06 09:15:02 UTC (rev 18493)
@@ -69,4 +69,14 @@
}
}
+/**
+ * Logs information about JSF lifecycle and invoked action/action listeners to the a4j:log.
+ */
+function updateLog(data) {
+ var logEntries = data.replace("[", "").replace("]", "").split(",");
+ for (index in logEntries) {
+ RichFaces.log.debug(logEntries[index]);
+ }
+}
+
Modified: root/tests/metamer/trunk/application/src/main/webapp/templates/header.xhtml
===================================================================
--- root/tests/metamer/trunk/application/src/main/webapp/templates/header.xhtml 2010-08-06 06:34:22 UTC (rev 18492)
+++ root/tests/metamer/trunk/application/src/main/webapp/templates/header.xhtml 2010-08-06 09:15:02 UTC (rev 18493)
@@ -36,15 +36,17 @@
<h:panelGrid columns="2" width="230px">
<h:outputText id="a4jLogLabel" value="Display log" />
-
+
<h:selectBooleanCheckbox id="a4jLogCheckbox" value="false" onchange="showOrHideLog()"/>
<h:outputText id="a4jStatusLabel" value="Status" />
- <a4j:status id="a4jStatus">
- <f:facet name="start">
- <h:outputText value="WORKING" style="color: red;" />
- </f:facet>
- </a4j:status>
+ <a4j:outputPanel ajaxRendered="true">
+ <a4j:status id="a4jStatus" onstop="updateLog('#{phasesBean.phases}')">
+ <f:facet name="start">
+ <h:outputText value="WORKING" style="color: red;" />
+ </f:facet>
+ </a4j:status>
+ </a4j:outputPanel>
<h:outputText id="showUiDebugLabel" value="Show ui:debug" />
<h:outputText id="showUiDebug" value="Ctrl+Shift+L" />
@@ -94,7 +96,7 @@
<h:outputText id="requestTime" value="#{phasesBean.date}">
<f:convertDateTime pattern="HH:mm:ss.SSS"/>
</h:outputText>
- <ul>
+ <ul class="phases-list">
<a4j:repeat value="#{phasesBean.phases}" var="phase">
<li>#{phase}</li>
</a4j:repeat>
15 years, 9 months
JBoss Rich Faces SVN: r18492 - branches/development/docs/Component_Reference/src/main/docbook/en-US.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2010-08-06 02:34:22 -0400 (Fri, 06 Aug 2010)
New Revision: 18492
Modified:
branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Actions.xml
branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Containers.xml
branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Layout_and_appearance.xml
branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Menus_and_toolbars.xml
branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Output_and_messages.xml
branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Panels_and_containers.xml
branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Processing_management.xml
branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Resources.xml
branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Rich_inputs.xml
branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Tables_and_grids.xml
branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Validation.xml
Log:
Updated reference data for new components
Modified: branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Actions.xml
===================================================================
--- branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Actions.xml 2010-08-05 21:30:13 UTC (rev 18491)
+++ branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Actions.xml 2010-08-06 06:34:22 UTC (rev 18492)
@@ -11,12 +11,12 @@
<itemizedlist>
<listitem>
<para>
- component-type: <classname>org.ajax4jsf.ActionParameter</classname>
+ <parameter>component-type</parameter>: <classname>org.ajax4jsf.ActionParameter</classname>
</para>
</listitem>
<listitem>
<para>
- component-class: <classname>org.ajax4jsf.component.html.HTMLActionParameter</classname>
+ <parameter>component-class</parameter>: <classname>org.ajax4jsf.component.html.HTMLActionParameter</classname>
</para>
</listitem>
</itemizedlist>
@@ -81,17 +81,17 @@
<itemizedlist>
<listitem>
<para>
- listener-class: <classname>org.ajax4jsf.event.AjaxListener</classname>
+ <parameter>listener-class</parameter>: <classname>org.ajax4jsf.event.AjaxListener</classname>
</para>
</listitem>
<listitem>
<para>
- event-class: <classname>org.ajax4jsf.event.AjaxEvent</classname>
+ <parameter>event-class</parameter>: <classname>org.ajax4jsf.event.AjaxEvent</classname>
</para>
</listitem>
<listitem>
<para>
- tag-class: <classname>org.ajax4jsf.taglib.html.jsp.AjaxListenerTag</classname>
+ <parameter>tag-class</parameter>: <classname>org.ajax4jsf.taglib.html.jsp.AjaxListenerTag</classname>
</para>
</listitem>
</itemizedlist>
@@ -112,22 +112,22 @@
<itemizedlist>
<listitem>
<para>
- component-type: <classname>org.ajax4jsf.CommandButton</classname>
+ <parameter>component-type</parameter>: <classname>org.ajax4jsf.CommandButton</classname>
</para>
</listitem>
<listitem>
<para>
- component-family: <classname>javax.faces.Command</classname>
+ <parameter>component-class</parameter>: <classname>org.ajax4jsf.component.html.HtmlAjaxCommandButton</classname>
</para>
</listitem>
<listitem>
<para>
- component-class: <classname>org.ajax4jsf.component.html.HtmlAjaxCommandButton</classname>
+ <parameter>component-family</parameter>: <classname>javax.faces.Command</classname>
</para>
</listitem>
<listitem>
<para>
- renderer-type: <classname>org.ajax4jsf.components.AjaxCommandButtonRenderer</classname>
+ <parameter>renderer-type</parameter>: <classname>org.ajax4jsf.components.AjaxCommandButtonRenderer</classname>
</para>
</listitem>
</itemizedlist>
@@ -163,22 +163,22 @@
<itemizedlist>
<listitem>
<para>
- component-type: <classname>org.ajax4jsf.CommandLink</classname>
+ <parameter>component-type</parameter>: <classname>org.ajax4jsf.CommandLink</classname>
</para>
</listitem>
<listitem>
<para>
- component-family: <classname>javax.faces.Command</classname>
+ <parameter>component-class</parameter>: <classname>org.ajax4jsf.component.html.HtmlAjaxCommandLink</classname>
</para>
</listitem>
<listitem>
<para>
- component-class: <classname>org.ajax4jsf.component.html.HtmlAjaxCommandLink</classname>
+ <parameter>component-family</parameter>: <classname>javax.faces.Command</classname>
</para>
</listitem>
<listitem>
<para>
- renderer-type: <classname>org.ajax4jsf.components.AjaxCommandLinkRenderer</classname>
+ <parameter>renderer-type</parameter>: <classname>org.ajax4jsf.components.AjaxCommandLinkRenderer</classname>
</para>
</listitem>
</itemizedlist>
@@ -209,27 +209,27 @@
<itemizedlist>
<listitem>
<para>
- component-type: <classname>org.richfaces.ComponentControl</classname>
+ <parameter>component-type</parameter>: <classname>org.richfaces.ComponentControl</classname>
</para>
</listitem>
<listitem>
<para>
- component-family: <classname>org.richfaces.ComponentControl</classname>
+ <parameter>component-class</parameter>: <classname>org.richfaces.component.html.HtmlComponentControl</classname>
</para>
</listitem>
<listitem>
<para>
- component-class: <classname>org.richfaces.component.html.HtmlComponentControl</classname>
+ <parameter>component-family</parameter>: <classname>org.richfaces.ComponentControl</classname>
</para>
</listitem>
<listitem>
<para>
- renderer-type: <classname>org.richfaces.ComponentControlRenderer</classname>
+ <parameter>renderer-type</parameter>: <classname>org.richfaces.ComponentControlRenderer</classname>
</para>
</listitem>
<listitem>
<para>
- tag-class: <classname>org.richfaces.taglib.ComponentControlTag</classname>
+ <parameter>tag-class</parameter>: <classname>org.richfaces.taglib.ComponentControlTag</classname>
</para>
</listitem>
</itemizedlist>
@@ -340,22 +340,22 @@
<itemizedlist>
<listitem>
<para>
- component-type: <classname>org.ajax4jsf.HtmlCommandLink</classname>
+ <parameter>component-type</parameter>: <classname>org.ajax4jsf.HtmlCommandLink</classname>
</para>
</listitem>
<listitem>
<para>
- component-family: <classname>javax.faces.Command</classname>
+ <parameter>component-class</parameter>: <classname>org.ajax4jsf.component.html.HtmlCommandLink</classname>
</para>
</listitem>
<listitem>
<para>
- component-class: <classname>org.ajax4jsf.component.html.HtmlCommandLink</classname>
+ <parameter>component-family</parameter>: <classname>javax.faces.Command</classname>
</para>
</listitem>
<listitem>
<para>
- renderer-type: <classname>org.ajax4jsf.HtmlCommandLinkRenderer</classname>
+ <parameter>renderer-type</parameter>: <classname>org.ajax4jsf.HtmlCommandLinkRenderer</classname>
</para>
</listitem>
</itemizedlist>
@@ -373,22 +373,22 @@
<itemizedlist>
<listitem>
<para>
- component-type: <classname>org.ajax4jsf.Function</classname>
+ <parameter>component-type</parameter>: <classname>org.ajax4jsf.Function</classname>
</para>
</listitem>
<listitem>
<para>
- component-family: <classname>org.ajax4jsf.components.ajaxFunction</classname>
+ <parameter>component-class</parameter>: <classname>org.ajax4jsf.component.html.HtmlajaxFunction</classname>
</para>
</listitem>
<listitem>
<para>
- component-class: <classname>org.ajax4jsf.component.html.HtmlajaxFunction</classname>
+ <parameter>component-family</parameter>: <classname>org.ajax4jsf.components.ajaxFunction</classname>
</para>
</listitem>
<listitem>
<para>
- renderer-type: <classname>org.ajax4jsf.components.ajaxFunctionRenderer</classname>
+ <parameter>renderer-type</parameter>: <classname>org.ajax4jsf.components.ajaxFunctionRenderer</classname>
</para>
</listitem>
</itemizedlist>
@@ -418,22 +418,22 @@
<itemizedlist>
<listitem>
<para>
- component-type: <classname>org.ajax4jsf.Poll</classname>
+ <parameter>component-type</parameter>: <classname>org.ajax4jsf.Poll</classname>
</para>
</listitem>
<listitem>
<para>
- component-family: <classname>org.ajax4jsf.components.AjaxPoll</classname>
+ <parameter>component-class</parameter>: <classname>org.ajax4jsf.component.html.AjaxPoll</classname>
</para>
</listitem>
<listitem>
<para>
- component-class: <classname>org.ajax4jsf.component.html.AjaxPoll</classname>
+ <parameter>component-family</parameter>: <classname>org.ajax4jsf.components.AjaxPoll</classname>
</para>
</listitem>
<listitem>
<para>
- renderer-type: <classname>org.ajax4jsf.components.AjaxPollRenderer</classname>
+ <parameter>renderer-type</parameter>: <classname>org.ajax4jsf.components.AjaxPollRenderer</classname>
</para>
</listitem>
</itemizedlist>
@@ -456,22 +456,22 @@
<itemizedlist>
<listitem>
<para>
- component-type: <classname>org.ajax4jsf.Push</classname>
+ <parameter>component-type</parameter>: <classname>org.ajax4jsf.Push</classname>
</para>
</listitem>
<listitem>
<para>
- component-family: <classname>org.ajax4jsf.components.AjaxPush</classname>
+ <parameter>component-class</parameter>: <classname>org.ajax4jsf.component.html.AjaxPush</classname>
</para>
</listitem>
<listitem>
<para>
- component-class: <classname>org.ajax4jsf.component.html.AjaxPush</classname>
+ <parameter>component-family</parameter>: <classname>org.ajax4jsf.components.AjaxPush</classname>
</para>
</listitem>
<listitem>
<para>
- renderer-type: <classname>org.ajax4jsf.components.AjaxPushRenderer</classname>
+ <parameter>renderer-type</parameter>: <classname>org.ajax4jsf.components.AjaxPushRenderer</classname>
</para>
</listitem>
</itemizedlist>
@@ -491,22 +491,22 @@
<itemizedlist>
<listitem>
<para>
- component-type: <classname>org.ajax4jsf.Ajax</classname>
+ <parameter>component-type</parameter>: <classname>org.ajax4jsf.Ajax</classname>
</para>
</listitem>
<listitem>
<para>
- component-family: <classname>org.ajax4jsf.Ajax</classname>
+ <parameter>component-class</parameter>: <classname>org.ajax4jsf.component.html.HtmlAjaxSupport</classname>
</para>
</listitem>
<listitem>
<para>
- component-class: <classname>org.ajax4jsf.component.html.HtmlAjaxSupport</classname>
+ <parameter>component-family</parameter>: <classname>org.ajax4jsf.Ajax</classname>
</para>
</listitem>
<listitem>
<para>
- renderer-type: <classname>org.ajax4jsf.components.AjaxSupportRenderer</classname>
+ <parameter>renderer-type</parameter>: <classname>org.ajax4jsf.components.AjaxSupportRenderer</classname>
</para>
</listitem>
</itemizedlist>
Modified: branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Containers.xml
===================================================================
--- branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Containers.xml 2010-08-05 21:30:13 UTC (rev 18491)
+++ branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Containers.xml 2010-08-06 06:34:22 UTC (rev 18492)
@@ -14,22 +14,22 @@
<itemizedlist>
<listitem>
<para>
- component-type: <classname>org.ajax4jsf.Form</classname>
+ <parameter>component-type</parameter>: <classname>org.ajax4jsf.Form</classname>
</para>
</listitem>
<listitem>
<para>
- component-family: <classname>javax.faces.Form</classname>
+ <parameter>component-class</parameter>: <classname>org.ajax4jsf.component.html.AjaxForm</classname>
</para>
</listitem>
<listitem>
<para>
- component-class: <classname>org.ajax4jsf.component.html.AjaxForm</classname>
+ <parameter>component-family</parameter>: <classname>javax.faces.Form</classname>
</para>
</listitem>
<listitem>
<para>
- renderer-type: <classname>org.ajax4jsf.FormRenderer</classname>
+ <parameter>renderer-type</parameter>: <classname>org.ajax4jsf.FormRenderer</classname>
</para>
</listitem>
</itemizedlist>
@@ -62,22 +62,22 @@
<itemizedlist>
<listitem>
<para>
- component-type: <classname>org.ajax4jsf.Include</classname>
+ <parameter>component-type</parameter>: <classname>org.ajax4jsf.Include</classname>
</para>
</listitem>
<listitem>
<para>
- component-family: <classname>javax.faces.Output</classname>
+ <parameter>component-class</parameter>: <classname>org.ajax4jsf.component.html.Include</classname>
</para>
</listitem>
<listitem>
<para>
- component-class: <classname>org.ajax4jsf.component.html.Include</classname>
+ <parameter>component-family</parameter>: <classname>javax.faces.Output</classname>
</para>
</listitem>
<listitem>
<para>
- renderer-type: <classname>org.ajax4jsf.components.AjaxIncludeRenderer</classname>
+ <parameter>renderer-type</parameter>: <classname>org.ajax4jsf.components.AjaxIncludeRenderer</classname>
</para>
</listitem>
</itemizedlist>
@@ -118,22 +118,22 @@
<itemizedlist>
<listitem>
<para>
- component-type: <classname>org.ajax4jsf.OutputPanel</classname>
+ <parameter>component-type</parameter>: <classname>org.ajax4jsf.OutputPanel</classname>
</para>
</listitem>
<listitem>
<para>
- component-family: <classname>javax.faces.Panel</classname>
+ <parameter>component-class</parameter>: <classname>org.ajax4jsf.component.html.HtmlAjaxOutputPanel</classname>
</para>
</listitem>
<listitem>
<para>
- component-class: <classname>org.ajax4jsf.component.html.HtmlAjaxOutputPanel</classname>
+ <parameter>component-family</parameter>: <classname>javax.faces.Panel</classname>
</para>
</listitem>
<listitem>
<para>
- renderer-type: <classname>org.ajax4jsf.components.AjaxOutputPanelRenderer</classname>
+ <parameter>renderer-type</parameter>: <classname>org.ajax4jsf.components.AjaxOutputPanelRenderer</classname>
</para>
</listitem>
</itemizedlist>
@@ -172,22 +172,22 @@
<itemizedlist>
<listitem>
<para>
- component-type: <classname>org.ajax4jsf.components.Page</classname>
+ <parameter>component-type</parameter>: <classname>org.ajax4jsf.components.Page</classname>
</para>
</listitem>
<listitem>
<para>
- component-family: <classname>org.ajax4jsf.components.AjaxRegion</classname>
+ <parameter>component-class</parameter>: <classname>org.ajax4jsf.component.html.HtmlPage</classname>
</para>
</listitem>
<listitem>
<para>
- component-class: <classname>org.ajax4jsf.component.html.HtmlPage</classname>
+ <parameter>component-family</parameter>: <classname>org.ajax4jsf.components.AjaxRegion</classname>
</para>
</listitem>
<listitem>
<para>
- renderer-type: <classname>org.ajax4jsf.components.AjaxPageRenderer</classname>
+ <parameter>renderer-type</parameter>: <classname>org.ajax4jsf.components.AjaxPageRenderer</classname>
</para>
</listitem>
</itemizedlist>
@@ -228,22 +228,22 @@
<itemizedlist>
<listitem>
<para>
- component-type: <classname>org.ajax4jsf.AjaxRegion</classname>
+ <parameter>component-type</parameter>: <classname>org.ajax4jsf.AjaxRegion</classname>
</para>
</listitem>
<listitem>
<para>
- component-family: <classname>org.ajax4jsf.AjaxRegion</classname>
+ <parameter>component-class</parameter>: <classname>org.ajax4jsf.component.html.HtmlAjaxRegion</classname>
</para>
</listitem>
<listitem>
<para>
- component-class: <classname>org.ajax4jsf.component.html.HtmlAjaxRegion</classname>
+ <parameter>component-family</parameter>: <classname>org.ajax4jsf.AjaxRegion</classname>
</para>
</listitem>
<listitem>
<para>
- renderer-type: <classname>org.ajax4jsf.components.AjaxRegionRenderer</classname>
+ <parameter>renderer-type</parameter>: <classname>org.ajax4jsf.components.AjaxRegionRenderer</classname>
</para>
</listitem>
</itemizedlist>
Modified: branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Layout_and_appearance.xml
===================================================================
--- branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Layout_and_appearance.xml 2010-08-05 21:30:13 UTC (rev 18491)
+++ branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Layout_and_appearance.xml 2010-08-06 06:34:22 UTC (rev 18492)
@@ -3,23 +3,66 @@
]>
<chapter id="chap-Component_Reference-Layout_and_appearance">
<title>Layout and appearance</title>
+ <!-- In development notification -->
+ <important>
+ <title>Documentation in development</title>
+ <para>
+ Some concepts covered in this chapter may refer to the previous version of <productname>Richfaces</productname>, version 3.3.3. This chapter is scheduled for review to ensure all information is up to date.
+ </para>
+ </important>
<para>
- Incomplete
+ Read this chapter to alter the layout and appearance of web applications using special components.
</para>
+
+ <!-- TODO not in M2 -->
+ <!--
<section id="sect-Component_Reference-Layout_and_appearance-richeffect">
<title><sgmltag><rich:effect></sgmltag></title>
<para>
Incomplete
</para>
</section>
+ -->
<section id="sect-Component_Reference-Layout_and_appearance-richjQuery">
<title><sgmltag><rich:jQuery></sgmltag></title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <parameter>component-type</parameter>: <classname>org.richfaces.JQuery</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>component-class</parameter>: <classname>org.richfaces.component.html.HtmlJQuery</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>component-family</parameter>: <classname>org.richfaces.JQuery</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>renderer-type</parameter>: <classname>org.richfaces.JQueryRenderer</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>tag-class</parameter>: <classname>org.richfaces.taglib.JQueryTag</classname>
+ </para>
+ </listitem>
+ </itemizedlist>
<para>
- Milestone2
+ The <sgmltag><rich:jQuery></sgmltag> component applies styles and custom behavior to both <acronym>JSF</acronym> (JavaServer Faces) objects and regular <acronym>DOM</acronym> (Document Object Model) objects. It uses the <phrase>jQuery</phrase> JavaScript framework to add functionality without conflicting with the <filename>prototype.js</filename> library.
</para>
+ <para>
+
+ </para>
</section>
+ <!-- TODO not in M2 -->
+ <!--
<section id="sect-Component_Reference-Layout_and_appearance-richseparator">
<title><sgmltag><rich:separator></sgmltag></title>
<para>
@@ -54,6 +97,7 @@
Incomplete
</para>
</section>
+ -->
</chapter>
Modified: branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Menus_and_toolbars.xml
===================================================================
--- branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Menus_and_toolbars.xml 2010-08-05 21:30:13 UTC (rev 18491)
+++ branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Menus_and_toolbars.xml 2010-08-06 06:34:22 UTC (rev 18492)
@@ -43,6 +43,33 @@
<section id="sect-Component_Reference-Menus_and_toolbars-richpanelMenu">
<title><sgmltag><rich:panelMenu></sgmltag></title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <parameter>component-type</parameter>: <classname>org.richfaces.PanelMenu</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>component-class</parameter>: <classname>org.richfaces.component.html.HtmlPanelMenu</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>component-family</parameter>: <classname>org.richfaces.PanelMenu</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>renderer-type</parameter>: <classname>org.richfaces.PanelMenuRenderer</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>tag-class</parameter>: <classname>org.richfaces.taglib.PanelMenuTag</classname>
+ </para>
+ </listitem>
+ </itemizedlist>
<para>
The <classname><rich:panelMenu></classname> component can be used in conjunction with <classname><rich:panelMenuItem></classname> and <classname><rich:panelMenuGroup></classname> to create an expanding, hierarchical menu. The <classname><rich:panelMenu></classname> component's appearance can be highly customized, and the hierarchy can stretch to any number of sub-levels.
</para>
@@ -111,6 +138,33 @@
<section id="sect-Component_Reference-Menus_and_toolbars-richpanelMenuItem">
<title><sgmltag><rich:panelMenuItem></sgmltag></title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <parameter>component-type</parameter>: <classname>org.richfaces.PanelMenuItem</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>component-class</parameter>: <classname>org.richfaces.component.html.HtmlPanelMenuItem</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>component-family</parameter>: <classname>org.richfaces.PanelMenuItem</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>renderer-type</parameter>: <classname>org.richfaces.PanelMenuItemRenderer</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>tag-class</parameter>: <classname>org.richfaces.taglib.PanelMenuItemTag</classname>
+ </para>
+ </listitem>
+ </itemizedlist>
<para>
The <classname><rich:panelMenuItem></classname> component represents a single item inside a <classname><rich:panelMenuGroup></classname> component, which is in turn part of a <classname><rich:panelMenu></classname> component.
</para>
Modified: branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Output_and_messages.xml
===================================================================
--- branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Output_and_messages.xml 2010-08-05 21:30:13 UTC (rev 18491)
+++ branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Output_and_messages.xml 2010-08-06 06:34:22 UTC (rev 18492)
@@ -11,27 +11,27 @@
<itemizedlist>
<listitem>
<para>
- component-type: <classname>org.richfaces.RichMessage</classname>
+ <parameter>component-type</parameter>: <classname>org.richfaces.RichMessage</classname>
</para>
</listitem>
<listitem>
<para>
- component-class: <classname>org.richfaces.component.html.HtmlRichMessage</classname>
+ <parameter>component-class</parameter>: <classname>org.richfaces.component.html.HtmlRichMessage</classname>
</para>
</listitem>
<listitem>
<para>
- component-family: <classname>org.richfaces.component.RichMessage</classname>
+ <parameter>component-family</parameter>: <classname>org.richfaces.component.RichMessage</classname>
</para>
</listitem>
<listitem>
<para>
- renderer-type: <classname>org.richfaces.RichMessageRenderer</classname>
+ <parameter>renderer-type</parameter>: <classname>org.richfaces.RichMessageRenderer</classname>
</para>
</listitem>
<listitem>
<para>
- tag-class: <classname>org.richfaces.taglib.RichMessageTag</classname>
+ <parameter>tag-class</parameter>: <classname>org.richfaces.taglib.RichMessageTag</classname>
</para>
</listitem>
</itemizedlist>
@@ -115,27 +115,27 @@
<itemizedlist>
<listitem>
<para>
- component-type: <classname>org.richfaces.component.RichMessages</classname>
+ <parameter>component-type</parameter>: <classname>org.richfaces.component.RichMessages</classname>
</para>
</listitem>
<listitem>
<para>
- component-class: <classname>org.richfaces.component.html.HtmlRichMessages</classname>
+ <parameter>component-class</parameter>: <classname>org.richfaces.component.html.HtmlRichMessages</classname>
</para>
</listitem>
<listitem>
<para>
- component-family: <classname>org.richfaces.component.RichMessages</classname>
+ <parameter>component-family</parameter>: <classname>org.richfaces.component.RichMessages</classname>
</para>
</listitem>
<listitem>
<para>
- renderer-type: <classname>org.richfaces.RichMessagesRenderer</classname>
+ <parameter>renderer-type</parameter>: <classname>org.richfaces.RichMessagesRenderer</classname>
</para>
</listitem>
<listitem>
<para>
- tag-class: <classname>org.richfaces.taglib.RichMessagesTag</classname>
+ <parameter>tag-class</parameter>: <classname>org.richfaces.taglib.RichMessagesTag</classname>
</para>
</listitem>
</itemizedlist>
Modified: branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Panels_and_containers.xml
===================================================================
--- branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Panels_and_containers.xml 2010-08-05 21:30:13 UTC (rev 18491)
+++ branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Panels_and_containers.xml 2010-08-06 06:34:22 UTC (rev 18492)
@@ -119,6 +119,33 @@
<section id="sect-Component_Reference-Panels_and_containers-richtabPanel">
<title><sgmltag><rich:tabPanel></sgmltag></title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <parameter>component-type</parameter>: <classname>org.richfaces.tabPanel</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>component-class</parameter>: <classname>org.richfaces.component.html.HtmltabPanel</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>component-family</parameter>: <classname>org.richfaces.tabPanel</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>renderer-type</parameter>: <classname>org.richfaces.tabPanelRenderer</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>tag-class</parameter>: <classname>org.richfaces.taglib.tabPanelTag</classname>
+ </para>
+ </listitem>
+ </itemizedlist>
<para>
The <sgmltag><rich:tabPanel></sgmltag> component provides a set of tabbed panels for displaying one panel of content at a time. The tabs can be highly customized and themed.
</para>
@@ -180,6 +207,33 @@
<section id="sect-Component_Reference-Panels_and_containers-richtogglePanel">
<title><sgmltag><rich:togglePanel></sgmltag></title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <parameter>component-type</parameter>: <classname>org.richfaces.TogglePanel</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>component-class</parameter>: <classname>org.richfaces.component.html.HtmlTogglePanel</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>component-family</parameter>: <classname>org.richfaces.TogglePanel</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>renderer-type</parameter>: <classname>org.richfaces.TogglePanelRenderer</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>tag-class</parameter>: <classname>org.richfaces.taglib.TogglePanelTag</classname>
+ </para>
+ </listitem>
+ </itemizedlist>
<para>
The <sgmltag><rich:togglePanel></sgmltag> component is a wrapper component with named facets. Each facet is displayed after activating a corresponding <sgmltag><rich:toggleControl></sgmltag> component.
</para>
@@ -231,14 +285,14 @@
<h:panelGroup>
<rich:toggleControl for="helloForm:panel" value="Empty" switchToState="empty"/>
<rich:toggleControl for="helloForm:panel" value=" Second" switchToState="second"/>
- <!--Some content-->
+ <!-Some content->
</h:panelGroup>
</f:facet>
<f:facet name="second">
<h:panelGroup>
<rich:toggleControl for="helloForm:panel" value="Empty" switchToState="empty"/>
<rich:toggleControl for="helloForm:panel" value=" first" switchToState="first"/>
- <!--Some content-->
+ <!-Some content->
</h:panelGroup>
</f:facet>
<f:facet name="empty">
Modified: branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Processing_management.xml
===================================================================
--- branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Processing_management.xml 2010-08-05 21:30:13 UTC (rev 18491)
+++ branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Processing_management.xml 2010-08-06 06:34:22 UTC (rev 18492)
@@ -11,22 +11,22 @@
<itemizedlist>
<listitem>
<para>
- component-family: <classname>org.ajax4jsf.Queue</classname>
+ <parameter>renderer-type</parameter>: <classname>org.ajax4jsf.QueueRenderer</classname>
</para>
</listitem>
<listitem>
<para>
- component-class: <classname>org.ajax4jsf.component.html.HtmlQueue</classname>
+ <parameter>component-class</parameter>: <classname>org.ajax4jsf.component.html.HtmlQueue</classname>
</para>
</listitem>
<listitem>
<para>
- renderer-type: <classname>org.ajax4jsf.QueueRenderer</classname>
+ <parameter>component-family</parameter>: <classname>org.ajax4jsf.Queue</classname>
</para>
</listitem>
<listitem>
<para>
- tag-class: <classname>org.ajax4jsf.taglib.html.jsp.QueueTag</classname>
+ <parameter>tag-class</parameter>: <classname>org.ajax4jsf.taglib.html.jsp.QueueTag</classname>
</para>
</listitem>
</itemizedlist>
@@ -100,22 +100,22 @@
<itemizedlist>
<listitem>
<para>
- component-type: <classname>org.ajax4jsf.Log</classname>
+ <parameter>component-type</parameter>: <classname>org.ajax4jsf.Log</classname>
</para>
</listitem>
<listitem>
<para>
- component-family: <classname>org.ajax4jsf.Log</classname>
+ <parameter>component-class</parameter>: <classname>org.ajax4jsf.component.html.AjaxLog</classname>
</para>
</listitem>
<listitem>
<para>
- component-class: <classname>org.ajax4jsf.component.html.AjaxLog</classname>
+ <parameter>component-family</parameter>: <classname>org.ajax4jsf.Log</classname>
</para>
</listitem>
<listitem>
<para>
- renderer-type: <classname>org.ajax4jsf.LogRenderer</classname>
+ <parameter>renderer-type</parameter>: <classname>org.ajax4jsf.LogRenderer</classname>
</para>
</listitem>
</itemizedlist>
@@ -175,22 +175,22 @@
<itemizedlist>
<listitem>
<para>
- component-type: <classname>org.ajax4jsf.Status</classname>
+ <parameter>component-type</parameter>: <classname>org.ajax4jsf.Status</classname>
</para>
</listitem>
<listitem>
<para>
- component-family: <classname>javax.faces.Panel</classname>
+ <parameter>component-class</parameter>: <classname>org.ajax4jsf.component.html.HtmlAjaxStatus</classname>
</para>
</listitem>
<listitem>
<para>
- component-class: <classname>org.ajax4jsf.component.html.HtmlAjaxStatus</classname>
+ <parameter>component-family</parameter>: <classname>javax.faces.Panel</classname>
</para>
</listitem>
<listitem>
<para>
- renderer-type: <classname>org.ajax4jsf.components.AjaxStatusRenderer</classname>
+ <parameter>renderer-type</parameter>: <classname>org.ajax4jsf.components.AjaxStatusRenderer</classname>
</para>
</listitem>
</itemizedlist>
Modified: branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Resources.xml
===================================================================
--- branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Resources.xml 2010-08-05 21:30:13 UTC (rev 18491)
+++ branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Resources.xml 2010-08-06 06:34:22 UTC (rev 18492)
@@ -14,17 +14,17 @@
<itemizedlist>
<listitem>
<para>
- component-type: <classname>org.ajax4jsf.Bundle</classname>
+ <parameter>component-type</parameter>: <classname>org.ajax4jsf.Bundle</classname>
</para>
</listitem>
<listitem>
<para>
- component-family: <classname>org.ajax4jsf.Bundle</classname>
+ <parameter>component-class</parameter>: <classname>org.ajax4jsf.component.html.AjaxLoadBundle</classname>
</para>
</listitem>
<listitem>
<para>
- component-class: <classname>org.ajax4jsf.component.html.AjaxLoadBundle</classname>
+ <parameter>component-family</parameter>: <classname>org.ajax4jsf.Bundle</classname>
</para>
</listitem>
</itemizedlist>
@@ -115,22 +115,22 @@
<itemizedlist>
<listitem>
<para>
- component-type: <classname>org.ajax4jsf.LoadScript</classname>
+ <parameter>component-type</parameter>: <classname>org.ajax4jsf.LoadScript</classname>
</para>
</listitem>
<listitem>
<para>
- component-family: <classname>org.ajax4jsf.LoadScript</classname>
+ <parameter>component-class</parameter>: <classname>org.ajax4jsf.component.html.HtmlLoadScript</classname>
</para>
</listitem>
<listitem>
<para>
- component-class: <classname>org.ajax4jsf.component.html.HtmlLoadScript</classname>
+ <parameter>component-family</parameter>: <classname>org.ajax4jsf.LoadScript</classname>
</para>
</listitem>
<listitem>
<para>
- renderer-type: <classname>org.ajax4jsf.LoadScriptRenderer</classname>
+ <parameter>renderer-type</parameter>: <classname>org.ajax4jsf.LoadScriptRenderer</classname>
</para>
</listitem>
</itemizedlist>
@@ -157,22 +157,22 @@
<itemizedlist>
<listitem>
<para>
- component-type: <classname>org.ajax4jsf.LoadStyle</classname>
+ <parameter>component-type</parameter>: <classname>org.ajax4jsf.LoadStyle</classname>
</para>
</listitem>
<listitem>
<para>
- component-family: <classname>org.ajax4jsf.LoadStyle</classname>
+ <parameter>component-class</parameter>: <classname>org.ajax4jsf.component.html.HtmlLoadStyle</classname>
</para>
</listitem>
<listitem>
<para>
- component-class: <classname>org.ajax4jsf.component.html.HtmlLoadStyle</classname>
+ <parameter>component-family</parameter>: <classname>org.ajax4jsf.LoadStyle</classname>
</para>
</listitem>
<listitem>
<para>
- renderer-type: <classname>org.ajax4jsf.LoadStyleRenderer</classname>
+ <parameter>renderer-type</parameter>: <classname>org.ajax4jsf.LoadStyleRenderer</classname>
</para>
</listitem>
</itemizedlist>
@@ -197,17 +197,17 @@
<itemizedlist>
<listitem>
<para>
- component-type: <classname>org.ajax4jsf.components.KeepAlive</classname>
+ <parameter>component-type</parameter>: <classname>org.ajax4jsf.components.KeepAlive</classname>
</para>
</listitem>
<listitem>
<para>
- component-family: <classname>org.ajax4jsf.components.AjaxKeepAlive</classname>
+ <parameter>component-class</parameter>: <classname>org.ajax4jsf.components.AjaxKeepAlive</classname>
</para>
</listitem>
<listitem>
<para>
- component-class: <classname>org.ajax4jsf.components.AjaxKeepAlive</classname>
+ <parameter>component-family</parameter>: <classname>org.ajax4jsf.components.AjaxKeepAlive</classname>
</para>
</listitem>
</itemizedlist>
@@ -236,22 +236,22 @@
<itemizedlist>
<listitem>
<para>
- component-type: <classname>org.ajax4jsf.Push</classname>
+ <parameter>component-type</parameter>: <classname>org.ajax4jsf.Push</classname>
</para>
</listitem>
<listitem>
<para>
- component-family: <classname>org.ajax4jsf.components.AjaxPush</classname>
+ <parameter>component-class</parameter>: <classname>org.ajax4jsf.component.html.AjaxPush</classname>
</para>
</listitem>
<listitem>
<para>
- component-class: <classname>org.ajax4jsf.component.html.AjaxPush</classname>
+ <parameter>component-family</parameter>: <classname>org.ajax4jsf.components.AjaxPush</classname>
</para>
</listitem>
<listitem>
<para>
- renderer-type: <classname>org.ajax4jsf.components.AjaxPushRenderer</classname>
+ <parameter>renderer-type</parameter>: <classname>org.ajax4jsf.components.AjaxPushRenderer</classname>
</para>
</listitem>
</itemizedlist>
Modified: branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Rich_inputs.xml
===================================================================
--- branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Rich_inputs.xml 2010-08-05 21:30:13 UTC (rev 18491)
+++ branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Rich_inputs.xml 2010-08-06 06:34:22 UTC (rev 18492)
@@ -270,6 +270,33 @@
<section id="sect-Component_Reference-Rich_inputs-richinplaceInput">
<title><sgmltag><rich:inplaceInput></sgmltag></title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <parameter>component-type</parameter>: <classname>org.richfaces.inplaceInput</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>component-class</parameter>: <classname>org.richfaces.component.html.HtmlInplaceInput</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>component-family</parameter>: <classname>org.richfaces.inplaceInput</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>renderer-type</parameter>: <classname>org.richfaces.renderkit.inplaceInputRenderer</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>tag-class</parameter>: <classname>org.richfaces.taglib.inplaceInputTag</classname>
+ </para>
+ </listitem>
+ </itemizedlist>
<para>
The <sgmltag><rich:inplaceInput></sgmltag> component allows information to be entered in-line in blocks of text, improving readability of the text. Changes can be rendered either in-line or for the whole block, and inputs can be focused with keyboard navigation. The component has three functional states: the "view" state, where the component displays its initial setting, such as "click to edit"; the "edit" state, where the user can input text; and the "changed" state, where the new value for the component has been confirmed but can be edited again if required.
</para>
@@ -314,6 +341,33 @@
<section id="sect-Component_Reference-Rich_inputs-richinplaceSelect">
<title><sgmltag><rich:inplaceSelect></sgmltag></title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <parameter>component-type</parameter>: <classname>org.richfaces.inplaceSelect</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>component-class</parameter>: <classname>org.richfaces.component.html.HtmlInplaceSelect</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>component-family</parameter>: <classname>org.richfaces.inplaceSelect</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>renderer-type</parameter>: <classname>org.richfaces.renderkit.inplaceSelectRenderer</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>tag-class</parameter>: <classname>org.richfaces.taglib.inplaceSelectTag</classname>
+ </para>
+ </listitem>
+ </itemizedlist>
<para>
The <sgmltag><rich:inplaceSelect></sgmltag> component is similar to the <sgmltag><rich:inplaceInput></sgmltag> component, but the uses a drop-down selection box to enter text instead of a regular text field. Changes can be rendered either in-line or for the whole block, and inputs can be focused with keyboard navigation. The component has three functional states: the "view" state, where the component displays its initial setting, such as "click to edit"; the "edit" state, where the user can select a value from a drop-down list; and the "changed" state, where the new value for the component has been confirmed but can be edited again if required.
</para>
@@ -371,6 +425,33 @@
<section id="sect-Component_Reference-Rich_inputs-richinputNumberSlider">
<title><sgmltag><rich:inputNumberSlider></sgmltag></title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <parameter>component-type</parameter>: <classname>org.richfaces.inputNumberSlider</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>component-class</parameter>: <classname>org.richfaces.component.html.HtmlInputNumberSlider</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>component-family</parameter>: <classname>org.richfaces.inputNumberSlider</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>renderer-type</parameter>: <classname>org.richfaces.renderkit.inputNumberSliderRenderer</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>tag-class</parameter>: <classname>org.richfaces.taglib.inputNumberSliderTag</classname>
+ </para>
+ </listitem>
+ </itemizedlist>
<para>
The <sgmltag><rich:inputNumberSlider></sgmltag> component provides a slider for changing numerical values. Optional features include a tool-tip to display the value while sliding, and a text field for typing the numerical value which can then be validated against the slider's range.
</para>
Modified: branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Tables_and_grids.xml
===================================================================
--- branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Tables_and_grids.xml 2010-08-05 21:30:13 UTC (rev 18491)
+++ branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Tables_and_grids.xml 2010-08-06 06:34:22 UTC (rev 18492)
@@ -20,22 +20,22 @@
<itemizedlist>
<listitem>
<para>
- component-type: <classname>org.ajax4jsf.Repeat</classname>
+ <parameter>component-type</parameter>: <classname>org.ajax4jsf.Repeat</classname>
</para>
</listitem>
<listitem>
<para>
- component-family: <classname>javax.faces.Data</classname>
+ <parameter>component-class</parameter>: <classname>org.ajax4jsf.component.html.HtmlAjaxRepeat</classname>
</para>
</listitem>
<listitem>
<para>
- component-class: <classname>org.ajax4jsf.component.html.HtmlAjaxRepeat</classname>
+ <parameter>component-family</parameter>: <classname>javax.faces.Data</classname>
</para>
</listitem>
<listitem>
<para>
- renderer-type: <classname>org.ajax4jsf.components.RepeatRenderer</classname>
+ <parameter>renderer-type</parameter>: <classname>org.ajax4jsf.components.RepeatRenderer</classname>
</para>
</listitem>
</itemizedlist>
@@ -64,27 +64,27 @@
<itemizedlist>
<listitem>
<para>
- component-type: <classname>org.richfaces.Column</classname>
+ <parameter>component-type</parameter>: <classname>org.richfaces.Column</classname>
</para>
</listitem>
<listitem>
<para>
- component-class: <classname>org.richfaces.component.html.HtmlColumn</classname>
+ <parameter>component-class</parameter>: <classname>org.richfaces.component.html.HtmlColumn</classname>
</para>
</listitem>
<listitem>
<para>
- component-family: <classname>org.richfaces.Column</classname>
+ <parameter>component-family</parameter>: <classname>org.richfaces.Column</classname>
</para>
</listitem>
<listitem>
<para>
- renderer-type: <classname>org.richfaces.renderkit.CellRenderer</classname>
+ <parameter>renderer-type</parameter>: <classname>org.richfaces.renderkit.CellRenderer</classname>
</para>
</listitem>
<listitem>
<para>
- tag-class: <classname>org.richfaces.taglib.ColumnTag</classname>
+ <parameter>tag-class</parameter>: <classname>org.richfaces.taglib.ColumnTag</classname>
</para>
</listitem>
</itemizedlist>
@@ -218,27 +218,27 @@
<itemizedlist>
<listitem>
<para>
- component-type: <classname>org.richfaces.ColumnGroup</classname>
+ <parameter>component-type</parameter>: <classname>org.richfaces.ColumnGroup</classname>
</para>
</listitem>
<listitem>
<para>
- component-class: <classname>org.richfaces.component.html.HtmlColumnGroup</classname>
+ <parameter>component-class</parameter>: <classname>org.richfaces.component.html.HtmlColumnGroup</classname>
</para>
</listitem>
<listitem>
<para>
- component-family: <classname>org.richfaces.ColumnGroup</classname>
+ <parameter>component-family</parameter>: <classname>org.richfaces.ColumnGroup</classname>
</para>
</listitem>
<listitem>
<para>
- renderer-type: <classname>org.richfaces.ColumnGroupRenderer</classname>
+ <parameter>renderer-type</parameter>: <classname>org.richfaces.ColumnGroupRenderer</classname>
</para>
</listitem>
<listitem>
<para>
- tag-class: <classname>org.richfaces.taglib.ColumnGroupTag</classname>
+ <parameter>tag-class</parameter>: <classname>org.richfaces.taglib.ColumnGroupTag</classname>
</para>
</listitem>
</itemizedlist>
@@ -308,12 +308,12 @@
<itemizedlist>
<listitem>
<para>
- component-type: <classname>org.richfaces.Column</classname>
+ <parameter>component-type</parameter>: <classname>org.richfaces.Column</classname>
</para>
</listitem>
<listitem>
<para>
- tag-class: <classname>org.richfaces.taglib.ColumnsTagHandler</classname>
+ <parameter>tag-class</parameter>: <classname>org.richfaces.taglib.ColumnsTagHandler</classname>
</para>
</listitem>
</itemizedlist>
@@ -384,27 +384,27 @@
<itemizedlist>
<listitem>
<para>
- component-type: <classname>org.richfaces.DataDefinitionList</classname>
+ <parameter>component-type</parameter>: <classname>org.richfaces.DataDefinitionList</classname>
</para>
</listitem>
<listitem>
<para>
- component-class: <classname>org.richfaces.component.html.HtmlDataDefinitionList</classname>
+ <parameter>component-class</parameter>: <classname>org.richfaces.component.html.HtmlDataDefinitionList</classname>
</para>
</listitem>
<listitem>
<para>
- component-family: <classname>org.richfaces.DataDefinitionList</classname>
+ <parameter>component-family</parameter>: <classname>org.richfaces.DataDefinitionList</classname>
</para>
</listitem>
<listitem>
<para>
- renderer-type: <classname>org.richfaces.DataDefinitionListRenderer</classname>
+ <parameter>renderer-type</parameter>: <classname>org.richfaces.DataDefinitionListRenderer</classname>
</para>
</listitem>
<listitem>
<para>
- tag-class: <classname>org.richfaces.taglib.DataDefinitionListTag</classname>
+ <parameter>tag-class</parameter>: <classname>org.richfaces.taglib.DataDefinitionListTag</classname>
</para>
</listitem>
</itemizedlist>
@@ -445,27 +445,27 @@
<itemizedlist>
<listitem>
<para>
- component-type: <classname>org.richfaces.DataFilterSlider</classname>
+ <parameter>component-type</parameter>: <classname>org.richfaces.DataFilterSlider</classname>
</para>
</listitem>
<listitem>
<para>
- component-class: <classname>org.richfaces.component.html.HtmlDataFilterSlider</classname>
+ <parameter>component-class</parameter>: <classname>org.richfaces.component.html.HtmlDataFilterSlider</classname>
</para>
</listitem>
<listitem>
<para>
- component-family: <classname>org.richfaces.DataFilterSlider</classname>
+ <parameter>component-family</parameter>: <classname>org.richfaces.DataFilterSlider</classname>
</para>
</listitem>
<listitem>
<para>
- renderer-type: <classname>org.richfaces.DataFilterSliderRenderer</classname>
+ <parameter>renderer-type</parameter>: <classname>org.richfaces.DataFilterSliderRenderer</classname>
</para>
</listitem>
<listitem>
<para>
- tag-class: <classname>org.richfaces.taglib.dataFilterSliderTag</classname>
+ <parameter>tag-class</parameter>: <classname>org.richfaces.taglib.dataFilterSliderTag</classname>
</para>
</listitem>
</itemizedlist>
@@ -510,27 +510,27 @@
<itemizedlist>
<listitem>
<para>
- component-type: <classname>org.richfaces.DataGrid</classname>
+ <parameter>component-type</parameter>: <classname>org.richfaces.DataGrid</classname>
</para>
</listitem>
<listitem>
<para>
- component-class: <classname>org.richfaces.component.html.HtmlDataGrid</classname>
+ <parameter>component-class</parameter>: <classname>org.richfaces.component.html.HtmlDataGrid</classname>
</para>
</listitem>
<listitem>
<para>
- component-family: <classname>org.richfaces.DataGrid</classname>
+ <parameter>component-family</parameter>: <classname>org.richfaces.DataGrid</classname>
</para>
</listitem>
<listitem>
<para>
- renderer-type: <classname>org.richfaces.DataGridRenderer</classname>
+ <parameter>renderer-type</parameter>: <classname>org.richfaces.DataGridRenderer</classname>
</para>
</listitem>
<listitem>
<para>
- tag-class: <classname>org.richfaces.taglib.DataGridTag</classname>
+ <parameter>tag-class</parameter>: <classname>org.richfaces.taglib.DataGridTag</classname>
</para>
</listitem>
</itemizedlist>
@@ -603,27 +603,27 @@
<itemizedlist>
<listitem>
<para>
- component-type: <classname>org.richfaces.DataList</classname>
+ <parameter>component-type</parameter>: <classname>org.richfaces.DataList</classname>
</para>
</listitem>
<listitem>
<para>
- component-class: <classname>org.richfaces.component.html.HtmlDataList</classname>
+ <parameter>component-class</parameter>: <classname>org.richfaces.component.html.HtmlDataList</classname>
</para>
</listitem>
<listitem>
<para>
- component-family: <classname>org.richfaces.DataList</classname>
+ <parameter>component-family</parameter>: <classname>org.richfaces.DataList</classname>
</para>
</listitem>
<listitem>
<para>
- renderer-type: <classname>org.richfaces.DataListRenderer</classname>
+ <parameter>renderer-type</parameter>: <classname>org.richfaces.DataListRenderer</classname>
</para>
</listitem>
<listitem>
<para>
- tag-class: <classname>org.richfaces.taglib.DataListTag</classname>
+ <parameter>tag-class</parameter>: <classname>org.richfaces.taglib.DataListTag</classname>
</para>
</listitem>
</itemizedlist>
@@ -690,27 +690,27 @@
<itemizedlist>
<listitem>
<para>
- component-type: <classname>org.richfaces.DataOrderedList</classname>
+ <parameter>component-type</parameter>: <classname>org.richfaces.DataOrderedList</classname>
</para>
</listitem>
<listitem>
<para>
- component-class: <classname>org.richfaces.component.html.HtmlDataOrderedList</classname>
+ <parameter>component-class</parameter>: <classname>org.richfaces.component.html.HtmlDataOrderedList</classname>
</para>
</listitem>
<listitem>
<para>
- component-family: <classname>org.richfaces.DataOrderedList</classname>
+ <parameter>component-family</parameter>: <classname>org.richfaces.DataOrderedList</classname>
</para>
</listitem>
<listitem>
<para>
- renderer-type: <classname>org.richfaces.DataOrderedListRenderer</classname>
+ <parameter>renderer-type</parameter>: <classname>org.richfaces.DataOrderedListRenderer</classname>
</para>
</listitem>
<listitem>
<para>
- tag-class: <classname>org.richfaces.taglib.DataOrderedListTag</classname>
+ <parameter>tag-class</parameter>: <classname>org.richfaces.taglib.DataOrderedListTag</classname>
</para>
</listitem>
</itemizedlist>
@@ -796,27 +796,27 @@
<itemizedlist>
<listitem>
<para>
- component-type: <classname>org.richfaces.DataTable</classname>
+ <parameter>component-type</parameter>: <classname>org.richfaces.DataTable</classname>
</para>
</listitem>
<listitem>
<para>
- component-class: <classname>org.richfaces.component.html.HtmlDataTable</classname>
+ <parameter>component-class</parameter>: <classname>org.richfaces.component.html.HtmlDataTable</classname>
</para>
</listitem>
<listitem>
<para>
- component-family: <classname>org.richfaces.DataTable</classname>
+ <parameter>component-family</parameter>: <classname>org.richfaces.DataTable</classname>
</para>
</listitem>
<listitem>
<para>
- renderer-type: <classname>org.richfaces.DataTableRenderer</classname>
+ <parameter>renderer-type</parameter>: <classname>org.richfaces.DataTableRenderer</classname>
</para>
</listitem>
<listitem>
<para>
- tag-class: <classname>org.richfaces.taglib.DataTableTag</classname>
+ <parameter>tag-class</parameter>: <classname>org.richfaces.taglib.DataTableTag</classname>
</para>
</listitem>
</itemizedlist>
@@ -831,27 +831,27 @@
<itemizedlist>
<listitem>
<para>
- component-type: <classname>org.richfaces.DataTable</classname>
+ <parameter>component-type</parameter>: <classname>org.richfaces.DataTable</classname>
</para>
</listitem>
<listitem>
<para>
- component-class: <classname>org.richfaces.component.html.HtmlDataTable</classname>
+ <parameter>component-class</parameter>: <classname>org.richfaces.component.html.HtmlDataTable</classname>
</para>
</listitem>
<listitem>
<para>
- component-family: <classname>org.richfaces.DataTable</classname>
+ <parameter>component-family</parameter>: <classname>org.richfaces.DataTable</classname>
</para>
</listitem>
<listitem>
<para>
- renderer-type: <classname>org.richfaces.DataTableRenderer</classname>
+ <parameter>renderer-type</parameter>: <classname>org.richfaces.DataTableRenderer</classname>
</para>
</listitem>
<listitem>
<para>
- tag-class: <classname>org.richfaces.taglib.DataTableTag</classname>
+ <parameter>tag-class</parameter>: <classname>org.richfaces.taglib.DataTableTag</classname>
</para>
</listitem>
</itemizedlist>
@@ -901,27 +901,27 @@
<itemizedlist>
<listitem>
<para>
- component-type: <classname>org.richfaces.ExtendedDataTable</classname>
+ <parameter>component-type</parameter>: <classname>org.richfaces.ExtendedDataTable</classname>
</para>
</listitem>
<listitem>
<para>
- component-class: <classname>org.richfaces.component.html.HtmlExtendedDataTable</classname>
+ <parameter>component-class</parameter>: <classname>org.richfaces.component.html.HtmlExtendedDataTable</classname>
</para>
</listitem>
<listitem>
<para>
- component-family: <classname>org.richfaces.ExtendedDataTable</classname>
+ <parameter>component-family</parameter>: <classname>org.richfaces.ExtendedDataTable</classname>
</para>
</listitem>
<listitem>
<para>
- renderer-type: <classname>org.richfaces.ExtendedDataTableRenderer</classname>
+ <parameter>renderer-type</parameter>: <classname>org.richfaces.ExtendedDataTableRenderer</classname>
</para>
</listitem>
<listitem>
<para>
- tag-class: <classname>org.richfaces.taglib.ExtendedDataTableTag</classname>
+ <parameter>tag-class</parameter>: <classname>org.richfaces.taglib.ExtendedDataTableTag</classname>
</para>
</listitem>
</itemizedlist>
Modified: branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Validation.xml
===================================================================
--- branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Validation.xml 2010-08-05 21:30:13 UTC (rev 18491)
+++ branches/development/docs/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Validation.xml 2010-08-06 06:34:22 UTC (rev 18492)
@@ -11,27 +11,27 @@
<itemizedlist>
<listitem>
<para>
- component-type: <classname>org.richfaces.ajaxValidator</classname>
+ <parameter>component-type</parameter>: <classname>org.richfaces.ajaxValidator</classname>
</para>
</listitem>
<listitem>
<para>
- component-class: <classname>org.richfaces.component.html.HtmlajaxValidator</classname>
+ <parameter>component-class</parameter>: <classname>org.richfaces.component.html.HtmlajaxValidator</classname>
</para>
</listitem>
<listitem>
<para>
- component-family: <classname>org.richfaces.ajaxValidator</classname>
+ <parameter>component-family</parameter>: <classname>org.richfaces.ajaxValidator</classname>
</para>
</listitem>
<listitem>
<para>
- renderer-type: <classname>org.richfaces.ajaxValidatorRenderer</classname>
+ <parameter>renderer-type</parameter>: <classname>org.richfaces.ajaxValidatorRenderer</classname>
</para>
</listitem>
<listitem>
<para>
- tag-class: <classname>org.richfaces.taglib.ajaxValidatorTag</classname>
+ <parameter>tag-class</parameter>: <classname>org.richfaces.taglib.ajaxValidatorTag</classname>
</para>
</listitem>
</itemizedlist>
@@ -90,27 +90,27 @@
<itemizedlist>
<listitem>
<para>
- component-type: <classname>org.richfaces.beanValidator</classname>
+ <parameter>component-type</parameter>: <classname>org.richfaces.beanValidator</classname>
</para>
</listitem>
<listitem>
<para>
- component-class: <classname>org.richfaces.component.html.HtmlbeanValidator</classname>
+ <parameter>component-class</parameter>: <classname>org.richfaces.component.html.HtmlbeanValidator</classname>
</para>
</listitem>
<listitem>
<para>
- component-family: <classname>org.richfaces.beanValidator</classname>
+ <parameter>component-family</parameter>: <classname>org.richfaces.beanValidator</classname>
</para>
</listitem>
<listitem>
<para>
- renderer-type: <classname>org.richfaces.beanValidatorRenderer</classname>
+ <parameter>renderer-type</parameter>: <classname>org.richfaces.beanValidatorRenderer</classname>
</para>
</listitem>
<listitem>
<para>
- tag-class: <classname>org.richfaces.taglib.beanValidatorTag</classname>
+ <parameter>tag-class</parameter>: <classname>org.richfaces.taglib.beanValidatorTag</classname>
</para>
</listitem>
</itemizedlist>
@@ -159,27 +159,27 @@
<itemizedlist>
<listitem>
<para>
- component-type: <classname>org.richfaces.graphValidator</classname>
+ <parameter>component-type</parameter>: <classname>org.richfaces.graphValidator</classname>
</para>
</listitem>
<listitem>
<para>
- component-class: <classname>org.richfaces.component.html.HtmlgraphValidator</classname>
+ <parameter>component-class</parameter>: <classname>org.richfaces.component.html.HtmlgraphValidator</classname>
</para>
</listitem>
<listitem>
<para>
- component-family: <classname>org.richfaces.graphValidator</classname>
+ <parameter>component-family</parameter>: <classname>org.richfaces.graphValidator</classname>
</para>
</listitem>
<listitem>
<para>
- renderer-type: <classname>org.richfaces.graphValidatorRenderer</classname>
+ <parameter>renderer-type</parameter>: <classname>org.richfaces.graphValidatorRenderer</classname>
</para>
</listitem>
<listitem>
<para>
- tag-class: <classname>org.richfaces.taglib.graphValidatorTag</classname>
+ <parameter>tag-class</parameter>: <classname>org.richfaces.taglib.graphValidatorTag</classname>
</para>
</listitem>
</itemizedlist>
15 years, 9 months
JBoss Rich Faces SVN: r18491 - in root/sandbox/cdk/maven-resources-plugin: src/it/richfaces-application and 19 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-08-05 17:30:13 -0400 (Thu, 05 Aug 2010)
New Revision: 18491
Added:
root/sandbox/cdk/maven-resources-plugin/src/it/richfaces-application/src/main/webapp/
root/sandbox/cdk/maven-resources-plugin/src/it/richfaces-application/src/main/webapp/resources/
root/sandbox/cdk/maven-resources-plugin/src/it/richfaces-application/src/main/webapp/resources/versioned.lib/
root/sandbox/cdk/maven-resources-plugin/src/it/richfaces-application/src/main/webapp/resources/versioned.lib/2_0/
root/sandbox/cdk/maven-resources-plugin/src/it/richfaces-application/src/main/webapp/resources/versioned.lib/2_0/jquery/
root/sandbox/cdk/maven-resources-plugin/src/it/richfaces-application/src/main/webapp/resources/versioned.lib/2_0/jquery/1_3_2.js
root/sandbox/cdk/maven-resources-plugin/src/it/richfaces-application/src/main/webapp/resources/versioned.lib/2_0/jquery/1_4_2.js
root/sandbox/cdk/maven-resources-plugin/src/it/richfaces-application/src/main/webapp/resources/versioned.lib/2_1/
root/sandbox/cdk/maven-resources-plugin/src/it/richfaces-application/src/main/webapp/resources/versioned.lib/2_1/jquery/
root/sandbox/cdk/maven-resources-plugin/src/it/richfaces-application/src/main/webapp/resources/versioned.lib/2_1/jquery/1_4_2.js
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/ResourceKey.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/ResourceUtil.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/AbstractResourceHandler.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/DynamicResourceHandler.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/DynamicResourceWrapper.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/StaticResourceHandler.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/VFSResource.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/scan/
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/scan/ResourcesScanner.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/scan/impl/
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/scan/impl/DynamicResourcesScanner.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/scan/impl/StaticResourcesScanner.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/scan/impl/reflections/
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/scan/impl/reflections/MarkerResourcesScanner.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/scan/impl/reflections/ReflectionsExt.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/scanner/
Removed:
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/ResourceInfo.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/ResourcesScanner.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/faces/ResourceHandlerImpl.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/MarkerResourcesScanner.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/ReflectionsExt.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/ResourcesScannerImpl.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/StaticResourcesScannerImpl.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/URLResource.java
Modified:
root/sandbox/cdk/maven-resources-plugin/pom.xml
root/sandbox/cdk/maven-resources-plugin/src/it/richfaces-application/pom.xml
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/ProcessMojo.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/ResourceTaskFactory.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/faces/ApplicationImpl.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/faces/FacesImpl.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/faces/ResourceELResolver.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/naming/FileNameMapperImpl.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/ResourceWriterImpl.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/task/ResourceTaskFactoryImpl.java
root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/util/MorePredicates.java
Log:
Dynamic resources prerenderer: latest changes check-in
Modified: root/sandbox/cdk/maven-resources-plugin/pom.xml
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/pom.xml 2010-08-05 20:59:23 UTC (rev 18490)
+++ root/sandbox/cdk/maven-resources-plugin/pom.xml 2010-08-05 21:30:13 UTC (rev 18491)
@@ -104,6 +104,19 @@
<artifactId>slf4j-simple</artifactId>
<version>1.5.8</version>
</dependency>
+
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-vfs</artifactId>
+ <version>3.0.0.CR5</version>
+ </dependency>
+
+ <!-- TODO use maven logging -->
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-log4j</artifactId>
+ <version>2.2.0.CR1</version>
+ </dependency>
</dependencies>
<build>
Modified: root/sandbox/cdk/maven-resources-plugin/src/it/richfaces-application/pom.xml
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/it/richfaces-application/pom.xml 2010-08-05 20:59:23 UTC (rev 18490)
+++ root/sandbox/cdk/maven-resources-plugin/src/it/richfaces-application/pom.xml 2010-08-05 21:30:13 UTC (rev 18491)
@@ -5,6 +5,7 @@
<artifactId>richfaces-application</artifactId>
<name>Test component annotations</name>
<version>0.0.1-SNAPSHOT</version>
+ <packaging>war</packaging>
<build>
<plugins>
<plugin>
@@ -35,7 +36,7 @@
<include>text/css</include>
<include>image/.+</include>
</includedContentTypes>
- <fileNameMappings>
+ <!-- fileNameMappings>
<property>
<name>^org\.richfaces\.renderkit\.html\.(images\.)?</name>
<value>org.richfaces/images/</value>
@@ -44,7 +45,7 @@
<name>^css/</name>
<value>org.richfaces/css/</value>
</property>
- </fileNameMappings>
+ </fileNameMappings -->
</configuration>
</execution>
</executions>
Added: root/sandbox/cdk/maven-resources-plugin/src/it/richfaces-application/src/main/webapp/resources/versioned.lib/2_0/jquery/1_3_2.js
===================================================================
Added: root/sandbox/cdk/maven-resources-plugin/src/it/richfaces-application/src/main/webapp/resources/versioned.lib/2_0/jquery/1_4_2.js
===================================================================
Added: root/sandbox/cdk/maven-resources-plugin/src/it/richfaces-application/src/main/webapp/resources/versioned.lib/2_1/jquery/1_4_2.js
===================================================================
Modified: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/ProcessMojo.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/ProcessMojo.java 2010-08-05 20:59:23 UTC (rev 18490)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/ProcessMojo.java 2010-08-05 21:30:13 UTC (rev 18491)
@@ -31,6 +31,7 @@
import java.net.URLClassLoader;
import java.util.Collection;
import java.util.List;
+import java.util.Locale;
import java.util.Properties;
import java.util.concurrent.CompletionService;
import java.util.concurrent.ExecutionException;
@@ -39,18 +40,24 @@
import java.util.concurrent.Future;
import javax.faces.application.Resource;
+import javax.faces.application.ResourceHandler;
import org.apache.maven.artifact.DependencyResolutionRequiredException;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.project.MavenProject;
+import org.jboss.vfs.VirtualFile;
import org.richfaces.cdk.concurrent.CountingExecutorCompletionService;
import org.richfaces.cdk.faces.FacesImpl;
import org.richfaces.cdk.naming.FileNameMapperImpl;
+import org.richfaces.cdk.resource.ResourceUtil;
import org.richfaces.cdk.resource.ResourceWriterImpl;
-import org.richfaces.cdk.resource.ResourcesScannerImpl;
-import org.richfaces.cdk.resource.StaticResourcesScannerImpl;
+import org.richfaces.cdk.resource.handler.impl.DynamicResourceHandler;
+import org.richfaces.cdk.resource.handler.impl.StaticResourceHandler;
+import org.richfaces.cdk.resource.scan.ResourcesScanner;
+import org.richfaces.cdk.resource.scan.impl.DynamicResourcesScanner;
+import org.richfaces.cdk.resource.scan.impl.StaticResourcesScanner;
import org.richfaces.cdk.task.ResourceTaskFactoryImpl;
import org.richfaces.cdk.util.ClasspathUtil;
import org.richfaces.cdk.util.MoreConstraints;
@@ -61,6 +68,8 @@
import com.google.common.base.Predicates;
import com.google.common.collect.Constraints;
import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
/**
* @goal process
* @requiresDependencyResolution compile
@@ -72,7 +81,8 @@
private static final Function<String, Predicate<CharSequence>> REGEX_CONTAINS_BUILDER_FUNCTION = new Function<String, Predicate<CharSequence>>() {
public Predicate<CharSequence> apply(String from) {
- return Predicates.containsPattern(from);
+ Predicate<CharSequence> containsPredicate = Predicates.containsPattern(from);
+ return Predicates.and(Predicates.notNull(), containsPredicate);
};
};
@@ -130,15 +140,23 @@
* @parameter
*/
// TODO review usage of properties?
- private Properties fileNameMappings;
+ private Properties fileNameMappings = new Properties();
/**
* @parameter
*/
private ProcessMode processMode = ProcessMode.embedded;
+ /**
+ * @parameter expression="${basedir}/src/main/webapp"
+ */
private String webRoot;
+ //TODO handle resource locales
+ private Locale resourceLocales;
+
+ private Collection<ResourceKey> foundResources = Sets.newHashSet();
+
// TODO executor parameters
private static ExecutorService createExecutorService() {
return Executors.newSingleThreadExecutor();
@@ -150,20 +168,30 @@
return Predicates.compose(contentTypePredicate, CONTENT_TYPE_FUNCTION);
}
- private ResourcesScanner createResourcesScanner() {
- Collection<URL> urls = ClasspathUtil.getFacesClasspathUrls();
- switch (processMode) {
- case external:
- //TODO webroot
- return new StaticResourcesScannerImpl(urls, null);
- case embedded:
- return new ResourcesScannerImpl(urls);
-
- default:
- throw new IllegalArgumentException();
+ private URL resolveWebRoot() throws MalformedURLException {
+ File result = new File(webRoot);
+ if (!result.exists()) {
+ result = new File(project.getBasedir(), webRoot);
}
+ if (!result.exists()) {
+ return null;
+ }
+
+ return result.toURI().toURL();
}
+ private void scanDynamicResources(Collection<URL> cpUrls) throws Exception {
+ ResourcesScanner scanner = new DynamicResourcesScanner(cpUrls);
+ scanner.scan();
+ foundResources.addAll(scanner.getResources());
+ }
+
+ private void scanStaticResources(Collection<VirtualFile> resourceRoots) throws Exception {
+ ResourcesScanner scanner = new StaticResourcesScanner(resourceRoots);
+ scanner.scan();
+ foundResources.addAll(scanner.getResources());
+ }
+
protected ClassLoader createProjectClassLoader(MavenProject project, boolean useCCL) {
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
@@ -187,11 +215,20 @@
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
+
ClassLoader cCL = Thread.currentThread().getContextClassLoader();
Faces faces = null;
ExecutorService executorService = null;
try {
+ URL webRootUrl = resolveWebRoot();
+
+ Collection<URL> cpUrls = ClasspathUtil.getFacesClasspathUrls();
+ Collection<VirtualFile> resourceRoots = ResourceUtil.getResourceRoots(cpUrls, webRootUrl);
+
+ scanDynamicResources(cpUrls);
+ scanStaticResources(resourceRoots);
+
ClassLoader projectCL = createProjectClassLoader(project, true);
Thread.currentThread().setContextClassLoader(projectCL);
@@ -200,26 +237,23 @@
outputDirFile = new File(project.getBuild().getDirectory(), outputDir);
}
+ ResourceHandler resourceHandler = new DynamicResourceHandler(new StaticResourceHandler(resourceRoots));
+
+ // TODO set webroot
+ faces = new FacesImpl(null, new FileNameMapperImpl(Maps.fromProperties(fileNameMappings)), resourceHandler);
+ faces.start();
+
ResourceWriterImpl resourceWriter = new ResourceWriterImpl(outputDirFile);
- ResourceTaskFactoryImpl taskFactory = new ResourceTaskFactoryImpl();
+ ResourceTaskFactoryImpl taskFactory = new ResourceTaskFactoryImpl(faces);
taskFactory.setResourceWriter(resourceWriter);
- // TODO set webroot
- faces = new FacesImpl(null, new FileNameMapperImpl(fileNameMappings), taskFactory);
- faces.start();
-
- ResourcesScanner resourcesScanner = createResourcesScanner();
- resourcesScanner.scan();
-
executorService = createExecutorService();
CompletionService<Object> completionService = new CountingExecutorCompletionService<Object>(executorService);
taskFactory.setCompletionService(completionService);
taskFactory.setSkins(skins);
taskFactory.setLog(getLog());
taskFactory.setFilter(createResourcesFilter());
- for (ResourceInfo resourceInfo : resourcesScanner.getResources()) {
- taskFactory.submit(resourceInfo);
- }
+ taskFactory.submit(foundResources);
Future<Object> future = null;
while (true) {
Deleted: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/ResourceInfo.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/ResourceInfo.java 2010-08-05 20:59:23 UTC (rev 18490)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/ResourceInfo.java 2010-08-05 21:30:13 UTC (rev 18491)
@@ -1,103 +0,0 @@
-/*
- * 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;
-
-import com.google.common.base.Objects;
-
-/**
- * @author Nick Belaevski
- *
- */
-public class ResourceInfo {
-
- public static final String CLASSPATH_RESOURCES_LOCATION = "META-INF/resources/";
-
- public static final String WEB_RESOURCES_LOCATION = "resources/";
-
- private final String resourceName;
-
- private final String libraryName;
-
- public ResourceInfo(String resourceName) {
- this(resourceName, null);
- }
-
- public ResourceInfo(String resourceName, String libraryName) {
- super();
- this.resourceName = resourceName;
- this.libraryName = libraryName;
- }
-
- public String getResourceName() {
- return resourceName;
- }
-
- public String getLibraryName() {
- return libraryName;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((libraryName == null) ? 0 : libraryName.hashCode());
- result = prime * result + ((resourceName == null) ? 0 : resourceName.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- ResourceInfo other = (ResourceInfo) obj;
- if (libraryName == null) {
- if (other.libraryName != null) {
- return false;
- }
- } else if (!libraryName.equals(other.libraryName)) {
- return false;
- }
- if (resourceName == null) {
- if (other.resourceName != null) {
- return false;
- }
- } else if (!resourceName.equals(other.resourceName)) {
- return false;
- }
- return true;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return Objects.toStringHelper(this).add("resourceName", resourceName).add("libraryName", libraryName).toString();
- }
-}
Added: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/ResourceKey.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/ResourceKey.java (rev 0)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/ResourceKey.java 2010-08-05 21:30:13 UTC (rev 18491)
@@ -0,0 +1,104 @@
+/*
+ * 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;
+
+import com.google.common.base.Objects;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class ResourceKey {
+
+ private String resourceName;
+
+ private String libraryName;
+
+ public ResourceKey(String resourceName) {
+ this(resourceName, null);
+ }
+
+ public ResourceKey(String resourceName, String libraryName) {
+ super();
+ this.resourceName = resourceName;
+ this.libraryName = libraryName;
+ }
+
+ public String getResourceName() {
+ return resourceName;
+ }
+
+ public String getLibraryName() {
+ return libraryName;
+ }
+
+ public void setResourceName(String resourceName) {
+ this.resourceName = resourceName;
+ }
+
+ public void setLibraryName(String libraryName) {
+ this.libraryName = libraryName;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((libraryName == null) ? 0 : libraryName.hashCode());
+ result = prime * result + ((resourceName == null) ? 0 : resourceName.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ ResourceKey other = (ResourceKey) obj;
+ if (libraryName == null) {
+ if (other.libraryName != null) {
+ return false;
+ }
+ } else if (!libraryName.equals(other.libraryName)) {
+ return false;
+ }
+ if (resourceName == null) {
+ if (other.resourceName != null) {
+ return false;
+ }
+ } else if (!resourceName.equals(other.resourceName)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return Objects.toStringHelper(this).add("resourceName", resourceName).add("libraryName", libraryName).toString();
+ }
+}
Modified: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/ResourceTaskFactory.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/ResourceTaskFactory.java 2010-08-05 20:59:23 UTC (rev 18490)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/ResourceTaskFactory.java 2010-08-05 21:30:13 UTC (rev 18491)
@@ -25,6 +25,7 @@
import javax.faces.application.Resource;
+
import com.google.common.base.Predicate;
/**
@@ -37,12 +38,10 @@
public void setCompletionService(CompletionService<Object> completionService);
- public void setFaces(Faces faces);
-
public void setResourceWriter(ResourceWriter resourceWriter);
public void setFilter(Predicate<Resource> filter);
- public void submit(ResourceInfo info);
+ public void submit(Iterable<ResourceKey> keys);
}
Deleted: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/ResourcesScanner.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/ResourcesScanner.java 2010-08-05 20:59:23 UTC (rev 18490)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/ResourcesScanner.java 2010-08-05 21:30:13 UTC (rev 18491)
@@ -1,38 +0,0 @@
-/*
- * 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;
-
-import java.util.Collection;
-
-/**
- * @author Nick Belaevski
- *
- */
-public interface ResourcesScanner {
-
- //TODO inclusions/exclusions
-
- public void scan();
-
- public Collection<ResourceInfo> getResources();
-
-}
Modified: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/faces/ApplicationImpl.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/faces/ApplicationImpl.java 2010-08-05 20:59:23 UTC (rev 18490)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/faces/ApplicationImpl.java 2010-08-05 21:30:13 UTC (rev 18491)
@@ -46,6 +46,8 @@
import javax.faces.event.ActionListener;
import javax.faces.validator.Validator;
+import org.richfaces.application.ServiceTracker;
+
import com.sun.el.ExpressionFactoryImpl;
/**
@@ -56,16 +58,10 @@
private ExpressionFactory expressionFactory = createExpressionFactory();
- private ResourceHandler resourceHandler = createResourceHandler();
-
private ExpressionFactory createExpressionFactory() {
return ExpressionFactoryImpl.newInstance();
}
- private ResourceHandler createResourceHandler() {
- return new ResourceHandlerImpl();
- }
-
/*
* (non-Javadoc)
*
@@ -475,7 +471,7 @@
*/
@Override
public ResourceHandler getResourceHandler() {
- return resourceHandler;
+ return ServiceTracker.getService(ResourceHandler.class);
}
@Override
Modified: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/faces/FacesImpl.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/faces/FacesImpl.java 2010-08-05 20:59:23 UTC (rev 18490)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/faces/FacesImpl.java 2010-08-05 21:30:13 UTC (rev 18491)
@@ -23,16 +23,18 @@
import java.util.Collections;
+import javax.faces.application.ResourceHandler;
import javax.faces.context.FacesContext;
import org.ajax4jsf.context.InitParametersStorage;
+import org.richfaces.application.DependencyInjectionServiceImpl;
+import org.richfaces.application.DependencyInjector;
import org.richfaces.application.Module;
import org.richfaces.application.ServiceTracker;
import org.richfaces.application.ServicesFactory;
import org.richfaces.application.ServicesFactoryImpl;
import org.richfaces.cdk.Faces;
import org.richfaces.cdk.FileNameMapper;
-import org.richfaces.cdk.ResourceTaskFactory;
import org.richfaces.cdk.skin.SkinFactoryImpl;
import org.richfaces.skin.SkinFactory;
@@ -46,27 +48,25 @@
private FileNameMapper fileNameMapper;
- private ResourceTaskFactory resourceTaskFactory;
+ private ResourceHandler resourceHandler;
- public FacesImpl(String webroot, FileNameMapper fileNameMapper, ResourceTaskFactory resourceTaskFactory) {
+ public FacesImpl(String webroot, FileNameMapper fileNameMapper, ResourceHandler resourceHandler) {
super();
this.webroot = webroot;
this.fileNameMapper = fileNameMapper;
- this.resourceTaskFactory = resourceTaskFactory;
- resourceTaskFactory.setFaces(this);
+ this.resourceHandler = resourceHandler;
}
public void start() {
- final SkinFactoryImpl skinFactory = new SkinFactoryImpl();
-
final ServicesFactoryImpl serviceFactory = new ServicesFactoryImpl();
Module module = new Module() {
public void configure(ServicesFactory factory) {
- serviceFactory.setInstance(SkinFactory.class, skinFactory);
+ serviceFactory.setInstance(SkinFactory.class, new SkinFactoryImpl());
serviceFactory.setInstance(InitParametersStorage.class, new InitParametersStorage());
serviceFactory.setInstance(FileNameMapper.class, fileNameMapper);
- serviceFactory.setInstance(ResourceTaskFactory.class, resourceTaskFactory);
+ serviceFactory.setInstance(DependencyInjector.class, new DependencyInjectionServiceImpl());
+ serviceFactory.setInstance(ResourceHandler.class, resourceHandler);
}
};
serviceFactory.init(Collections.singleton(module));
Modified: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/faces/ResourceELResolver.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/faces/ResourceELResolver.java 2010-08-05 20:59:23 UTC (rev 18490)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/faces/ResourceELResolver.java 2010-08-05 21:30:13 UTC (rev 18491)
@@ -34,9 +34,6 @@
import javax.faces.application.ResourceHandler;
import javax.faces.context.FacesContext;
-import org.richfaces.application.ServiceTracker;
-import org.richfaces.cdk.FileNameMapper;
-
import com.google.common.base.Joiner;
import com.google.common.base.Splitter;
import com.google.common.collect.Lists;
@@ -111,16 +108,14 @@
context.setPropertyResolved(true);
if (resource != null) {
- FileNameMapper fileNameMapper = ServiceTracker.getService(FileNameMapper.class);
- String name = fileNameMapper.createName(resource);
-
+ String requestPath = resource.getRequestPath();
FacesContext facesContext = (FacesContext) context.getContext(FacesContext.class);
Resource contextResource = CurrentResourceContext.getInstance(facesContext).getResource();
if (contextResource != null) {
- name = relativize(name, fileNameMapper.createName(contextResource));
+ requestPath = relativize(resource.getRequestPath(), contextResource.getRequestPath());
}
- return name;
+ return requestPath;
}
}
return null;
Deleted: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/faces/ResourceHandlerImpl.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/faces/ResourceHandlerImpl.java 2010-08-05 20:59:23 UTC (rev 18490)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/faces/ResourceHandlerImpl.java 2010-08-05 21:30:13 UTC (rev 18491)
@@ -1,152 +0,0 @@
-/*
- * 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.faces;
-
-import java.io.IOException;
-import java.lang.reflect.Modifier;
-import java.net.URL;
-
-import javax.faces.application.Resource;
-import javax.faces.application.ResourceHandler;
-import javax.faces.context.FacesContext;
-
-import org.reflections.util.Utils;
-import org.richfaces.application.ServiceTracker;
-import org.richfaces.cdk.ResourceInfo;
-import org.richfaces.cdk.ResourceTaskFactory;
-import org.richfaces.cdk.resource.URLResource;
-import org.richfaces.resource.CompiledCSSResource;
-import org.richfaces.resource.Java2DUserResource;
-import org.richfaces.resource.Java2DUserResourceWrapperImpl;
-import org.richfaces.resource.UserResource;
-import org.richfaces.resource.UserResourceWrapperImpl;
-
-import com.google.common.base.Strings;
-
-/**
- * @author Nick Belaevski
- *
- */
-public class ResourceHandlerImpl extends ResourceHandler {
-
- @Override
- public Resource createResource(String resourceName) {
- return createResource(resourceName, null);
- }
-
- @Override
- public Resource createResource(String resourceName, String libraryName) {
- return createResource(resourceName, libraryName, null);
- }
-
- @Override
- public Resource createResource(String resourceName, String libraryName, String contentType) {
- Resource result = null;
- if (Strings.isNullOrEmpty(libraryName)) {
- try {
- Class<?> resourceClass = Class.forName(resourceName, false, Utils.getContextClassLoader());
- if (resourceClass.isInterface() || (resourceClass.getModifiers() & Modifier.ABSTRACT) != 0) {
- return null;
- }
-
- Object resourceObject = resourceClass.newInstance();
- if (resourceObject instanceof Java2DUserResource) {
- result = new Java2DUserResourceWrapperImpl((Java2DUserResource) resourceObject);
- } else if (resourceObject instanceof UserResource) {
- result = new UserResourceWrapperImpl((UserResource) resourceObject);
- } else {
- result = (Resource) resourceObject;
- }
- } catch (ClassNotFoundException e) {
- //TODO ignore, but add to debug logs
- } catch (InstantiationException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
- if (result == null) {
- String resourcePath;
-
- if (libraryName != null && libraryName.length() != 0) {
- resourcePath = libraryName + '/' + resourceName;
- } else {
- resourcePath = resourceName;
- }
-
- URL url = Utils.getContextClassLoader().getResource(ResourceInfo.CLASSPATH_RESOURCES_LOCATION + resourcePath);
- if (url != null) {
- result = new URLResource(url);
-
- if (resourceName.endsWith(".ecss")) {
- //TODO process CSS dependencies
- result = new CompiledCSSResource(result);
- }
- }
- }
-
- if (result != null) {
- //TODO detect content type
- result.setContentType(contentType);
- result.setResourceName(resourceName);
- result.setLibraryName(libraryName);
-
- //TODO simply discover & process all available resources
- ResourceTaskFactory resourceTaskFactory = ServiceTracker.getService(ResourceTaskFactory.class);
- resourceTaskFactory.submit(new ResourceInfo(resourceName, libraryName));
- }
-
- return result;
- }
-
- /* (non-Javadoc)
- * @see javax.faces.application.ResourceHandler#libraryExists(java.lang.String)
- */
- @Override
- public boolean libraryExists(String libraryName) {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public void handleResourceRequest(FacesContext context) throws IOException {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public boolean isResourceRequest(FacesContext context) {
- throw new UnsupportedOperationException();
- }
-
- /* (non-Javadoc)
- * @see javax.faces.application.ResourceHandler#getRendererTypeForResourceName(java.lang.String)
- */
- @Override
- public String getRendererTypeForResourceName(String resourceName) {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
Modified: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/naming/FileNameMapperImpl.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/naming/FileNameMapperImpl.java 2010-08-05 20:59:23 UTC (rev 18490)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/naming/FileNameMapperImpl.java 2010-08-05 21:30:13 UTC (rev 18491)
@@ -22,17 +22,15 @@
package org.richfaces.cdk.naming;
import java.util.List;
+import java.util.Map;
import java.util.Map.Entry;
-import java.util.Properties;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.faces.application.Resource;
import org.richfaces.cdk.FileNameMapper;
-import org.richfaces.resource.VersionedResource;
-import com.google.common.base.Joiner;
import com.google.common.collect.Lists;
/**
@@ -42,9 +40,9 @@
public class FileNameMapperImpl implements FileNameMapper {
private static final class Mapping {
-
+
private Pattern pattern;
-
+
private String replacement;
public Mapping(Pattern pattern, String replacement) {
@@ -52,77 +50,54 @@
this.pattern = pattern;
this.replacement = replacement;
}
-
+
public Pattern getPattern() {
return pattern;
}
-
+
public String getReplacement() {
return replacement;
}
}
-
+
private List<Mapping> fileNameMappings;
-
- public FileNameMapperImpl(Properties fileNameMappings) {
+
+ public FileNameMapperImpl(Map<String, String> fileNameMappings) {
super();
this.fileNameMappings = compileMappings(fileNameMappings);
}
- private static List<Mapping> compileMappings(Properties properties) {
+ private static List<Mapping> compileMappings(Map<String, String> mappings) {
List<Mapping> result = Lists.newArrayList();
- for (Entry<Object, Object> entry: properties.entrySet()) {
+ for (Entry<String, String> entry: mappings.entrySet()) {
Pattern pattern = Pattern.compile((String) entry.getKey());
- String replacement = (String) entry.getValue();
-
+ String replacement = entry.getValue();
+
result.add(new Mapping(pattern, replacement));
}
-
+
return result;
}
-
- private String stripContentClassifier(String mimeType) {
- if (mimeType == null) {
- return null;
- }
-
- int idx = mimeType.lastIndexOf('/');
- if (idx < 0) {
- return mimeType;
- } else {
- return mimeType.substring(idx + 1);
- }
- }
-
+
private String remapName(String name) {
if (name == null) {
return name;
}
-
+
for (Mapping mapping : fileNameMappings) {
Matcher matcher = mapping.getPattern().matcher(name);
if (matcher.find()) {
return matcher.replaceAll(mapping.getReplacement());
}
}
-
+
return name;
}
-
+
@Override
public String createName(Resource resource) {
- String resourceVersion = null;
- if (resource instanceof VersionedResource) {
- resourceVersion = ((VersionedResource) resource).getVersion();
- }
-
- String resourcePath = Joiner.on('/').skipNulls().join(resource.getLibraryName(), resourceVersion, resource.getResourceName());
- String fileExt = stripContentClassifier(resource.getContentType());
-
- resourcePath = Joiner.on('.').skipNulls().join(resourcePath, fileExt);
-
- return remapName(resourcePath);
+ return remapName(resource.getRequestPath());
}
}
Deleted: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/MarkerResourcesScanner.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/MarkerResourcesScanner.java 2010-08-05 20:59:23 UTC (rev 18490)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/MarkerResourcesScanner.java 2010-08-05 21:30:13 UTC (rev 18491)
@@ -1,61 +0,0 @@
-/*
- * 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.resource;
-
-import org.reflections.scanners.AbstractScanner;
-import org.reflections.vfs.Vfs.File;
-
-import com.google.common.collect.Multimap;
-
-/**
- * @author Nick Belaevski
- *
- */
-public class MarkerResourcesScanner extends AbstractScanner {
-
- static final String STORE_KEY = "org.richfaces.cdk.dynamicResourceNames";
-
- private static final String RESOURCE_PROPERTIES_EXT = ".resource.properties";
-
- private static final String META_INF = "META-INF/";
-
- @Override
- public void scan(Object cls) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void scan(File file) {
- String relativePath = file.getRelativePath();
- if (relativePath.startsWith(META_INF) && relativePath.endsWith(RESOURCE_PROPERTIES_EXT)) {
- Multimap<String, String> store = getStore();
-
- String className = relativePath.substring(META_INF.length(), relativePath.length() - RESOURCE_PROPERTIES_EXT.length());
- store.put(STORE_KEY, className);
- }
- }
-
- @Override
- public boolean acceptsInput(String file) {
- return true;
- }
-}
Deleted: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/ReflectionsExt.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/ReflectionsExt.java 2010-08-05 20:59:23 UTC (rev 18490)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/ReflectionsExt.java 2010-08-05 21:30:13 UTC (rev 18491)
@@ -1,62 +0,0 @@
-/*
- * 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.resource;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Map;
-
-import org.reflections.Configuration;
-import org.reflections.Reflections;
-import org.reflections.scanners.Scanner;
-import org.reflections.util.Utils;
-
-import com.google.common.collect.Multimap;
-
-/**
- * @author Nick Belaevski
- *
- */
-class ReflectionsExt extends Reflections {
-
- public ReflectionsExt() {
- super();
- }
-
- public ReflectionsExt(Configuration configuration) {
- super(configuration);
- }
-
- public ReflectionsExt(String prefix, Scanner... scanners) {
- super(prefix, scanners);
- }
-
- public Collection<Class<?>> getMarkedClasses() {
- Map<String, Multimap<String, String>> storeMap = getStore().getStoreMap();
- Multimap<String, String> scannerMMap = storeMap.get(MarkerResourcesScanner.class.getName());
- if (scannerMMap == null) {
- return Collections.emptySet();
- }
- return Utils.forNames(scannerMMap.get(MarkerResourcesScanner.STORE_KEY));
- }
-
-}
Added: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/ResourceUtil.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/ResourceUtil.java (rev 0)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/ResourceUtil.java 2010-08-05 21:30:13 UTC (rev 18491)
@@ -0,0 +1,158 @@
+/*
+ * 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.resource;
+
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.jboss.vfs.VFS;
+import org.jboss.vfs.VirtualFile;
+import org.jboss.vfs.util.automount.Automounter;
+
+import com.google.common.base.Joiner;
+import com.google.common.base.Predicates;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Ordering;
+import com.google.common.primitives.Ints;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public final class ResourceUtil {
+
+ private static final String CLASSPATH_RESOURCES_LOCATION = "META-INF/resources";
+
+ private static final String WEB_RESOURCES_LOCATION = "resources";
+
+ private static final Pattern LIBRARY_VERSION_PATTERN = Pattern.compile("^(\\d+)(_\\d+)+");
+
+ private static final Pattern RESOURCE_VERSION_PATTERN = Pattern.compile("^((?:\\d+)(?:_\\d+)+)[\\.]?(\\w+)?");
+
+ public static final class VersionKey {
+
+ static final Ordering<VersionKey> ORDERING = Ordering.from(new Comparator<VersionKey>() {
+
+ @Override
+ public int compare(VersionKey o1, VersionKey o2) {
+ return Ints.lexicographicalComparator().compare(o1.versionVector, o2.versionVector);
+ }
+ }).nullsFirst();
+
+ private static final Joiner DOT_JOINER = Joiner.on('.').skipNulls();
+
+ private String version;
+
+ private int[] versionVector;
+
+ private String extension;
+
+ public VersionKey(String version, String extension) throws NumberFormatException {
+ this.version = version;
+ this.versionVector = parseVersionString(version);
+ this.extension = extension;
+ }
+
+ private static int[] parseVersionString(String s) {
+ String[] split = s.split("_");
+ int[] result = new int[split.length];
+ for (int i = 0; i < result.length; i++) {
+ result[i] = Integer.parseInt(split[i]);
+ }
+ return result;
+ }
+
+ public String toString() {
+ return DOT_JOINER.join(version, extension);
+ }
+ }
+
+ private ResourceUtil() {}
+
+ public static VirtualFile getLatestVersion(VirtualFile file, boolean library) {
+ VersionKey latestVersionKey = null;
+
+ List<VirtualFile> children = file.getChildren();
+ for (VirtualFile child : children) {
+ if (library && child.isDirectory()) {
+ Matcher matcher = LIBRARY_VERSION_PATTERN.matcher(child.getName());
+ if (matcher.matches()) {
+ latestVersionKey = VersionKey.ORDERING.max(latestVersionKey, new VersionKey(child.getName(), null));
+ }
+ } else if (!library && child.isFile()) {
+ Matcher matcher = RESOURCE_VERSION_PATTERN.matcher(child.getName());
+ if (matcher.matches()) {
+ latestVersionKey = VersionKey.ORDERING.max(latestVersionKey, new VersionKey(matcher.group(1), matcher.group(2)));
+ }
+ }
+ }
+
+ VirtualFile result;
+
+ if (latestVersionKey != null) {
+ result = file.getChild(latestVersionKey.toString());
+ } else {
+ result = file;
+ }
+
+ if (result.exists() && (library ^ result.isFile())) {
+ return result;
+ }
+
+ return null;
+ }
+
+ private static VirtualFile getExistingChild(URL rootUrl, String path) throws URISyntaxException, IOException {
+ VirtualFile root = VFS.getChild(rootUrl);
+ Automounter.mount(root);
+ VirtualFile child = root.getChild(path);
+ if (child.exists()) {
+ return child;
+ }
+
+ return null;
+ }
+
+ public static Collection<VirtualFile> getResourceRoots(Iterable<URL> cpUrls, URL webrootUrl) throws URISyntaxException, IOException {
+ Collection<VirtualFile> result = Lists.newArrayList();
+
+ for (URL url : cpUrls) {
+ result.add(getExistingChild(url, CLASSPATH_RESOURCES_LOCATION));
+ }
+
+ if (webrootUrl != null) {
+ result.add(getExistingChild(webrootUrl, WEB_RESOURCES_LOCATION));
+ }
+
+ Iterables.removeIf(result, Predicates.isNull());
+
+ return result;
+ }
+
+}
Modified: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/ResourceWriterImpl.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/ResourceWriterImpl.java 2010-08-05 20:59:23 UTC (rev 18490)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/ResourceWriterImpl.java 2010-08-05 21:30:13 UTC (rev 18491)
@@ -63,7 +63,11 @@
}
private File getRoot(String rootName) {
- return new File(baseDir, rootName);
+ if (!Strings.isNullOrEmpty(rootName)) {
+ return new File(baseDir, rootName);
+ } else {
+ return baseDir;
+ }
}
private String addSkinPrefix(String s) {
@@ -110,6 +114,7 @@
@Override
public void writeProcessedResourceMappings() throws IOException {
+ //TODO separate mappings file location
FileOutputStream fos = null;
try {
File mappingsFile = new File(baseDir, "org.richfaces/resource-mappings.properties");
Deleted: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/ResourcesScannerImpl.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/ResourcesScannerImpl.java 2010-08-05 20:59:23 UTC (rev 18490)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/ResourcesScannerImpl.java 2010-08-05 21:30:13 UTC (rev 18491)
@@ -1,96 +0,0 @@
-/*
- * 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.resource;
-
-import static com.google.common.collect.Collections2.transform;
-
-import java.net.URL;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Set;
-
-import org.reflections.scanners.SubTypesScanner;
-import org.reflections.scanners.TypeAnnotationsScanner;
-import org.reflections.util.ConfigurationBuilder;
-import org.richfaces.cdk.ResourceInfo;
-import org.richfaces.cdk.ResourcesScanner;
-import org.richfaces.resource.DynamicResource;
-
-import com.google.common.base.Function;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Sets;
-/**
- * @author Nick Belaevski
- *
- */
-public class ResourcesScannerImpl implements ResourcesScanner {
-
- private static final Function<Class<?>, ResourceInfo> CLASS_RESOURCE_FUNCTION = new Function<Class<?>, ResourceInfo>() {
-
- @Override
- public ResourceInfo apply(Class<?> from) {
- return new ResourceInfo(from.getName());
- }
- };
-
- private Collection<ResourceInfo> resources = Sets.newHashSet();
-
- private Collection<URL> urls;
-
- public ResourcesScannerImpl(Collection<URL> urls) {
- super();
- this.urls = urls;
- }
-
- protected Collection<URL> getUrls() {
- return urls;
- }
-
- public void scan() {
- resources.clear();
-
- ConfigurationBuilder configurationBuilder = new ConfigurationBuilder().setUrls(urls);
- configurationBuilder.setScanners(new SubTypesScanner(), new TypeAnnotationsScanner(),
- new MarkerResourcesScanner());
-
- ReflectionsExt refl = new ReflectionsExt(configurationBuilder);
- Set<Class<?>> classResources = refl.getTypesAnnotatedWith(DynamicResource.class);
-
- // TODO - reflections library doesn't handle @Inherited correctly
- for (Class<?> resourceClass : classResources) {
- resources.addAll(transform(Collections.singleton(resourceClass), CLASS_RESOURCE_FUNCTION));
- resources.addAll(transform(refl.getSubTypesOf(resourceClass), CLASS_RESOURCE_FUNCTION));
- }
-
- resources.addAll(transform(refl.getMarkedClasses(), CLASS_RESOURCE_FUNCTION));
- }
-
- protected void addResources(Iterable<ResourceInfo> infos) {
- Iterables.addAll(resources, infos);
- }
-
- @Override
- public Collection<ResourceInfo> getResources() {
- return resources;
- }
-
-}
Deleted: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/StaticResourcesScannerImpl.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/StaticResourcesScannerImpl.java 2010-08-05 20:59:23 UTC (rev 18490)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/StaticResourcesScannerImpl.java 2010-08-05 21:30:13 UTC (rev 18491)
@@ -1,126 +0,0 @@
-/*
- * 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.resource;
-
-import static com.google.common.collect.Iterables.transform;
-import static java.util.Collections.singleton;
-
-import java.net.URL;
-import java.util.Collection;
-
-import org.reflections.vfs.Vfs;
-import org.reflections.vfs.Vfs.File;
-import org.richfaces.cdk.ResourceInfo;
-
-import com.google.common.base.Function;
-import com.google.common.base.Predicate;
-
-/**
- * @author Nick Belaevski
- *
- */
-public class StaticResourcesScannerImpl extends ResourcesScannerImpl {
-
- private static class RelativePathStartsWithPredicate implements Predicate<File> {
-
- private String prefix;
-
- public RelativePathStartsWithPredicate(String prefix) {
- super();
- this.prefix = prefix;
- }
-
- @Override
- public boolean apply(File input) {
- return input.getRelativePath().startsWith(prefix);
- }
- }
-
- private static class RelativePathResourceFunction implements Function<File, ResourceInfo> {
-
- private String prefix;
-
- public RelativePathResourceFunction(String prefix) {
- super();
- this.prefix = prefix;
- }
-
- private String getResourceRelativePath(File file) {
- return file.getRelativePath().substring(prefix.length());
- }
-
- private String getLibraryName(String relativePath) {
- int idx = relativePath.lastIndexOf('/');
- if (idx < 0) {
- return null;
- } else {
- return relativePath.substring(0, idx);
- }
- }
-
- private String getResourceName(String relativePath) {
- int idx = relativePath.lastIndexOf('/');
- if (idx < 0) {
- return relativePath;
- } else {
- return relativePath.substring(idx + 1);
- }
- }
-
- @Override
- public ResourceInfo apply(File from) {
- String relPath = getResourceRelativePath(from);
- String libraryName = getLibraryName(relPath);
- String resourceName = getResourceName(relPath);
- return new ResourceInfo(resourceName, libraryName);
- }
- }
-
- private static final Predicate<File> CLASSPATH_RESOURCE_PREDICATE = new RelativePathStartsWithPredicate(ResourceInfo.CLASSPATH_RESOURCES_LOCATION);
- private static final Predicate<File> WEB_RESOURCE_PREDICATE = new RelativePathStartsWithPredicate(ResourceInfo.WEB_RESOURCES_LOCATION);
-
- private static final Function<File, ResourceInfo> CLASSPATH_RESOURCE_FUNCTION = new RelativePathResourceFunction(ResourceInfo.CLASSPATH_RESOURCES_LOCATION);
- private static final Function<File, ResourceInfo> WEB_RESOURCE_FUNCTION = new RelativePathResourceFunction(ResourceInfo.WEB_RESOURCES_LOCATION);
-
- private URL webRootUrl;
-
- public StaticResourcesScannerImpl(Collection<URL> cpUrls, URL webRootUrl) {
- super(cpUrls);
-
- this.webRootUrl = webRootUrl;
- }
-
- private void addResources(Collection<URL> urls, Predicate<Vfs.File> filter, Function<Vfs.File, ResourceInfo> transformer) {
- Iterable<File> classpathResources = Vfs.findFiles(urls, filter);
- addResources(transform(classpathResources, transformer));
- }
-
- @Override
- public void scan() {
- super.scan();
-
- addResources(getUrls(), CLASSPATH_RESOURCE_PREDICATE, CLASSPATH_RESOURCE_FUNCTION);
- if (webRootUrl != null) {
- addResources(singleton(webRootUrl), WEB_RESOURCE_PREDICATE, WEB_RESOURCE_FUNCTION);
- }
- }
-}
\ No newline at end of file
Deleted: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/URLResource.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/URLResource.java 2010-08-05 20:59:23 UTC (rev 18490)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/URLResource.java 2010-08-05 21:30:13 UTC (rev 18491)
@@ -1,83 +0,0 @@
-/*
- * 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.resource;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Map;
-
-import javax.activation.FileTypeMap;
-import javax.activation.MimetypesFileTypeMap;
-import javax.faces.application.Resource;
-import javax.faces.context.FacesContext;
-
-import com.google.common.collect.Maps;
-
-/**
- * @author Nick Belaevski
- *
- */
-public class URLResource extends Resource {
-
- private URL resourceUrl;
-
- public URLResource(URL resourceUrl) {
- super();
- this.resourceUrl = resourceUrl;
- }
-
- @Override
- public InputStream getInputStream() throws IOException {
- return resourceUrl.openStream();
- }
-
- @Override
- public Map<String, String> getResponseHeaders() {
- return Maps.newHashMap();
- }
-
- @Override
- public String getRequestPath() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public URL getURL() {
- return resourceUrl;
- }
-
- @Override
- public boolean userAgentNeedsUpdate(FacesContext context) {
- throw new UnsupportedOperationException();
- }
-
- /* (non-Javadoc)
- * @see javax.faces.application.Resource#getContentType()
- */
- @Override
- public String getContentType() {
- FileTypeMap typeMap = MimetypesFileTypeMap.getDefaultFileTypeMap();
-
- return typeMap.getContentType(resourceUrl.getFile());
- }
-}
Added: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/AbstractResourceHandler.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/AbstractResourceHandler.java (rev 0)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/AbstractResourceHandler.java 2010-08-05 21:30:13 UTC (rev 18491)
@@ -0,0 +1,69 @@
+/*
+ * 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.resource.handler.impl;
+
+import java.io.IOException;
+
+import javax.faces.application.Resource;
+import javax.faces.application.ResourceHandler;
+import javax.faces.context.FacesContext;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public abstract class AbstractResourceHandler extends ResourceHandler {
+
+ @Override
+ public Resource createResource(String resourceName) {
+ return createResource(resourceName, null);
+ }
+
+ @Override
+ public Resource createResource(String resourceName, String libraryName) {
+ return createResource(resourceName, libraryName, null);
+ }
+
+ @Override
+ public abstract Resource createResource(String resourceName, String libraryName, String contentType);
+
+ @Override
+ public boolean libraryExists(String libraryName) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void handleResourceRequest(FacesContext context) throws IOException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean isResourceRequest(FacesContext context) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String getRendererTypeForResourceName(String resourceName) {
+ throw new UnsupportedOperationException();
+ }
+
+}
Added: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/DynamicResourceHandler.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/DynamicResourceHandler.java (rev 0)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/DynamicResourceHandler.java 2010-08-05 21:30:13 UTC (rev 18491)
@@ -0,0 +1,84 @@
+/*
+ * 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.resource.handler.impl;
+
+import java.io.IOException;
+
+import javax.faces.application.Resource;
+import javax.faces.application.ResourceHandler;
+import javax.faces.component.StateHolder;
+import javax.faces.context.FacesContext;
+
+import org.richfaces.resource.ResourceFactory;
+import org.richfaces.resource.ResourceFactoryImpl;
+import org.richfaces.resource.StateHolderResource;
+
+import com.google.common.io.ByteArrayDataOutput;
+import com.google.common.io.ByteStreams;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class DynamicResourceHandler extends AbstractResourceHandler {
+
+ private ResourceFactory resourceFactory;
+
+ private ResourceHandler staticResourceHandler;
+
+ public DynamicResourceHandler(ResourceHandler staticResourceHandler) {
+ this.staticResourceHandler = staticResourceHandler;
+ this.resourceFactory = new ResourceFactoryImpl(staticResourceHandler);
+ }
+
+ @Override
+ public Resource createResource(String resourceName, String libraryName, String contentType) {
+ Resource result = resourceFactory.createResource(resourceName, libraryName, null);
+
+ if (result != null) {
+ if (result instanceof StateHolderResource) {
+ StateHolderResource stateHolderResource = (StateHolderResource) result;
+ ByteArrayDataOutput dataOutput = ByteStreams.newDataOutput();
+ try {
+ stateHolderResource.writeState(FacesContext.getCurrentInstance(), dataOutput);
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ byte[] bs = dataOutput.toByteArray();
+ //TODO use collected data
+ } else if (result instanceof StateHolder) {
+ StateHolder stateHolder = (StateHolder) result;
+ if (!stateHolder.isTransient()) {
+ Object savedData = stateHolder.saveState(FacesContext.getCurrentInstance());
+ //TODO use collected data
+ }
+ }
+
+ result = new DynamicResourceWrapper(result);
+ } else {
+ result = staticResourceHandler.createResource(resourceName, libraryName);
+ }
+
+ return result;
+ }
+}
Added: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/DynamicResourceWrapper.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/DynamicResourceWrapper.java (rev 0)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/DynamicResourceWrapper.java 2010-08-05 21:30:13 UTC (rev 18491)
@@ -0,0 +1,171 @@
+/*
+ * 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.resource.handler.impl;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Map;
+
+import javax.faces.application.Resource;
+import javax.faces.context.FacesContext;
+
+import org.richfaces.resource.VersionedResource;
+
+import com.google.common.base.Joiner;
+import com.google.common.base.Strings;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class DynamicResourceWrapper extends Resource {
+
+ /**
+ *
+ */
+ private static final String ECSS_EXTENSION = ".ecss";
+
+ private static final Joiner SLASH_JOINER = Joiner.on('/').skipNulls();
+
+ private static final Joiner DOT_JOINER = Joiner.on('.').skipNulls();
+
+ private static final Joiner DASH_JOINER = Joiner.on('-').skipNulls();
+
+ private Resource resource;
+
+ public DynamicResourceWrapper(Resource resource) {
+ super();
+ this.resource = resource;
+ }
+
+ @Override
+ public InputStream getInputStream() throws IOException {
+ return resource.getInputStream();
+ }
+
+ public String getContentType() {
+ return resource.getContentType();
+ }
+
+ public void setContentType(String contentType) {
+ resource.setContentType(contentType);
+ }
+
+ public String getLibraryName() {
+ return resource.getLibraryName();
+ }
+
+ public void setLibraryName(String libraryName) {
+ resource.setLibraryName(libraryName);
+ }
+
+ public String getResourceName() {
+ return resource.getResourceName();
+ }
+
+ public void setResourceName(String resourceName) {
+ resource.setResourceName(resourceName);
+ }
+
+ @Override
+ public Map<String, String> getResponseHeaders() {
+ throw new UnsupportedOperationException();
+ }
+
+ private String getMangledLibraryName() {
+ String resourceName = getResourceName();
+ if (Strings.isNullOrEmpty(getLibraryName()) && !resourceName.endsWith(ECSS_EXTENSION)) {
+ int idx = resourceName.lastIndexOf('.');
+ if (idx < 0) {
+ return null;
+ } else {
+ return resourceName.substring(0, idx);
+ }
+ }
+
+ return getLibraryName();
+ }
+
+ private String getMangledResourceName() {
+ String resourceName = getResourceName();
+ if (resourceName.endsWith(ECSS_EXTENSION)) {
+ return resourceName.substring(0, resourceName.length() - ECSS_EXTENSION.length());
+ }
+
+ if (Strings.isNullOrEmpty(getLibraryName())) {
+ int idx = resourceName.lastIndexOf('.');
+ if (idx < 0) {
+ return resourceName;
+ } else {
+ return resourceName.substring(idx + 1);
+ }
+ } else {
+ return resourceName;
+ }
+ }
+
+ private String getVersion() {
+ String version = null;
+ if (resource instanceof VersionedResource) {
+ version = ((VersionedResource) resource).getVersion();
+ }
+ return version;
+ }
+
+ @Override
+ public String getRequestPath() {
+ String mangledLibraryName = getMangledLibraryName();
+ String mangledResourceName = getMangledResourceName();
+ String resourceExtension = getResourceExtension();
+
+ String resourceName = DOT_JOINER.join(DASH_JOINER.join(mangledResourceName, getVersion()), resourceExtension);
+
+ return SLASH_JOINER.join(mangledLibraryName, resourceName);
+ }
+
+ @Override
+ public URL getURL() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean userAgentNeedsUpdate(FacesContext context) {
+ throw new UnsupportedOperationException();
+ }
+
+ protected String getResourceExtension() {
+ String contentType = getContentType();
+ if (contentType == null) {
+ return null;
+ }
+
+ if (contentType.startsWith("text/") || contentType.startsWith("image/")) {
+ String[] split = contentType.split("/");
+ if (split.length == 2) {
+ return split[1];
+ }
+ }
+
+ return null;
+ }
+}
Added: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/StaticResourceHandler.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/StaticResourceHandler.java (rev 0)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/StaticResourceHandler.java 2010-08-05 21:30:13 UTC (rev 18491)
@@ -0,0 +1,120 @@
+/*
+ * 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.resource.handler.impl;
+
+import java.util.Collection;
+import java.util.Collections;
+
+import javax.activation.MimetypesFileTypeMap;
+import javax.faces.application.Resource;
+
+import org.jboss.vfs.VirtualFile;
+import org.richfaces.cdk.resource.ResourceUtil;
+
+import com.google.common.base.Strings;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class StaticResourceHandler extends AbstractResourceHandler {
+
+ private Collection<VirtualFile> roots;
+
+ public StaticResourceHandler(Collection<VirtualFile> roots) {
+ super();
+ this.roots = roots;
+ }
+
+ private VirtualFile findLibrary(String libraryName) {
+ for (VirtualFile file : roots) {
+ VirtualFile child = file.getChild(libraryName);
+ if (!child.exists()) {
+ continue;
+ }
+
+ VirtualFile libraryDir = ResourceUtil.getLatestVersion(child, true);
+ if (libraryDir != null) {
+ return libraryDir;
+ }
+ }
+
+ return null;
+ }
+
+ private VirtualFile findResource(Collection<VirtualFile> libraryDirs, String resourceName) {
+ for (VirtualFile libraryDir : libraryDirs) {
+ VirtualFile child = libraryDir.getChild(resourceName);
+ if (child.exists()) {
+ VirtualFile resource = ResourceUtil.getLatestVersion(child, false);
+ if (resource != null) {
+ return resource;
+ }
+ }
+ }
+
+ return null;
+ }
+
+ @Override
+ public Resource createResource(String resourceName, String libraryName, String contentType) {
+ Collection<VirtualFile> libraryDirs = Collections.emptyList();
+ if (!Strings.isNullOrEmpty(libraryName)) {
+ VirtualFile libraryDir = findLibrary(libraryName);
+ if (libraryDir != null) {
+ libraryDirs = Collections.singletonList(libraryDir);
+ }
+ } else {
+ libraryDirs = roots;
+ }
+
+ VirtualFile resource = findResource(libraryDirs, resourceName);
+ if (resource != null) {
+ Resource result = new VFSResource(resource, getRelativePath(resource));
+
+ result.setResourceName(resourceName);
+ result.setLibraryName(libraryName);
+
+ if (Strings.isNullOrEmpty(contentType)) {
+ result.setContentType(MimetypesFileTypeMap.getDefaultFileTypeMap().getContentType(resourceName));
+ } else {
+ result.setContentType(contentType);
+ }
+
+
+ return result;
+ }
+
+ return null;
+ }
+
+ private String getRelativePath(VirtualFile resource) {
+ String relativePath = null;
+ for (VirtualFile parent : resource.getParentFileList()) {
+ if (roots.contains(parent)) {
+ relativePath = resource.getPathNameRelativeTo(parent);
+ break;
+ }
+ }
+ return relativePath;
+ }
+}
Added: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/VFSResource.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/VFSResource.java (rev 0)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/handler/impl/VFSResource.java 2010-08-05 21:30:13 UTC (rev 18491)
@@ -0,0 +1,79 @@
+/*
+ * 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.resource.handler.impl;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Map;
+
+import javax.faces.application.Resource;
+import javax.faces.context.FacesContext;
+
+import org.jboss.vfs.VirtualFile;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class VFSResource extends Resource {
+
+ private VirtualFile file;
+
+ private String relativePath;
+
+ public VFSResource(VirtualFile file, String relativePath) {
+ super();
+
+ assert file.isFile();
+ assert relativePath != null;
+
+ this.file = file;
+ this.relativePath = relativePath;
+ }
+
+ @Override
+ public InputStream getInputStream() throws IOException {
+ return file.openStream();
+ }
+
+ @Override
+ public Map<String, String> getResponseHeaders() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String getRequestPath() {
+ return relativePath;
+ }
+
+ @Override
+ public URL getURL() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean userAgentNeedsUpdate(FacesContext context) {
+ throw new UnsupportedOperationException();
+ }
+
+}
Copied: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/scan/ResourcesScanner.java (from rev 18474, root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/ResourcesScanner.java)
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/scan/ResourcesScanner.java (rev 0)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/scan/ResourcesScanner.java 2010-08-05 21:30:13 UTC (rev 18491)
@@ -0,0 +1,42 @@
+/*
+ * 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.resource.scan;
+
+import java.util.Collection;
+
+import org.richfaces.cdk.ResourceKey;
+
+
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public interface ResourcesScanner {
+
+ //TODO inclusions/exclusions
+
+ public void scan() throws Exception;
+
+ public Collection<ResourceKey> getResources();
+
+}
Copied: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/scan/impl/DynamicResourcesScanner.java (from rev 18395, root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/ResourcesScannerImpl.java)
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/scan/impl/DynamicResourcesScanner.java (rev 0)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/scan/impl/DynamicResourcesScanner.java 2010-08-05 21:30:13 UTC (rev 18491)
@@ -0,0 +1,87 @@
+/*
+ * 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.resource.scan.impl;
+
+import java.net.URL;
+import java.util.Collection;
+import java.util.Set;
+
+import org.reflections.scanners.SubTypesScanner;
+import org.reflections.scanners.TypeAnnotationsScanner;
+import org.reflections.util.ConfigurationBuilder;
+import org.richfaces.cdk.ResourceKey;
+import org.richfaces.cdk.resource.scan.ResourcesScanner;
+import org.richfaces.cdk.resource.scan.impl.reflections.MarkerResourcesScanner;
+import org.richfaces.cdk.resource.scan.impl.reflections.ReflectionsExt;
+import org.richfaces.resource.DynamicResource;
+
+import com.google.common.base.Function;
+import com.google.common.collect.Collections2;
+import com.google.common.collect.Sets;
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class DynamicResourcesScanner implements ResourcesScanner {
+
+ private static final Function<Class<?>, ResourceKey> RESOURCE_LOCATOR_FUNCTION = new Function<Class<?>, ResourceKey>() {
+
+ @Override
+ public ResourceKey apply(Class<?> from) {
+ ResourceKey key = new ResourceKey(from.getName());
+
+ return key;
+ }
+ };
+
+ private Collection<ResourceKey> resources = Sets.newHashSet();
+
+ private Collection<URL> urls;
+
+ public DynamicResourcesScanner(Collection<URL> urls) {
+ super();
+ this.urls = urls;
+ }
+
+ public void scan() {
+ ConfigurationBuilder configurationBuilder = new ConfigurationBuilder().setUrls(urls);
+ configurationBuilder.setScanners(new SubTypesScanner(), new TypeAnnotationsScanner(),
+ new MarkerResourcesScanner());
+
+ ReflectionsExt refl = new ReflectionsExt(configurationBuilder);
+ Set<Class<?>> allClasses = Sets.newHashSet();
+
+ // TODO - reflections library doesn't handle @Inherited correctly
+ for (Class<?> annotatedClass : refl.getTypesAnnotatedWith(DynamicResource.class)) {
+ allClasses.add(annotatedClass);
+ allClasses.addAll(refl.getSubTypesOf(annotatedClass));
+ }
+ allClasses.addAll(refl.getMarkedClasses());
+
+ resources.addAll(Collections2.transform(allClasses, RESOURCE_LOCATOR_FUNCTION));
+ }
+
+ public Collection<ResourceKey> getResources() {
+ return resources;
+ }
+
+}
Copied: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/scan/impl/StaticResourcesScanner.java (from rev 18395, root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/StaticResourcesScannerImpl.java)
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/scan/impl/StaticResourcesScanner.java (rev 0)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/scan/impl/StaticResourcesScanner.java 2010-08-05 21:30:13 UTC (rev 18491)
@@ -0,0 +1,92 @@
+/*
+ * 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.resource.scan.impl;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.jboss.vfs.VirtualFile;
+import org.richfaces.cdk.ResourceKey;
+import org.richfaces.cdk.resource.ResourceUtil;
+import org.richfaces.cdk.resource.scan.ResourcesScanner;
+
+import com.google.common.collect.Sets;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class StaticResourcesScanner implements ResourcesScanner {
+
+ private Collection<ResourceKey> resources = Sets.newHashSet();
+
+ private Collection<VirtualFile> resourceRoots;
+
+ public StaticResourcesScanner(Collection<VirtualFile> resourceRoots) {
+ this.resourceRoots = resourceRoots;
+ }
+
+ private void scanResourcesRoot(VirtualFile file) {
+ if (file == null) {
+ return;
+ }
+
+ List<VirtualFile> children = file.getChildren();
+ for (VirtualFile child : children) {
+ if (child.isFile()) {
+ resources.add(new ResourceKey(child.getName()));
+ } else {
+ String libraryName = child.getName();
+ VirtualFile libraryDir = ResourceUtil.getLatestVersion(child, true);
+ if (libraryDir != null) {
+ scanLibrary(libraryName, libraryDir);
+ }
+ }
+ }
+ }
+
+ private void scanLibrary(String libraryName, VirtualFile dir) {
+ List<VirtualFile> children = dir.getChildren();
+ for (VirtualFile child : children) {
+ if (child.isFile()) {
+ resources.add(new ResourceKey(child.getName(), libraryName));
+ } else {
+ VirtualFile resource = ResourceUtil.getLatestVersion(child, false);
+ if (resource != null) {
+ resources.add(new ResourceKey(child.getName(), libraryName));
+ }
+ }
+ }
+ }
+
+ @Override
+ public void scan() throws Exception {
+ for (VirtualFile resourceRoot : resourceRoots) {
+ scanResourcesRoot(resourceRoot);
+ }
+ }
+
+ public Collection<ResourceKey> getResources() {
+ return resources;
+ }
+
+}
\ No newline at end of file
Copied: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/scan/impl/reflections/MarkerResourcesScanner.java (from rev 18474, root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/MarkerResourcesScanner.java)
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/scan/impl/reflections/MarkerResourcesScanner.java (rev 0)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/scan/impl/reflections/MarkerResourcesScanner.java 2010-08-05 21:30:13 UTC (rev 18491)
@@ -0,0 +1,61 @@
+/*
+ * 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.resource.scan.impl.reflections;
+
+import org.reflections.scanners.AbstractScanner;
+import org.reflections.vfs.Vfs.File;
+
+import com.google.common.collect.Multimap;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class MarkerResourcesScanner extends AbstractScanner {
+
+ static final String STORE_KEY = "org.richfaces.cdk.dynamicResourceNames";
+
+ private static final String RESOURCE_PROPERTIES_EXT = ".resource.properties";
+
+ private static final String META_INF = "META-INF/";
+
+ @Override
+ public void scan(Object cls) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public void scan(File file) {
+ String relativePath = file.getRelativePath();
+ if (relativePath.startsWith(META_INF) && relativePath.endsWith(RESOURCE_PROPERTIES_EXT)) {
+ Multimap<String, String> store = getStore();
+
+ String className = relativePath.substring(META_INF.length(), relativePath.length() - RESOURCE_PROPERTIES_EXT.length());
+ store.put(STORE_KEY, className);
+ }
+ }
+
+ @Override
+ public boolean acceptsInput(String file) {
+ return true;
+ }
+}
Copied: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/scan/impl/reflections/ReflectionsExt.java (from rev 18474, root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/ReflectionsExt.java)
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/scan/impl/reflections/ReflectionsExt.java (rev 0)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/resource/scan/impl/reflections/ReflectionsExt.java 2010-08-05 21:30:13 UTC (rev 18491)
@@ -0,0 +1,62 @@
+/*
+ * 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.resource.scan.impl.reflections;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Map;
+
+import org.reflections.Configuration;
+import org.reflections.Reflections;
+import org.reflections.scanners.Scanner;
+import org.reflections.util.Utils;
+
+import com.google.common.collect.Multimap;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class ReflectionsExt extends Reflections {
+
+ public ReflectionsExt() {
+ super();
+ }
+
+ public ReflectionsExt(Configuration configuration) {
+ super(configuration);
+ }
+
+ public ReflectionsExt(String prefix, Scanner... scanners) {
+ super(prefix, scanners);
+ }
+
+ public Collection<Class<?>> getMarkedClasses() {
+ Map<String, Multimap<String, String>> storeMap = getStore().getStoreMap();
+ Multimap<String, String> scannerMMap = storeMap.get(MarkerResourcesScanner.class.getName());
+ if (scannerMMap == null) {
+ return Collections.emptySet();
+ }
+ return Utils.forNames(scannerMMap.get(MarkerResourcesScanner.STORE_KEY));
+ }
+
+}
Modified: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/task/ResourceTaskFactoryImpl.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/task/ResourceTaskFactoryImpl.java 2010-08-05 20:59:23 UTC (rev 18490)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/task/ResourceTaskFactoryImpl.java 2010-08-05 21:30:13 UTC (rev 18491)
@@ -26,22 +26,19 @@
import java.util.concurrent.CompletionService;
import javax.faces.application.Resource;
-import javax.faces.component.StateHolder;
+import javax.faces.application.ResourceHandler;
import javax.faces.context.FacesContext;
import org.apache.maven.plugin.logging.Log;
import org.richfaces.cdk.Faces;
-import org.richfaces.cdk.ResourceInfo;
+import org.richfaces.cdk.ResourceKey;
import org.richfaces.cdk.ResourceTaskFactory;
import org.richfaces.cdk.ResourceWriter;
import org.richfaces.cdk.faces.CurrentResourceContext;
-import org.richfaces.cdk.util.ConcurrentHashSet;
-import org.richfaces.resource.StateHolderResource;
+import org.richfaces.cdk.resource.handler.impl.DynamicResourceWrapper;
import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
-import com.google.common.io.ByteArrayDataOutput;
-import com.google.common.io.ByteStreams;
/**
* @author Nick Belaevski
@@ -51,19 +48,19 @@
private class ResourcesRendererCallable implements Callable<Object> {
- private ResourceInfo resourceInfo;
+ private ResourceKey resourceInfo;
private boolean skinDependent;
private boolean skipped = false;
- ResourcesRendererCallable(ResourceInfo resourceInfo) {
+ ResourcesRendererCallable(ResourceKey resourceInfo) {
this.resourceInfo = resourceInfo;
}
- private Resource createResource(FacesContext facesContext, ResourceInfo resourceInfo) {
- return facesContext.getApplication().getResourceHandler().createResource(resourceInfo.getResourceName(),
- resourceInfo.getLibraryName());
+ private Resource createResource(FacesContext facesContext, ResourceKey resourceInfo) {
+ ResourceHandler resourceHandler = facesContext.getApplication().getResourceHandler();
+ return resourceHandler.createResource(resourceInfo.getResourceName(), resourceInfo.getLibraryName());
}
private void renderResource(String skin) {
@@ -76,21 +73,6 @@
Resource resource = createResource(facesContext, resourceInfo);
CurrentResourceContext.getInstance(facesContext).setResource(resource);
-
- if (resource instanceof StateHolderResource) {
- StateHolderResource stateHolderResource = (StateHolderResource) resource;
- ByteArrayDataOutput dataOutput = ByteStreams.newDataOutput();
- stateHolderResource.writeState(facesContext, dataOutput);
- byte[] bs = dataOutput.toByteArray();
- //TODO use collected data
- } else if (resource instanceof StateHolder) {
- StateHolder stateHolder = (StateHolder) resource;
- if (!stateHolder.isTransient()) {
- Object savedData = stateHolder.saveState(facesContext);
- //TODO use collected data
- }
- }
-
//TODO check content type
resourceWriter.writeResource(skin, resource);
} catch (Exception e) {
@@ -108,6 +90,7 @@
private void checkResource() {
try {
FacesContext facesContext = faces.startRequest();
+ faces.setSkin("DEFAULT");
Resource resource = createResource(facesContext, resourceInfo);
if (resource == null) {
@@ -128,10 +111,10 @@
return;
}
- if (contentType.contains("css") || contentType.contains("image")) {
- skinDependent = true;
- }
+ //TODO hack
+ skinDependent = (resource instanceof DynamicResourceWrapper);
} finally {
+ faces.setSkin(null);
faces.stopRequest();
}
}
@@ -158,22 +141,21 @@
private ResourceWriter resourceWriter;
- private ConcurrentHashSet<ResourceInfo> submittedResources = new ConcurrentHashSet<ResourceInfo>();
-
private CompletionService<Object> completionService;
private String[] skins = new String[0];
private Predicate<Resource> filter = Predicates.alwaysTrue();
+ public ResourceTaskFactoryImpl(Faces faces) {
+ super();
+ this.faces = faces;
+ }
+
public void setLog(Log log) {
this.log = log;
}
- public void setFaces(Faces faces) {
- this.faces = faces;
- }
-
public void setResourceWriter(ResourceWriter resourceWriter) {
this.resourceWriter = resourceWriter;
}
@@ -190,10 +172,9 @@
this.filter = filter;
}
- @Override
- public void submit(ResourceInfo info) {
- if (submittedResources.addIfAbsent(info)) {
- completionService.submit(new ResourcesRendererCallable(info));
+ public void submit(Iterable<ResourceKey> locators) {
+ for (ResourceKey locator : locators) {
+ completionService.submit(new ResourcesRendererCallable(locator));
}
}
}
Modified: root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/util/MorePredicates.java
===================================================================
--- root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/util/MorePredicates.java 2010-08-05 20:59:23 UTC (rev 18490)
+++ root/sandbox/cdk/maven-resources-plugin/src/main/java/org/richfaces/cdk/util/MorePredicates.java 2010-08-05 21:30:13 UTC (rev 18491)
@@ -21,6 +21,8 @@
*/
package org.richfaces.cdk.util;
+import java.util.regex.Pattern;
+
import com.google.common.base.Function;
import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
@@ -68,5 +70,14 @@
return input.startsWith(prefix);
}
};
+ }
+
+ public static Predicate<CharSequence> matches(final Pattern pattern) {
+ return new Predicate<CharSequence>() {
+ @Override
+ public boolean apply(CharSequence input) {
+ return pattern.matcher(input).matches();
+ }
+ };
}
}
\ No newline at end of file
15 years, 9 months
JBoss Rich Faces SVN: r18490 - root/tests/metamer/trunk.
by richfaces-svn-commits@lists.jboss.org
Author: prabhat.jha(a)jboss.com
Date: 2010-08-05 16:59:23 -0400 (Thu, 05 Aug 2010)
New Revision: 18490
Modified:
root/tests/metamer/trunk/pom.xml
Log:
added richfaces-ui-output in dependency - got the src building
Modified: root/tests/metamer/trunk/pom.xml
===================================================================
--- root/tests/metamer/trunk/pom.xml 2010-08-05 14:06:32 UTC (rev 18489)
+++ root/tests/metamer/trunk/pom.xml 2010-08-05 20:59:23 UTC (rev 18490)
@@ -119,7 +119,15 @@
<scope>import</scope>
<type>pom</type>
</dependency>
+
<dependency>
+ <groupId>org.richfaces.ui.output</groupId>
+ <artifactId>richfaces-ui-output-bom</artifactId>
+ <version>${version.richfaces}</version>
+ <scope>import</scope>
+ <type>pom</type>
+ </dependency>
+ <dependency>
<groupId>org.richfaces.cdk</groupId>
<artifactId>annotations</artifactId>
<version>${version.richfaces}</version>
15 years, 9 months