Include facelets-JSF_2_0_0_from_HEAD_20080606_BRANCH facelets into
Mojarra
SECTION: jsf-api Changes
M jsf-api/src/javax/faces/component/UIComponentBase.java
- Small but significant change. Without this change,
@ResourceDependency would not work.
SECTION: jsf-impl Changes
M jsf-ri/build.xml
- suck in the jsf-facelets-2.0-SNAPSHOT.jar into jsf-impl.
SECTION: jsf-demo Changes
D jsf-demo/head-body/src/main/java/headbody/MyComponentTag.java
D jsf-demo/head-body/src/main/webapp/WEB-INF/headbody.tld
- This app is a facelets app. No JSP needed.
M jsf-demo/head-body/src/main/java/headbody/MyComponent.java
- change the name of the resource and the library in which it resides.
D jsf-demo/head-body/src/main/webapp/WEB-INF/extensions.taglib.xml
M jsf-demo/head-body/src/main/webapp/WEB-INF/web.xml
- No need for this since they are now in the facelets jar, which is in
the jsf-impl jar.
M jsf-demo/head-body/src/main/webapp/WEB-INF/faces-config.xml
D jsf-demo/head-body/src/main/webapp/WEB-INF/lib/aaa-facelet-viewhandler.jar
- Just put the facelets-viewhandler declaration in faces-config rather
than including this silly jar.
D jsf-demo/head-body/src/main/webapp/resources/javax.faces/ajax.js
A jsf-demo/head-body/src/main/webapp/resources/mylib
A + jsf-demo/head-body/src/main/webapp/resources/mylib/mycomponent.js
- renamed
M jsf-demo/head-body/src/main/webapp/head.xhtml
- remove mjx: now in jsf-impl
M jsf-demo/head-body/pom.xml
- change dependency version.
SECTION: Diffs
Index: jsf-api/src/javax/faces/component/UIComponentBase.java
===================================================================
--- jsf-api/src/javax/faces/component/UIComponentBase.java (revision 4883)
+++ jsf-api/src/javax/faces/component/UIComponentBase.java (working copy)
@@ -2132,7 +2132,7 @@
}
}
}
- if (sourceClass.isAnnotationPresent(ResourceDependencies.class)) {
+ if (sourceClass.isAnnotationPresent(ResourceDependency.class)) {
ResourceDependency resource =
sourceClass.getAnnotation(ResourceDependency.class);
createComponentResource(context, resource);
Index: jsf-ri/build.xml
===================================================================
--- jsf-ri/build.xml (revision 4881)
+++ jsf-ri/build.xml (working copy)
@@ -58,6 +58,11 @@
<property name="build.generate.tld.dir"
value="${build.generate.dir}/conf/share"/>
+ <!-- The base directory for binary dependency libs under local version
+ control -->
+ <property name="local.lib.dir"
+ value="${basedir}/../lib"/>
+
<!-- The base directory for distribution targets -->
<property name="dist.dir" value="${basedir}/dist"/>
@@ -452,6 +457,11 @@
includes="com-sun-commons*.jar"/>
</unjar>
-->
+ <unjar dest="${build.classes.dir}">
+ <fileset dir="${local.lib.dir}"
+ includes="jsf-facelets-2.0-SNAPSHOT.jar"/>
+ </unjar>
+
<jsf.manifested.jar jarfile="${build.dir}/lib/${name}.jar"
basedir="${build.classes.dir}"
extension-name="com.sun.faces"/>
Index: jsf-demo/head-body/src/main/java/headbody/MyComponentTag.java
===================================================================
--- jsf-demo/head-body/src/main/java/headbody/MyComponentTag.java (revision 4881)
+++ jsf-demo/head-body/src/main/java/headbody/MyComponentTag.java (working copy)
@@ -1,21 +0,0 @@
-package headbody;
-
-import javax.faces.component.UIComponent;
-import javax.faces.webapp.UIComponentELTag;
-
-public class MyComponentTag extends UIComponentELTag {
-
- public String getRendererType() {
- return null;
- }
-
- public String getComponentType() {
- return "headbody.MyComponent";
- }
-
- @Override
- protected void setProperties(UIComponent component) {
- super.setProperties(component);
- }
-
-}
Index: jsf-demo/head-body/src/main/java/headbody/MyComponent.java
===================================================================
--- jsf-demo/head-body/src/main/java/headbody/MyComponent.java (revision 4881)
+++ jsf-demo/head-body/src/main/java/headbody/MyComponent.java (working copy)
@@ -3,7 +3,7 @@
import javax.faces.application.ResourceDependency;
import javax.faces.component.UIOutput;
-_at_ResourceDependency (name="ajax.js", library="javax.faces", target="head")
+_at_ResourceDependency (name="mycomponent.js", library="mylib", target="head")
public class MyComponent extends UIOutput {
public static final String COMPONENT_TYPE = "headbody.MyComponent";
Index: jsf-demo/head-body/src/main/webapp/WEB-INF/extensions.taglib.xml
===================================================================
--- jsf-demo/head-body/src/main/webapp/WEB-INF/extensions.taglib.xml (revision 4881)
+++ jsf-demo/head-body/src/main/webapp/WEB-INF/extensions.taglib.xml (working copy)
@@ -1,55 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
- Copyright 2005 Sun Microsystems, Inc. All rights reserved.
- Licensed under the Common Development and Distribution License,
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
-
http://www.sun.com/cddl/
-
- 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: extensions.taglib.xml,v 1.1.2.1 2008/02/25 04:40:46 rogerk Exp $
--->
-
-<!DOCTYPE facelet-taglib PUBLIC
- "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
- "
http://java.sun.com/dtd/facelet-taglib_1_0.dtd">
-
-<facelet-taglib>
- <namespace>
http://java.sun.com/jsf/mojarra/extensions</namespace>
- <tag>
- <tag-name>body</tag-name>
- <component>
- <component-type>javax.faces.Output</component-type>
- <renderer-type>javax.faces.Body</renderer-type>
- </component>
- </tag>
- <tag>
- <tag-name>head</tag-name>
- <component>
- <component-type>javax.faces.Output</component-type>
- <renderer-type>javax.faces.Head</renderer-type>
- </component>
- </tag>
- <tag>
- <tag-name>outputScript</tag-name>
- <component>
- <component-type>javax.faces.Output</component-type>
- <renderer-type>javax.faces.resource.Script</renderer-type>
- </component>
- </tag>
- <tag>
- <tag-name>outputStylesheet</tag-name>
- <component>
- <component-type>javax.faces.Output</component-type>
- <renderer-type>javax.faces.resource.Stylesheet</renderer-type>
- </component>
- </tag>
-</facelet-taglib>
-
Index: jsf-demo/head-body/src/main/webapp/WEB-INF/headbody.tld
===================================================================
--- jsf-demo/head-body/src/main/webapp/WEB-INF/headbody.tld (revision 4881)
+++ jsf-demo/head-body/src/main/webapp/WEB-INF/headbody.tld (working copy)
@@ -1,69 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-
-<!--
- DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
-
- Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
-
- The contents of this file are subject to the terms of either the GNU
- General Public License Version 2 only ("GPL") or the Common Development
- and Distribution License("CDDL") (collectively, the "License"). You
- may not use this file except in compliance with the License. You can obtain
- a copy of the License at
https://glassfish.dev.java.net/public/CDDL+GPL.html
- or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
- language governing permissions and limitations under the License.
-
- When distributing the software, include this License Header Notice in each
- file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
- Sun designates this particular file as subject to the "Classpath" exception
- as provided by Sun in the GPL Version 2 section of the License file that
- accompanied this code. If applicable, add the following below the License
- Header, with the fields enclosed by brackets [] replaced by your own
- identifying information: "Portions Copyrighted [year]
- [name of copyright owner]"
-
- Contributor(s):
-
- If you wish your version of this file to be governed by only the CDDL or
- only the GPL Version 2, indicate your decision by adding "[Contributor]
- elects to include this software in this distribution under the [CDDL or GPL
- Version 2] license." If you don't indicate a single choice of license, a
- recipient has the option to distribute your version of this file under
- either the CDDL, the GPL Version 2 or to extend the choice of license to
- its licensees as provided above. However, if you add GPL Version 2 code
- and therefore, elected the GPL Version 2 license, then the option applies
- only if the new code is made subject to such option by the copyright
- holder.
--->
-
-<taglib xmlns="
http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="
http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd"
- version="2.1">
-
- <!-- ============== Tag Library Description Elements ============= -->
- <description>
- This tag library contains tags used by the CarStore application.
- </description>
- <tlib-version>1.2</tlib-version>
- <short-name>hb</short-name>
- <uri>
https://javaserverfaces.dev.java.net/demo/headbody</uri>
-
- <!-- ===================== ImageMap tags ====================== -->
- <tag>
- <description>
- </description>
- <name>myComponent</name>
- <tag-class>headbody.MycomponentTag</tag-class>
- <body-content>empty</body-content>
- <attribute>
- <description>
- </description>
- <name></name>
- <required>true</required>
- <deferred-value>
- <type>java.lang.String</type>
- </deferred-value>
- </attribute>
- </tag>
-</taglib>
Index: jsf-demo/head-body/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- jsf-demo/head-body/src/main/webapp/WEB-INF/faces-config.xml (revision 4881)
+++ jsf-demo/head-body/src/main/webapp/WEB-INF/faces-config.xml (working copy)
@@ -43,6 +43,12 @@
xsi:schemaLocation="
http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
version="1.2">
+ <application>
+ <view-handler>
+ com.sun.facelets.FaceletViewHandler
+ </view-handler>
+ </application>
+
<component>
<description><![CDATA[Your description here]]></description>
<display-name>MyComponent</display-name>
Index: jsf-demo/head-body/src/main/webapp/WEB-INF/lib/aaa-facelet-viewhandler.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: jsf-demo/head-body/src/main/webapp/WEB-INF/web.xml
===================================================================
--- jsf-demo/head-body/src/main/webapp/WEB-INF/web.xml (revision 4881)
+++ jsf-demo/head-body/src/main/webapp/WEB-INF/web.xml (working copy)
@@ -59,7 +59,7 @@
<context-param>
<param-name>facelets.LIBRARIES</param-name>
- <param-value>/WEB-INF/extensions.taglib.xml;/WEB-INF/demo.taglib.xml</param-value>
+ <param-value>/WEB-INF/demo.taglib.xml</param-value>
</context-param>
<!-- Faces Servlet -->
Index: jsf-demo/head-body/src/main/webapp/resources/javax.faces/ajax.js
===================================================================
--- jsf-demo/head-body/src/main/webapp/resources/javax.faces/ajax.js (revision 4881)
+++ jsf-demo/head-body/src/main/webapp/resources/javax.faces/ajax.js (working copy)
@@ -1,226 +0,0 @@
-/*******************************************************************************
- * OpenAjax.js
- *
- * Reference implementation of the OpenAjax Hub, as specified by OpenAjax Alliance.
- * Specification is under development at:
- *
- *
http://www.openajax.org/member/wiki/OpenAjax_Hub_Specification
- *
- * Copyright 2006-2007 OpenAjax Alliance
- *
- * 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.
- *
- ******************************************************************************/
-
-// prevent re-definition of the OpenAjax object
-if(!window["OpenAjax"]){
- OpenAjax = new function(){
- var t = true;
- var f = false;
- var g = window;
- var libs;
- var ooh = "org.openajax.hub.";
-
- var h = {};
- this.hub = h;
- h.implementer = "
http://openajax.org";
- h.implVersion = "0.6";
- h.specVersion = "0.6";
- h.implExtraData = {};
- var libs = {};
- h.libraries = libs;
-
- h.registerLibrary = function(prefix, nsURL, version, extra){
- libs[prefix] = {
- prefix: prefix,
- namespaceURI: nsURL,
- version: version,
- extraData: extra
- };
- this.publish(ooh+"registerLibrary", libs[prefix]);
- }
- h.unregisterLibrary = function(prefix){
- this.publish(ooh+"unregisterLibrary", libs[prefix]);
- delete libs[prefix];
- }
-
- h._subscriptions = { c:{}, s:[] };
- h._cleanup = [];
- h._subIndex = 0;
- h._pubDepth = 0;
-
- h.subscribe = function(name, callback, scope, subscriberData, filter){
- if(!scope){
- scope = window;
- }
- var handle = name + "." + this._subIndex;
- var sub = { scope: scope, cb: callback, fcb: filter, data: subscriberData, sid: this._subIndex++, hdl: handle };
- var path = name.split(".");
- this._subscribe(this._subscriptions, path, 0, sub);
- return handle;
- }
-
- h.publish = function(name, message){
- var path = name.split(".");
- this._pubDepth++;
- this._publish(this._subscriptions, path, 0, name, message);
- this._pubDepth--;
- if((this._cleanup.length > 0) && (this._pubDepth == 0)){
- for(var i = 0; i < this._cleanup.length; i++){
- this.unsubscribe(this._cleanup[i].hdl);
- }
- delete(this._cleanup);
- this._cleanup = [];
- }
- }
-
- h.unsubscribe = function(sub){
- var path = sub.split(".");
- var sid = path.pop();
- this._unsubscribe(this._subscriptions, path, 0, sid);
- }
-
- h._subscribe = function(tree, path, index, sub){
- var token = path[index];
- if(index == path.length){
- tree.s.push(sub);
- }else{
- if(typeof tree.c == "undefined"){
- tree.c = {};
- }
- if(typeof tree.c[token] == "undefined"){
- tree.c[token] = { c: {}, s: [] };
- this._subscribe(tree.c[token], path, index + 1, sub);
- }else{
- this._subscribe( tree.c[token], path, index + 1, sub);
- }
- }
- }
-
- h._publish = function(tree, path, index, name, msg){
- if(typeof tree != "undefined"){
- var node;
- if(index == path.length) {
- node = tree;
- }else{
- this._publish(tree.c[path[index]], path, index + 1, name, msg);
- this._publish(tree.c["*"], path, index + 1, name, msg);
- node = tree.c["**"];
- }
- if(typeof node != "undefined"){
- var callbacks = node.s;
- var max = callbacks.length;
- for(var i = 0; i < max; i++){
- if(callbacks[i].cb){
- var sc = callbacks[i].scope;
- var cb = callbacks[i].cb;
- var fcb = callbacks[i].fcb;
- var d = callbacks[i].data;
- if(typeof cb == "string"){
- // get a function object
- cb = sc[cb];
- }
- if(typeof fcb == "string"){
- // get a function object
- fcb = sc[fcb];
- }
- if((!fcb) ||
- (fcb.call(sc, name, msg, d))) {
- cb.call(sc, name, msg, d);
- }
- }
- }
- }
- }
- }
-
- h._unsubscribe = function(tree, path, index, sid) {
- if(typeof tree != "undefined") {
- if(index < path.length) {
- var childNode = tree.c[path[index]];
- this._unsubscribe(childNode, path, index + 1, sid);
- if(childNode.s.length == 0) {
- for(var x in childNode.c)
- return;
- delete tree.c[path[index]];
- }
- return;
- }
- else {
- var callbacks = tree.s;
- var max = callbacks.length;
- for(var i = 0; i < max; i++)
- if(sid == callbacks[i].sid) {
- if(this._pubDepth > 0) {
- callbacks[i].cb = null;
- this._cleanup.push(callbacks[i]);
- }
- else
- callbacks.splice(i, 1);
- return;
- }
- }
- }
- }
- // The following function is provided for automatic testing purposes.
- // It is not expected to be deployed in run-time OpenAjax Hub implementations.
- h.reinit = function()
- {
- for (var lib in OpenAjax.hub.libraries) {
- delete OpenAjax.hub.libraries[lib];
- }
- OpenAjax.hub.registerLibrary("OpenAjax", "
http://openajax.org/hub", "0.6", {});
-
- delete OpenAjax._subscriptions;
- OpenAjax._subscriptions = {c:{},s:[]};
- delete OpenAjax._cleanup;
- OpenAjax._cleanup = [];
- OpenAjax._subIndex = 0;
- OpenAjax._pubDepth = 0;
- }
- };
- // Register the OpenAjax Hub itself as a library.
- OpenAjax.hub.registerLibrary("OpenAjax", "
http://openajax.org/hub", "0.6", {});
-
-}
-
-/**
- * Create namespaces
- */
-if (javax == null || typeof javax == "undefined") {
- var javax = new Object();
-}
-if (javax.faces == null || typeof java.faces == "undefined") {
- javax["faces"] = new Object();
-}
-if (javax.faces.Ajax == null || typeof javax.faces.Ajax == "undefined") {
- javax.faces["Ajax"] = new Object();
-}
-
-/**
- * Register with OpenAjax
- */
-if (typeof OpenAjax != "undefined" &&
- typeof OpenAjax.hub.registerLibrary != "undefined") {
- OpenAjax.hub.registerLibrary("javax", "www.sun.com", "1.0", null);
-}
-
-javax.faces.Ajax = {
-
- viewState: function(form, options) {
- var viewState = null;
- return viewState;
- }
-
-}
-
-function inMyComponent() {
- var element = document.getElementById("replaceByJavaScript");
- element.innerHTML = "<i>inMyComponent</i>";
-}
Index: jsf-demo/head-body/src/main/webapp/head.xhtml
===================================================================
--- jsf-demo/head-body/src/main/webapp/head.xhtml (revision 4881)
+++ jsf-demo/head-body/src/main/webapp/head.xhtml (working copy)
@@ -2,18 +2,17 @@
<html xmlns="
http://www.w3.org/1999/xhtml"
xmlns:h="
http://java.sun.com/jsf/html"
xmlns:f="
http://java.sun.com/jsf/core"
- xmlns:mjx="
http://java.sun.com/jsf/mojarra/extensions"
xmlns:hb="
https://javaserverfaces.dev.java.net/demo/headbody"
xmlns:ui="
http://java.sun.com/jsf/facelets">
<f:view contentType="text/html"/>
-<mjx:head>
+<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Head and Body Investigation</title>
-</mjx:head>
+</h:head>
-<mjx:body>
+<h:body>
<h1>Template Text</h1>
@@ -24,13 +23,13 @@
<h:inputText />
- <mjx:outputScript name="ajaxZero.js" library="javax.faces" target="head"/>
- <mjx:outputScript name="ajaxOne.js" library="javax.faces" target="head"/>
- <mjx:outputScript name="ajaxTwo.js" library="javax.faces" target="body"/>
- <mjx:outputScript name="ajaxThree.js" library="javax.faces"/>
- <mjx:outputScript name="scriptInForm.js" library="form" target="form"/>
+ <h:outputScript name="ajaxZero.js" library="javax.faces" target="head"/>
+ <h:outputScript name="ajaxOne.js" library="javax.faces" target="head"/>
+ <h:outputScript name="ajaxTwo.js" library="javax.faces" target="body"/>
+ <h:outputScript name="ajaxThree.js" library="javax.faces"/>
+ <h:outputScript name="scriptInForm.js" library="form" target="form"/>
- <mjx:outputStylesheet name="basic.css" />
+ <h:outputStylesheet name="basic.css" />
<hb:myComponent />
@@ -61,6 +60,6 @@
</form>
-</mjx:body>
+</h:body>
</html>
Index: jsf-demo/head-body/pom.xml
===================================================================
--- jsf-demo/head-body/pom.xml (revision 4881)
+++ jsf-demo/head-body/pom.xml (working copy)
@@ -74,21 +74,10 @@
<dependencies>
<dependency>
<groupId>javax.faces</groupId>
- <artifactId>jsf-facelets</artifactId>
- <version>1.1.11-115</version>
- </dependency>
- <dependency>
- <groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
- <version>115-SNAPSHOT</version>
+ <version>2.0.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>javaee</groupId>
- <artifactId>javaee-api</artifactId>
- <version>5</version>
- <scope>provided</scope>
- </dependency>
</dependencies>
<reporting>
<plugins>
Index: lib/jsf-facelets-2.0-SNAPSHOT.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: lib/jsf-facelets-2.0-SNAPSHOT.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
--
| ed.burns_at_sun.com | office: 408 884 9519 OR x31640
| homepage: | http://purl.oclc.org/NET/edburns/
| aim: edburns0sunw | iim: ed.burns_at_sun.com