You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2009/07/23 07:10:11 UTC
svn commit: r796947 - in /myfaces/core/trunk/impl/src/main:
java/org/apache/myfaces/view/facelets/compiler/
java/org/apache/myfaces/view/facelets/tag/jsf/ resources/META-INF/facelets/
resources/org/apache/myfaces/resource/
Author: lu4242
Date: Thu Jul 23 05:10:10 2009
New Revision: 796947
URL: http://svn.apache.org/viewvc?rev=796947&view=rev
Log:
MYFACES-2183 Integrate Facelets (add some missing dtd, correct some xml files and restore temporally old code to allow facelets work in most simple way)
Added:
myfaces/core/trunk/impl/src/main/resources/org/apache/myfaces/resource/default.dtd (with props)
myfaces/core/trunk/impl/src/main/resources/org/apache/myfaces/resource/facelet-taglib_1_0.dtd (with props)
Modified:
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/SAXCompiler.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/TagLibraryConfig.java
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentHandler.java
myfaces/core/trunk/impl/src/main/resources/META-INF/facelets/faces-config.xml
myfaces/core/trunk/impl/src/main/resources/META-INF/facelets/jsf-core.taglib.xml
myfaces/core/trunk/impl/src/main/resources/META-INF/facelets/jsf-html.taglib.xml
myfaces/core/trunk/impl/src/main/resources/META-INF/facelets/jsf-ui.taglib.xml
myfaces/core/trunk/impl/src/main/resources/META-INF/facelets/jstl-core.taglib.xml
myfaces/core/trunk/impl/src/main/resources/META-INF/facelets/jstl-fn.taglib.xml
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/SAXCompiler.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/SAXCompiler.java?rev=796947&r1=796946&r2=796947&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/SAXCompiler.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/SAXCompiler.java Thu Jul 23 05:10:10 2009
@@ -167,7 +167,7 @@
public InputSource resolveEntity(String publicId, String systemId) throws SAXException
{
- String dtd = "default.dtd";
+ String dtd = "org/apache/myfaces/resource/default.dtd";
/*
* if ("-//W3C//DTD XHTML 1.0 Transitional//EN".equals(publicId)) { dtd = "xhtml1-transitional.dtd"; } else
* if (systemId != null && systemId.startsWith("file:/")) { return new InputSource(systemId); }
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/TagLibraryConfig.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/TagLibraryConfig.java?rev=796947&r1=796946&r2=796947&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/TagLibraryConfig.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/TagLibraryConfig.java Thu Jul 23 05:10:10 2009
@@ -388,7 +388,7 @@
{
if ("-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN".equals(publicId))
{
- URL url = ClassUtils.getContextClassLoader().getResource("facelet-taglib_1_0.dtd");
+ URL url = ClassUtils.getContextClassLoader().getResource("org/apache/myfaces/resource/facelet-taglib_1_0.dtd");
return new InputSource(url.toExternalForm());
}
return null;
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentHandler.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentHandler.java?rev=796947&r1=796946&r2=796947&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentHandler.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ComponentHandler.java Thu Jul 23 05:10:10 2009
@@ -39,6 +39,8 @@
import javax.faces.view.facelets.TagAttribute;
import javax.faces.view.facelets.TagException;
+import org.apache.myfaces.view.facelets.tag.MetaRulesetImpl;
+
/**
* Implementation of the tag logic used in the JSF specification. This is your golden hammer for wiring UIComponents to
* Facelets.
@@ -281,7 +283,35 @@
return m;*/
// FIXME: Implement correctly
- return null;
+ // temporally restore code
+ MetaRuleset m = new MetaRulesetImpl(this.tag, type);
+ // ignore standard component attributes
+ m.ignore("binding").ignore("id");
+
+ // add auto wiring for attributes
+ m.addRule(ComponentRule.Instance);
+
+ // if it's an ActionSource
+ if (ActionSource.class.isAssignableFrom(type))
+ {
+ m.addRule(ActionSourceRule.Instance);
+ }
+
+ // if it's a ValueHolder
+ if (ValueHolder.class.isAssignableFrom(type))
+ {
+ m.addRule(ValueHolderRule.Instance);
+
+ // if it's an EditableValueHolder
+ if (EditableValueHolder.class.isAssignableFrom(type))
+ {
+ m.ignore("submittedValue");
+ m.ignore("valid");
+ m.addRule(EditableValueHolderRule.Instance);
+ }
+ }
+
+ return m;
}
/**
Modified: myfaces/core/trunk/impl/src/main/resources/META-INF/facelets/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/resources/META-INF/facelets/faces-config.xml?rev=796947&r1=796946&r2=796947&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/resources/META-INF/facelets/faces-config.xml (original)
+++ myfaces/core/trunk/impl/src/main/resources/META-INF/facelets/faces-config.xml Thu Jul 23 05:10:10 2009
@@ -7,22 +7,22 @@
<faces-config>
<component>
<component-type>facelets.ui.Repeat</component-type>
- <component-class>com.sun.facelets.component.UIRepeat</component-class>
+ <component-class>org.apache.myfaces.view.facelets.component.UIRepeat</component-class>
</component>
<component>
<component-type>facelets.ui.ComponentRef</component-type>
- <component-class>com.sun.facelets.tag.ui.ComponentRef</component-class>
+ <component-class>org.apache.myfaces.view.facelets.tag.ui.ComponentRef</component-class>
</component>
<component>
<component-type>facelets.ui.Debug</component-type>
- <component-class>com.sun.facelets.tag.ui.UIDebug</component-class>
+ <component-class>org.apache.myfaces.view.facelets.tag.ui.UIDebug</component-class>
</component>
<render-kit>
<render-kit-id>HTML_BASIC</render-kit-id>
<renderer>
<component-family>facelets</component-family>
<renderer-type>facelets.ui.Repeat</renderer-type>
- <renderer-class>com.sun.facelets.component.RepeatRenderer</renderer-class>
+ <renderer-class>org.apache.myfaces.view.facelets.component.RepeatRenderer</renderer-class>
</renderer>
</render-kit>
</faces-config>
\ No newline at end of file
Modified: myfaces/core/trunk/impl/src/main/resources/META-INF/facelets/jsf-core.taglib.xml
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/resources/META-INF/facelets/jsf-core.taglib.xml?rev=796947&r1=796946&r2=796947&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/resources/META-INF/facelets/jsf-core.taglib.xml (original)
+++ myfaces/core/trunk/impl/src/main/resources/META-INF/facelets/jsf-core.taglib.xml Thu Jul 23 05:10:10 2009
@@ -21,5 +21,5 @@
"http://java.sun.com/dtd/facelet-taglib_1_0.dtd">
<facelet-taglib>
- <library-class>com.sun.facelets.tag.jsf.core.CoreLibrary</library-class>
+ <library-class>org.apache.myfaces.view.facelets.tag.jsf.core.CoreLibrary</library-class>
</facelet-taglib>
\ No newline at end of file
Modified: myfaces/core/trunk/impl/src/main/resources/META-INF/facelets/jsf-html.taglib.xml
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/resources/META-INF/facelets/jsf-html.taglib.xml?rev=796947&r1=796946&r2=796947&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/resources/META-INF/facelets/jsf-html.taglib.xml (original)
+++ myfaces/core/trunk/impl/src/main/resources/META-INF/facelets/jsf-html.taglib.xml Thu Jul 23 05:10:10 2009
@@ -21,5 +21,5 @@
"http://java.sun.com/dtd/facelet-taglib_1_0.dtd">
<facelet-taglib>
- <library-class>com.sun.facelets.tag.jsf.html.HtmlLibrary</library-class>
+ <library-class>org.apache.myfaces.view.facelets.tag.jsf.html.HtmlLibrary</library-class>
</facelet-taglib>
\ No newline at end of file
Modified: myfaces/core/trunk/impl/src/main/resources/META-INF/facelets/jsf-ui.taglib.xml
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/resources/META-INF/facelets/jsf-ui.taglib.xml?rev=796947&r1=796946&r2=796947&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/resources/META-INF/facelets/jsf-ui.taglib.xml (original)
+++ myfaces/core/trunk/impl/src/main/resources/META-INF/facelets/jsf-ui.taglib.xml Thu Jul 23 05:10:10 2009
@@ -21,5 +21,5 @@
"http://java.sun.com/dtd/facelet-taglib_1_0.dtd">
<facelet-taglib>
- <library-class>com.sun.facelets.tag.ui.UILibrary</library-class>
+ <library-class>org.apache.myfaces.view.facelets.tag.ui.UILibrary</library-class>
</facelet-taglib>
\ No newline at end of file
Modified: myfaces/core/trunk/impl/src/main/resources/META-INF/facelets/jstl-core.taglib.xml
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/resources/META-INF/facelets/jstl-core.taglib.xml?rev=796947&r1=796946&r2=796947&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/resources/META-INF/facelets/jstl-core.taglib.xml (original)
+++ myfaces/core/trunk/impl/src/main/resources/META-INF/facelets/jstl-core.taglib.xml Thu Jul 23 05:10:10 2009
@@ -21,5 +21,5 @@
"http://java.sun.com/dtd/facelet-taglib_1_0.dtd">
<facelet-taglib>
- <library-class>com.sun.facelets.tag.jstl.core.JstlCoreLibrary</library-class>
+ <library-class>org.apache.myfaces.view.facelets.tag.jstl.core.JstlCoreLibrary</library-class>
</facelet-taglib>
\ No newline at end of file
Modified: myfaces/core/trunk/impl/src/main/resources/META-INF/facelets/jstl-fn.taglib.xml
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/resources/META-INF/facelets/jstl-fn.taglib.xml?rev=796947&r1=796946&r2=796947&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/resources/META-INF/facelets/jstl-fn.taglib.xml (original)
+++ myfaces/core/trunk/impl/src/main/resources/META-INF/facelets/jstl-fn.taglib.xml Thu Jul 23 05:10:10 2009
@@ -21,5 +21,5 @@
"http://java.sun.com/dtd/facelet-taglib_1_0.dtd">
<facelet-taglib>
- <library-class>com.sun.facelets.tag.jstl.fn.JstlFnLibrary</library-class>
+ <library-class>org.apache.myfaces.view.facelets.tag.jstl.fn.JstlFnLibrary</library-class>
</facelet-taglib>
\ No newline at end of file
Added: myfaces/core/trunk/impl/src/main/resources/org/apache/myfaces/resource/default.dtd
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/resources/org/apache/myfaces/resource/default.dtd?rev=796947&view=auto
==============================================================================
--- myfaces/core/trunk/impl/src/main/resources/org/apache/myfaces/resource/default.dtd (added)
+++ myfaces/core/trunk/impl/src/main/resources/org/apache/myfaces/resource/default.dtd Thu Jul 23 05:10:10 2009
@@ -0,0 +1,22 @@
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<!-- DTD for facelets class in
+org.apache.myfaces.view.facelets.compiler.SAXCompiler
+-->
+<!ELEMENT default ANY>
\ No newline at end of file
Propchange: myfaces/core/trunk/impl/src/main/resources/org/apache/myfaces/resource/default.dtd
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/core/trunk/impl/src/main/resources/org/apache/myfaces/resource/default.dtd
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/core/trunk/impl/src/main/resources/org/apache/myfaces/resource/facelet-taglib_1_0.dtd
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/resources/org/apache/myfaces/resource/facelet-taglib_1_0.dtd?rev=796947&view=auto
==============================================================================
--- myfaces/core/trunk/impl/src/main/resources/org/apache/myfaces/resource/facelet-taglib_1_0.dtd (added)
+++ myfaces/core/trunk/impl/src/main/resources/org/apache/myfaces/resource/facelet-taglib_1_0.dtd Thu Jul 23 05:10:10 2009
@@ -0,0 +1,35 @@
+<!--
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ $Id$
+-->
+
+<!ELEMENT facelet-taglib (library-class|(namespace,(tag|function)+))>
+<!ATTLIST facelet-taglib xmlns CDATA #FIXED "http://java.sun.com/JSF/Facelet">
+<!ELEMENT namespace (#PCDATA)>
+<!ELEMENT library-class (#PCDATA)>
+<!ELEMENT tag (tag-name,(handler-class|component|converter|validator|source))>
+<!ELEMENT tag-name (#PCDATA)>
+<!ELEMENT handler-class (#PCDATA)>
+<!ELEMENT component (component-type,renderer-type?,handler-class?)>
+<!ELEMENT component-type (#PCDATA)>
+<!ELEMENT renderer-type (#PCDATA)>
+<!ELEMENT converter (converter-id, handler-class?)>
+<!ELEMENT converter-id (#PCDATA)>
+<!ELEMENT validator (validator-id, handler-class?)>
+<!ELEMENT validator-id (#PCDATA)>
+<!ELEMENT source (#PCDATA)>
+<!ELEMENT function (function-name,function-class,function-signature)>
+<!ELEMENT function-name (#PCDATA)>
+<!ELEMENT function-class (#PCDATA)>
+<!ELEMENT function-signature (#PCDATA)>
Propchange: myfaces/core/trunk/impl/src/main/resources/org/apache/myfaces/resource/facelet-taglib_1_0.dtd
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/core/trunk/impl/src/main/resources/org/apache/myfaces/resource/facelet-taglib_1_0.dtd
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL