You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by im...@apache.org on 2006/03/03 00:10:31 UTC

svn commit: r382550 - in /myfaces/tomahawk/trunk/core/src/main: java/org/apache/myfaces/custom/document/ resources-facesconfig/META-INF/ tld/ tld/tomahawk-entities/

Author: imario
Date: Thu Mar  2 15:10:28 2006
New Revision: 382550

URL: http://svn.apache.org/viewcvs?rev=382550&view=rev
Log:
replacement for htmls "html", "head" and "body" tag and requirement for "ExtensionFilter-less" mode

Added:
    myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/AbstractDocument.java   (with props)
    myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/AbstractDocumentRenderer.java   (with props)
    myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/AbstractDocumentTag.java   (with props)
    myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/Document.java   (with props)
    myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentBody.java   (with props)
    myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentBodyRenderer.java   (with props)
    myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentBodyTag.java   (with props)
    myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentHead.java   (with props)
    myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentHeadRenderer.java   (with props)
    myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentHeadTag.java   (with props)
    myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentRenderer.java   (with props)
    myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentTag.java   (with props)
    myfaces/tomahawk/trunk/core/src/main/tld/tomahawk-entities/tomahawk_document_attributes.xml   (with props)
    myfaces/tomahawk/trunk/core/src/main/tld/tomahawk-entities/tomahawk_document_body_attributes.xml   (with props)
    myfaces/tomahawk/trunk/core/src/main/tld/tomahawk-entities/tomahawk_document_head_attributes.xml   (with props)
Modified:
    myfaces/tomahawk/trunk/core/src/main/resources-facesconfig/META-INF/faces-config.xml
    myfaces/tomahawk/trunk/core/src/main/tld/tomahawk.tld

Added: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/AbstractDocument.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/AbstractDocument.java?rev=382550&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/AbstractDocument.java (added)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/AbstractDocument.java Thu Mar  2 15:10:28 2006
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * 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.
+ */
+package org.apache.myfaces.custom.document;
+
+import javax.faces.component.UIComponentBase;
+import javax.faces.context.FacesContext;
+
+/**
+ * Base class to handle the document family
+ * 
+ * @author Mario Ivankovits (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+public class AbstractDocument extends UIComponentBase
+{
+	private String _state = null;
+
+	public static final String COMPONENT_FAMILY = "javax.faces.Data";
+	
+	public AbstractDocument(String renderType)
+	{
+		setRendererType(renderType);
+	}
+
+	public String getFamily()
+	{
+		return COMPONENT_FAMILY;
+	}
+
+	public void setState(String state)
+	{
+		_state = state;
+	}
+
+	protected String getState()
+	{
+		return _state;
+	}
+	
+	public boolean hasState()
+	{
+		return isStartState() || isEndState();
+	}
+	
+	public boolean isStartState()
+	{
+		return "start".equals(getState());
+	}
+
+	public boolean isEndState()
+	{
+		return "start".equals(getState());
+	}
+	
+	public Object saveState(FacesContext context)
+	{
+		Object values[] = new Object[2];
+		values[0] = super.saveState(context);
+		values[1] = _state;
+		return values;
+	}
+
+	public void restoreState(FacesContext context, Object state)
+	{
+		Object values[] = (Object[]) state;
+		super.restoreState(context, values[0]);
+		_state = (String) values[1];
+	}
+}
\ No newline at end of file

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/AbstractDocument.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/AbstractDocument.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/AbstractDocument.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/AbstractDocumentRenderer.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/AbstractDocumentRenderer.java?rev=382550&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/AbstractDocumentRenderer.java (added)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/AbstractDocumentRenderer.java Thu Mar  2 15:10:28 2006
@@ -0,0 +1,80 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * 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.
+ */
+package org.apache.myfaces.custom.document;
+
+import java.io.IOException;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import javax.faces.render.Renderer;
+
+import org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils;
+
+/**
+ * Base class to handle the document family
+ * 
+ * @author Mario Ivankovits (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+public abstract class AbstractDocumentRenderer extends Renderer
+{
+	protected abstract String getHtmlTag();
+	protected abstract Class getDocumentClass();
+	
+	public void encodeBegin(FacesContext facesContext, UIComponent uiComponent)
+			throws IOException
+	{
+		RendererUtils.checkParamValidity(facesContext, uiComponent,
+				getDocumentClass());
+
+		AbstractDocument document = (AbstractDocument) uiComponent;
+		
+		ResponseWriter writer = facesContext.getResponseWriter();
+		
+		if (document.isEndState())
+		{
+	        writeBeforeEnd(facesContext);
+		}
+		
+		if (document.hasState() && document.isEndState())
+		{
+			writer.endElement(getHtmlTag());
+		}
+		else
+		{
+			writer.startElement(getHtmlTag(), uiComponent);
+		}
+	}
+
+	public void encodeEnd(FacesContext facesContext, UIComponent uiComponent)
+			throws IOException
+	{
+		AbstractDocument document = (AbstractDocument) uiComponent;
+		
+		ResponseWriter writer = facesContext.getResponseWriter();
+		
+		if (!document.hasState())
+		{
+			writeBeforeEnd(facesContext);
+			writer.endElement(getHtmlTag());
+		}
+	}
+
+	protected void writeBeforeEnd(FacesContext facesContext) throws IOException
+	{
+	}
+}
\ No newline at end of file

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/AbstractDocumentRenderer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/AbstractDocumentRenderer.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/AbstractDocumentRenderer.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/AbstractDocumentTag.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/AbstractDocumentTag.java?rev=382550&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/AbstractDocumentTag.java (added)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/AbstractDocumentTag.java Thu Mar  2 15:10:28 2006
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * 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.
+ */
+package org.apache.myfaces.custom.document;
+
+import javax.faces.component.UIComponent;
+
+import org.apache.myfaces.shared_tomahawk.taglib.html.HtmlComponentTagBase;
+
+/**
+ * Document to enclose the whole document. If not otherwise possible you can use
+ * state="start|end" to demarkate the document boundaries
+ * 
+ * @author Mario Ivankovits (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+public abstract class AbstractDocumentTag extends HtmlComponentTagBase
+{
+	private String _state = null;
+
+	public void release()
+	{
+		super.release();
+		_state = null;
+	}
+
+	public abstract String getComponentType();
+	public abstract String getRendererType();
+
+	protected void setProperties(UIComponent component)
+	{
+		super.setProperties(component);
+		setStringProperty(component, "state", _state);
+	}
+
+	public void setState(String state)
+	{
+		this._state = state;
+	}
+
+	public String getState()
+	{
+		return _state;
+	}
+}
\ No newline at end of file

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/AbstractDocumentTag.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/AbstractDocumentTag.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/AbstractDocumentTag.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/Document.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/Document.java?rev=382550&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/Document.java (added)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/Document.java Thu Mar  2 15:10:28 2006
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * 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.
+ */
+package org.apache.myfaces.custom.document;
+
+
+/**
+ * Document to enclose the whole document. If not otherwise possible you can use
+ * state="start|end" to demarkate the document boundaries
+ * 
+ * @author Mario Ivankovits (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+public class Document extends AbstractDocument
+{
+	public static final String COMPONENT_TYPE = "org.apache.myfaces.Document";
+	private static final String DEFAULT_RENDERER_TYPE = DocumentRenderer.RENDERER_TYPE;
+
+	public Document()
+	{
+		super(DEFAULT_RENDERER_TYPE);
+	}
+}
\ No newline at end of file

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/Document.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/Document.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/Document.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/Document.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentBody.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentBody.java?rev=382550&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentBody.java (added)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentBody.java Thu Mar  2 15:10:28 2006
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * 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.
+ */
+package org.apache.myfaces.custom.document;
+
+
+/**
+ * Document to enclose the document body. If not otherwise possible you can use
+ * state="start|end" to demarkate the document boundaries
+ * 
+ * @author Mario Ivankovits (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+public class DocumentBody extends AbstractDocument
+{
+	public static final String COMPONENT_TYPE = "org.apache.myfaces.DocumentBody";
+	private static final String DEFAULT_RENDERER_TYPE = DocumentRenderer.RENDERER_TYPE;
+
+	public DocumentBody()
+	{
+		super(DEFAULT_RENDERER_TYPE);
+	}
+}
\ No newline at end of file

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentBody.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentBody.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentBody.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentBodyRenderer.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentBodyRenderer.java?rev=382550&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentBodyRenderer.java (added)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentBodyRenderer.java Thu Mar  2 15:10:28 2006
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * 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.
+ */
+package org.apache.myfaces.custom.document;
+
+import java.io.IOException;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.myfaces.renderkit.html.util.ExtensionsPhaseListener;
+
+/**
+ * Document to enclose the whole document. If not otherwise possible you can use
+ * state="start|end" to demarkate the document boundaries
+ * 
+ * @author Mario Ivankovits (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+public class DocumentBodyRenderer extends AbstractDocumentRenderer
+{
+    private static final Log log = LogFactory.getLog(DocumentBodyRenderer.class);
+    
+	public static final String RENDERER_TYPE = "org.apache.myfaces.DocumentBody";
+	
+	protected String getHtmlTag()
+	{
+		return "body";
+	}
+
+	protected Class getDocumentClass()
+	{
+		return DocumentBody.class;
+	}
+
+	protected void writeBeforeEnd(FacesContext facesContext) throws IOException
+	{
+		super.writeBeforeEnd(facesContext);
+       	ExtensionsPhaseListener.writeCodeBeforeBodyEnd(facesContext);
+	}
+}
\ No newline at end of file

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentBodyRenderer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentBodyRenderer.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentBodyRenderer.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentBodyTag.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentBodyTag.java?rev=382550&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentBodyTag.java (added)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentBodyTag.java Thu Mar  2 15:10:28 2006
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * 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.
+ */
+package org.apache.myfaces.custom.document;
+
+/**
+ * Document to enclose the whole document. If not otherwise possible you can use
+ * state="start|end" to demarkate the document boundaries
+ * 
+ * @author Mario Ivankovits (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+public class DocumentBodyTag extends AbstractDocumentTag
+{
+	public String getComponentType()
+	{
+		return DocumentBody.COMPONENT_TYPE;
+	}
+
+	public String getRendererType()
+	{
+		return DocumentBodyRenderer.RENDERER_TYPE;
+	}
+}
\ No newline at end of file

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentBodyTag.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentBodyTag.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentBodyTag.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentHead.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentHead.java?rev=382550&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentHead.java (added)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentHead.java Thu Mar  2 15:10:28 2006
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * 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.
+ */
+package org.apache.myfaces.custom.document;
+
+
+/**
+ * Document to enclose the document head. If not otherwise possible you can use
+ * state="start|end" to demarkate the document boundaries
+ * 
+ * @author Mario Ivankovits (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+public class DocumentHead extends AbstractDocument
+{
+	public static final String COMPONENT_TYPE = "org.apache.myfaces.DocumentHead";
+	private static final String DEFAULT_RENDERER_TYPE = DocumentRenderer.RENDERER_TYPE;
+
+	public DocumentHead()
+	{
+		super(DEFAULT_RENDERER_TYPE);
+	}
+}
\ No newline at end of file

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentHead.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentHead.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentHead.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentHeadRenderer.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentHeadRenderer.java?rev=382550&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentHeadRenderer.java (added)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentHeadRenderer.java Thu Mar  2 15:10:28 2006
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * 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.
+ */
+package org.apache.myfaces.custom.document;
+
+import java.io.IOException;
+
+import javax.faces.context.FacesContext;
+
+import org.apache.myfaces.component.html.util.StreamingAddResource;
+import org.apache.myfaces.shared_tomahawk.renderkit.html.util.AddResource;
+import org.apache.myfaces.shared_tomahawk.renderkit.html.util.AddResourceFactory;
+
+/**
+ * Document to enclose the document head. If not otherwise possible you can use
+ * state="start|end" to demarkate the document boundaries
+ * 
+ * @author Mario Ivankovits (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+public class DocumentHeadRenderer extends AbstractDocumentRenderer
+{
+	public static final String RENDERER_TYPE = "org.apache.myfaces.DocumentHead";
+
+	protected String getHtmlTag()
+	{
+		return "head";
+	}
+
+	protected Class getDocumentClass()
+	{
+		return DocumentHead.class;
+	}
+
+	protected void writeBeforeEnd(FacesContext facesContext) throws IOException
+	{
+		super.writeBeforeEnd(facesContext);
+		
+		AddResource addResource = AddResourceFactory.getInstance(facesContext);
+		if (addResource instanceof StreamingAddResource)
+		{
+			((StreamingAddResource) addResource).addStyleLoaderHere(facesContext, DocumentHead.class);
+		}
+	}
+}
\ No newline at end of file

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentHeadRenderer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentHeadRenderer.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentHeadRenderer.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentHeadTag.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentHeadTag.java?rev=382550&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentHeadTag.java (added)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentHeadTag.java Thu Mar  2 15:10:28 2006
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * 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.
+ */
+package org.apache.myfaces.custom.document;
+
+/**
+ * Document to enclose the document head. If not otherwise possible you can use
+ * state="start|end" to demarkate the document boundaries
+ * 
+ * @author Mario Ivankovits (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+public class DocumentHeadTag extends AbstractDocumentTag
+{
+	public String getComponentType()
+	{
+		return DocumentHead.COMPONENT_TYPE;
+	}
+
+	public String getRendererType()
+	{
+		return DocumentHeadRenderer.RENDERER_TYPE;
+	}
+}
\ No newline at end of file

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentHeadTag.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentHeadTag.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentHeadTag.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentRenderer.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentRenderer.java?rev=382550&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentRenderer.java (added)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentRenderer.java Thu Mar  2 15:10:28 2006
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * 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.
+ */
+package org.apache.myfaces.custom.document;
+
+/**
+ * Document to enclose the whole document. If not otherwise possible you can use
+ * state="start|end" to demarkate the document boundaries
+ * 
+ * @author Mario Ivankovits (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+public class DocumentRenderer extends AbstractDocumentRenderer
+{
+	public static final String RENDERER_TYPE = "org.apache.myfaces.Document";
+
+	protected String getHtmlTag()
+	{
+		return "html";
+	}
+
+	protected Class getDocumentClass()
+	{
+		return Document.class;
+	}
+}
\ No newline at end of file

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentRenderer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentRenderer.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentRenderer.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentTag.java
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentTag.java?rev=382550&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentTag.java (added)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentTag.java Thu Mar  2 15:10:28 2006
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * 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.
+ */
+package org.apache.myfaces.custom.document;
+
+/**
+ * Document to enclose the whole document. If not otherwise possible you can use
+ * state="start|end" to demarkate the document boundaries
+ * 
+ * @author Mario Ivankovits (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+public class DocumentTag extends AbstractDocumentTag
+{
+	public String getComponentType()
+	{
+		return Document.COMPONENT_TYPE;
+	}
+
+	public String getRendererType()
+	{
+		return DocumentRenderer.RENDERER_TYPE;
+	}
+}
\ No newline at end of file

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentTag.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentTag.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/document/DocumentTag.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: myfaces/tomahawk/trunk/core/src/main/resources-facesconfig/META-INF/faces-config.xml
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/core/src/main/resources-facesconfig/META-INF/faces-config.xml?rev=382550&r1=382549&r2=382550&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/resources-facesconfig/META-INF/faces-config.xml (original)
+++ myfaces/tomahawk/trunk/core/src/main/resources-facesconfig/META-INF/faces-config.xml Thu Mar  2 15:10:28 2006
@@ -156,6 +156,21 @@
         <component-class>org.apache.myfaces.custom.buffer.Buffer</component-class>
     </component>
 
+    <component>
+        <component-type>org.apache.myfaces.Document</component-type>
+        <component-class>org.apache.myfaces.custom.document.Document</component-class>
+    </component>
+    
+    <component>
+        <component-type>org.apache.myfaces.DocumentHead</component-type>
+        <component-class>org.apache.myfaces.custom.document.DocumentHead</component-class>
+    </component>
+    
+    <component>
+        <component-type>org.apache.myfaces.DocumentBody</component-type>
+        <component-class>org.apache.myfaces.custom.document.DocumentBody</component-class>
+    </component>
+    
     <component>
         <component-type>org.apache.myfaces.Div</component-type>
         <component-class>org.apache.myfaces.custom.div.Div</component-class>
@@ -536,6 +551,24 @@
             <renderer-class>org.apache.myfaces.custom.buffer.BufferRenderer</renderer-class>
         </renderer>
 
+        <renderer>
+            <component-family>javax.faces.Data</component-family>
+            <renderer-type>org.apache.myfaces.Document</renderer-type>
+            <renderer-class>org.apache.myfaces.custom.document.DocumentRenderer</renderer-class>
+        </renderer>
+        
+        <renderer>
+            <component-family>javax.faces.Data</component-family>
+            <renderer-type>org.apache.myfaces.DocumentHead</renderer-type>
+            <renderer-class>org.apache.myfaces.custom.document.DocumentHeadRenderer</renderer-class>
+        </renderer>
+        
+        <renderer>
+            <component-family>javax.faces.Data</component-family>
+            <renderer-type>org.apache.myfaces.DocumentBody</renderer-type>
+            <renderer-class>org.apache.myfaces.custom.document.DocumentBodyRenderer</renderer-class>
+        </renderer>
+        
         <renderer>
             <component-family>org.apache.myfaces.Checkbox</component-family>
             <renderer-type>org.apache.myfaces.Checkbox</renderer-type>

Added: myfaces/tomahawk/trunk/core/src/main/tld/tomahawk-entities/tomahawk_document_attributes.xml
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/core/src/main/tld/tomahawk-entities/tomahawk_document_attributes.xml?rev=382550&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/tld/tomahawk-entities/tomahawk_document_attributes.xml (added)
+++ myfaces/tomahawk/trunk/core/src/main/tld/tomahawk-entities/tomahawk_document_attributes.xml Thu Mar  2 15:10:28 2006
@@ -0,0 +1,5 @@
+        <attribute>
+            <name>state</name>
+            <required>false</required>
+            <rtexprvalue>false</rtexprvalue>
+        </attribute>

Propchange: myfaces/tomahawk/trunk/core/src/main/tld/tomahawk-entities/tomahawk_document_attributes.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/tomahawk/trunk/core/src/main/tld/tomahawk-entities/tomahawk_document_attributes.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: myfaces/tomahawk/trunk/core/src/main/tld/tomahawk-entities/tomahawk_document_attributes.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: myfaces/tomahawk/trunk/core/src/main/tld/tomahawk-entities/tomahawk_document_body_attributes.xml
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/core/src/main/tld/tomahawk-entities/tomahawk_document_body_attributes.xml?rev=382550&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/tld/tomahawk-entities/tomahawk_document_body_attributes.xml (added)
+++ myfaces/tomahawk/trunk/core/src/main/tld/tomahawk-entities/tomahawk_document_body_attributes.xml Thu Mar  2 15:10:28 2006
@@ -0,0 +1,5 @@
+        <attribute>
+            <name>state</name>
+            <required>false</required>
+            <rtexprvalue>false</rtexprvalue>
+        </attribute>

Propchange: myfaces/tomahawk/trunk/core/src/main/tld/tomahawk-entities/tomahawk_document_body_attributes.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/tomahawk/trunk/core/src/main/tld/tomahawk-entities/tomahawk_document_body_attributes.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: myfaces/tomahawk/trunk/core/src/main/tld/tomahawk-entities/tomahawk_document_body_attributes.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: myfaces/tomahawk/trunk/core/src/main/tld/tomahawk-entities/tomahawk_document_head_attributes.xml
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/core/src/main/tld/tomahawk-entities/tomahawk_document_head_attributes.xml?rev=382550&view=auto
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/tld/tomahawk-entities/tomahawk_document_head_attributes.xml (added)
+++ myfaces/tomahawk/trunk/core/src/main/tld/tomahawk-entities/tomahawk_document_head_attributes.xml Thu Mar  2 15:10:28 2006
@@ -0,0 +1,5 @@
+        <attribute>
+            <name>state</name>
+            <required>false</required>
+            <rtexprvalue>false</rtexprvalue>
+        </attribute>

Propchange: myfaces/tomahawk/trunk/core/src/main/tld/tomahawk-entities/tomahawk_document_head_attributes.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: myfaces/tomahawk/trunk/core/src/main/tld/tomahawk-entities/tomahawk_document_head_attributes.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: myfaces/tomahawk/trunk/core/src/main/tld/tomahawk-entities/tomahawk_document_head_attributes.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: myfaces/tomahawk/trunk/core/src/main/tld/tomahawk.tld
URL: http://svn.apache.org/viewcvs/myfaces/tomahawk/trunk/core/src/main/tld/tomahawk.tld?rev=382550&r1=382549&r2=382550&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/tld/tomahawk.tld (original)
+++ myfaces/tomahawk/trunk/core/src/main/tld/tomahawk.tld Thu Mar  2 15:10:28 2006
@@ -180,6 +180,12 @@
       SYSTEM "tomahawk-entities/tomahawk_alias_bean_attributes.xml">
 <!ENTITY tomahawk_buffer_attributes
       SYSTEM "tomahawk-entities/tomahawk_buffer_attributes.xml">
+<!ENTITY tomahawk_document_attributes
+      SYSTEM "tomahawk-entities/tomahawk_document_attributes.xml">
+<!ENTITY tomahawk_document_head_attributes
+      SYSTEM "tomahawk-entities/tomahawk_document_head_attributes.xml">
+<!ENTITY tomahawk_document_body_attributes
+      SYSTEM "tomahawk-entities/tomahawk_document_body_attributes.xml">
 <!ENTITY tomahawk_save_state_attributes
       SYSTEM "tomahawk-entities/tomahawk_save_state_attributes.xml">
 <!ENTITY tomahawk_update_action_listener_attributes
@@ -1297,6 +1303,39 @@
         &tomahawk_buffer_attributes;
     </tag>
 
+    <!-- document -->
+    <tag>
+        <name>document</name>
+        <tag-class>org.apache.myfaces.custom.document.DocumentTag</tag-class>
+        <body-content>JSP</body-content>
+        <description>
+        	Encapsulates the whole document. Equivalent to htmls &lt;html&gt; tag
+        </description>
+        &tomahawk_document_attributes;
+    </tag>
+    
+    <!-- document head -->
+    <tag>
+        <name>documentHead</name>
+        <tag-class>org.apache.myfaces.custom.document.DocumentHeadTag</tag-class>
+        <body-content>JSP</body-content>
+        <description>
+        	Encapsulates the head of your document. Equivalent to htmls &lt;head&gt; tag
+        </description>
+        &tomahawk_document_head_attributes;
+    </tag>
+    
+    <!-- document body -->
+    <tag>
+        <name>documentBody</name>
+        <tag-class>org.apache.myfaces.custom.document.DocumentBodyTag</tag-class>
+        <body-content>JSP</body-content>
+        <description>
+        	Encapsulates the body of your document. Equivalent to htmls &lt;body&gt; tag
+        </description>
+        &tomahawk_document_body_attributes;
+    </tag>
+    
     <!-- saveState -->
     <tag>
         <name>saveState</name>