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 2008/06/04 05:35:56 UTC
svn commit: r662964 [2/2] - in
/myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk:
core12/ core12/src/ core12/src/main/ core12/src/main/conf/
core12/src/main/conf/META-INF/ core12/src/main/java/
core12/src/main/java/org/ core...
Added: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/aliasbean/AliasBeansScope.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/aliasbean/AliasBeansScope.java?rev=662964&view=auto
==============================================================================
--- myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/aliasbean/AliasBeansScope.java (added)
+++ myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/aliasbean/AliasBeansScope.java Tue Jun 3 20:35:55 2008
@@ -0,0 +1,288 @@
+/*
+ * 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.
+ */
+package org.apache.myfaces.custom.aliasbean;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.io.IOException;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIComponentBase;
+import javax.faces.context.FacesContext;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.FacesEvent;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.myfaces.shared_tomahawk.util.RestoreStateUtils;
+import org.apache.myfaces.shared_tomahawk.component.BindingAware;
+
+/**
+ * Holds several aliases that are configured by aliasBean tags.
+ * <p>
+ * The aliasBean tag must enclose all the components that are within the scope
+ * of the alias. When multiple aliasas are defined, this makes the page structure
+ * very clumsy; for example defining 5 aliases means the content must be nested
+ * 5 indentation levels deep. This tag instead allows the content block to be
+ * wrapped in just one AliasBeansScope tag, and then have AliasBean tags with
+ * empty bodies added as direct children of this component. The scope of the AliasBean
+ * tag still starts when the tag begins, but instead of ending when the tag ends
+ * the scope of the nested AliasBean tags extends to the end of this component.
+ *
+ * @JSFComponent
+ * name = "t:aliasBeansScope"
+ * tagClass = "org.apache.myfaces.custom.aliasbean.AliasBeansScopeTag"
+ *
+ * @JSFJspProperty
+ * name = "rendered"
+ * returnType = "boolean"
+ * tagExcluded = "true"
+ *
+ * @JSFJspProperty
+ * name = "binding"
+ * returnType = "java.lang.String"
+ * tagExcluded = "true"
+ *
+ * @author Sylvain Vieujot (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+public class AliasBeansScope extends UIComponentBase implements BindingAware
+{
+ static final Log log = LogFactory.getLog(AliasBeansScope.class);
+
+ public static final String COMPONENT_TYPE = "org.apache.myfaces.AliasBeansScope";
+ public static final String COMPONENT_FAMILY = "javax.faces.Data";
+
+ private ArrayList _aliases = new ArrayList();
+ transient FacesContext _context = null;
+
+ void addAlias(Alias alias)
+ {
+ _aliases.add(alias);
+ }
+
+ public String getFamily()
+ {
+ return COMPONENT_FAMILY;
+ }
+
+ public String getRendererType() {
+ return null;
+ }
+
+ public Object saveState(FacesContext context)
+ {
+ log.debug("saveState");
+ _context = context;
+
+ return super.saveState(context);
+ }
+
+ public void restoreState(FacesContext context, Object state)
+ {
+ log.debug("restoreState");
+ _context = context;
+
+ super.restoreState(context, state);
+ }
+
+ public Object processSaveState(FacesContext context)
+ {
+ if (context == null)
+ throw new NullPointerException("context");
+ if (isTransient())
+ return null;
+
+ makeAliases(context);
+
+ Map facetMap = null;
+ for (Iterator it = getFacets().entrySet().iterator(); it.hasNext();)
+ {
+ Map.Entry entry = (Map.Entry) it.next();
+ if (facetMap == null)
+ facetMap = new HashMap();
+ UIComponent component = (UIComponent) entry.getValue();
+ if (!component.isTransient())
+ {
+ facetMap.put(entry.getKey(), component.processSaveState(context));
+ }
+ }
+
+ List childrenList = null;
+ if (getChildCount() > 0)
+ {
+ for (Iterator it = getChildren().iterator(); it.hasNext();)
+ {
+ UIComponent child = (UIComponent) it.next();
+ if (!child.isTransient())
+ {
+ if (childrenList == null)
+ childrenList = new ArrayList(getChildCount());
+ childrenList.add(child.processSaveState(context));
+ }
+ }
+ }
+
+ removeAliases(context);
+
+ return new Object[]{saveState(context), facetMap, childrenList};
+ }
+
+ public void processRestoreState(FacesContext context, Object state)
+ {
+ if (context == null)
+ throw new NullPointerException("context");
+ Object myState = ((Object[]) state)[0];
+
+ restoreState(context, myState);
+
+ makeAliases(context);
+
+ Map facetMap = (Map) ((Object[]) state)[1];
+
+ for (Iterator it = getFacets().entrySet().iterator(); it.hasNext();)
+ {
+ Map.Entry entry = (Map.Entry) it.next();
+ Object facetState = facetMap.get(entry.getKey());
+ if (facetState != null)
+ {
+ ((UIComponent) entry.getValue()).processRestoreState(context, facetState);
+ }
+ else
+ {
+ context.getExternalContext().log("No state found to restore facet " + entry.getKey());
+ }
+ }
+
+ List childrenList = (List) ((Object[]) state)[2];
+ if (getChildCount() > 0)
+ {
+ int idx = 0;
+ for (Iterator it = getChildren().iterator(); it.hasNext();)
+ {
+ UIComponent child = (UIComponent) it.next();
+ Object childState = childrenList.get(idx++);
+ if (childState != null)
+ {
+ child.processRestoreState(context, childState);
+ }
+ else
+ {
+ context.getExternalContext().log("No state found to restore child of component " + getId());
+ }
+ }
+ }
+
+ removeAliases(context);
+ }
+
+ public void processValidators(FacesContext context)
+ {
+ log.debug("processValidators");
+ makeAliases(context);
+ super.processValidators(context);
+ removeAliases(context);
+ }
+
+ public void processDecodes(FacesContext context)
+ {
+ log.debug("processDecodes");
+ makeAliases(context);
+ super.processDecodes(context);
+ removeAliases(context);
+ }
+
+ public void processUpdates(FacesContext context)
+ {
+ log.debug("processUpdates");
+ makeAliases(context);
+ super.processUpdates(context);
+ removeAliases(context);
+ }
+
+ public void encodeBegin(FacesContext context) throws IOException
+ {
+ log.debug("encodeBegin");
+ makeAliases(context);
+ }
+
+ public void encodeEnd(FacesContext context)
+ {
+ log.debug("encodeEnd");
+ removeAliases(context);
+ }
+
+ public void queueEvent(FacesEvent event)
+ {
+ super.queueEvent(new FacesEventWrapper(event, this));
+ }
+
+ public void broadcast(FacesEvent event) throws AbortProcessingException
+ {
+ makeAliases();
+
+ if (event instanceof FacesEventWrapper)
+ {
+ FacesEvent originalEvent = ((FacesEventWrapper) event).getWrappedFacesEvent();
+ originalEvent.getComponent().broadcast(originalEvent);
+ }
+ else
+ {
+ super.broadcast(event);
+ }
+
+ removeAliases();
+ }
+
+ void makeAliases(FacesContext context)
+ {
+ _context = context;
+ makeAliases();
+ }
+
+ private void makeAliases()
+ {
+ for (Iterator i = _aliases.iterator(); i.hasNext();)
+ ((Alias) i.next()).make(_context);
+ }
+
+ void removeAliases(FacesContext context)
+ {
+ _context = context;
+ removeAliases();
+ }
+
+ private void removeAliases()
+ {
+ for (Iterator i = _aliases.iterator(); i.hasNext();)
+ ((Alias) i.next()).remove(_context);
+ }
+
+ public void handleBindings()
+ {
+ makeAliases(getFacesContext());
+
+ RestoreStateUtils.recursivelyHandleComponentReferencesAndSetValid(getFacesContext(), this, true);
+
+ removeAliases(getFacesContext());
+ }
+}
Propchange: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/aliasbean/AliasBeansScope.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/aliasbean/AliasBeansScope.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/aliasbean/AliasBeansScopeTag.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/aliasbean/AliasBeansScopeTag.java?rev=662964&view=auto
==============================================================================
--- myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/aliasbean/AliasBeansScopeTag.java (added)
+++ myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/aliasbean/AliasBeansScopeTag.java Tue Jun 3 20:35:55 2008
@@ -0,0 +1,81 @@
+/*
+ * 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.
+ */
+package org.apache.myfaces.custom.aliasbean;
+
+import javax.faces.component.UIComponent;
+import javax.faces.webapp.UIComponentELTag;
+import javax.servlet.jsp.JspException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * @author Sylvain Vieujot (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+public class AliasBeansScopeTag extends UIComponentELTag
+{
+ private Log log = LogFactory.getLog(AliasBeansScopeTag.class);
+
+ public String getComponentType()
+ {
+ return AliasBeansScope.COMPONENT_TYPE;
+ }
+
+ public String getRendererType()
+ {
+ return null;
+ }
+
+
+ public int doStartTag() throws JspException
+ {
+ int retVal = super.doStartTag();
+
+ UIComponent comp = getComponentInstance();
+
+ if(comp instanceof AliasBeansScope)
+ {
+ ((AliasBeansScope) comp).makeAliases(getFacesContext());
+ }
+ else
+ {
+ log.warn("associated component is no aliasBeansScope");
+ }
+
+ return retVal;
+ }
+
+ public int doEndTag() throws JspException
+ {
+ UIComponent comp = getComponentInstance();
+
+ if(comp instanceof AliasBeansScope)
+ {
+ ((AliasBeansScope) comp).removeAliases(getFacesContext());
+ }
+ else
+ {
+ log.warn("associated component is no aliasBeansScope");
+ }
+
+ return super.doEndTag();
+ }
+
+}
\ No newline at end of file
Propchange: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/aliasbean/AliasBeansScopeTag.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/aliasbean/AliasBeansScopeTag.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/buffer/AbstractBuffer.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/buffer/AbstractBuffer.java?rev=662964&view=auto
==============================================================================
--- myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/buffer/AbstractBuffer.java (added)
+++ myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/buffer/AbstractBuffer.java Tue Jun 3 20:35:55 2008
@@ -0,0 +1,109 @@
+/*
+ * 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.
+ */
+package org.apache.myfaces.custom.buffer;
+
+import javax.el.ValueExpression;
+import javax.faces.component.UIComponentBase;
+import javax.faces.context.FacesContext;
+
+/**
+ * A component that renders its child components into an in-memory buffer rather than
+ * render them directly to the response stream.
+ * <p>
+ * Property "into" is an EL expression that specifies where to store a String holding
+ * the results of rendering all the children of this component; this is assigned to
+ * after rendering of this component (and its children) is complete.
+ * <p>
+ * Typically, an h:output tag is then used later in the same page to output the buffer
+ * contents.
+ * <p>
+ * This can be useful with JSF1.1/JSP2.0 to work around the well-known problem where
+ * on first render of a page, a component "A" cannot reference a component "B" which is
+ * defined later in the page because it has not yet been created. A solution is to define
+ * "B" before "A", but wrapped in a Buffer component. Component A can then be rendered
+ * and successfully reference "B" because it now exists. And later in the page, the buffer
+ * contents can then be output, preserving the original layout.
+ * <p>
+ * This can also be useful when rendering the same data block multiple times within a page.
+ * For example, a datatable can be rendered with a datascroller both before and after it;
+ * first render the table into a buffer B1, then render the datascroller into a buffer B2,
+ * then output buffers B2,B1,B2.
+ *
+ * @JSFComponent
+ * name = "t:buffer"
+ * class = "org.apache.myfaces.custom.buffer.Buffer"
+ * superClass = "org.apache.myfaces.custom.buffer.AbstractBuffer"
+ * tagClass = "org.apache.myfaces.custom.buffer.BufferTag"
+ *
+ * @JSFJspProperty
+ * name = "rendered"
+ * returnType = "boolean"
+ * tagExcluded = "true"
+ *
+ * @JSFJspProperty
+ * name = "binding"
+ * returnType = "java.lang.String"
+ * tagExcluded = "true"
+ *
+ * @JSFJspProperty
+ * name = "id"
+ * returnType = "java.lang.String"
+ * tagExcluded = "true"
+ *
+ * @author Sylvain Vieujot (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+public abstract class AbstractBuffer extends UIComponentBase{
+
+ public static final String COMPONENT_TYPE = "org.apache.myfaces.Buffer";
+ public static final String COMPONENT_FAMILY = "javax.faces.Data";
+ private static final String DEFAULT_RENDERER_TYPE = "org.apache.myfaces.Buffer";
+
+ protected abstract String getLocalInto();
+
+ public abstract void setInto(String into);
+
+ void fill(String content, FacesContext facesContext){
+ ValueExpression intoVB;
+
+ if (getLocalInto() == null) {
+ intoVB = getValueExpression("into");
+ setInto(intoVB.getExpressionString());
+ } else {
+ intoVB = facesContext.getApplication().
+ getExpressionFactory().createValueExpression(
+ facesContext.getELContext(), getLocalInto(), Object.class );
+ }
+
+ intoVB.setValue(facesContext.getELContext(), content);
+ }
+
+ /**
+ * An EL expression that specifies where to store a String holding
+ * the results of rendering all the children of this component;
+ * this is assigned to after rendering of this component (and its
+ * children) is complete.
+ *
+ * @JSFProperty
+ * required = "true"
+ * localMethod = "true"
+ */
+ protected abstract String getInto();
+
+}
Propchange: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/buffer/AbstractBuffer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/buffer/AbstractBuffer.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/navigation/AbstractHtmlPanelNavigation.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/navigation/AbstractHtmlPanelNavigation.java?rev=662964&view=auto
==============================================================================
--- myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/navigation/AbstractHtmlPanelNavigation.java (added)
+++ myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/navigation/AbstractHtmlPanelNavigation.java Tue Jun 3 20:35:55 2008
@@ -0,0 +1,201 @@
+/*
+ * 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.
+ */
+package org.apache.myfaces.custom.navigation;
+
+
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIViewRoot;
+import javax.faces.component.html.HtmlPanelGroup;
+import javax.faces.context.FacesContext;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.myfaces.component.AlignProperty;
+import org.apache.myfaces.component.DataProperties;
+import org.apache.myfaces.component.EventAware;
+import org.apache.myfaces.component.PanelProperties;
+import org.apache.myfaces.component.UniversalProperties;
+
+/**
+ *
+ * Renders a vertical menu structure with support for nested menu
+ * items. Unless otherwise specified, all attributes accept
+ * static values or EL expressions.
+ *
+ * Panel, that includes navigation items ({@link HtmlCommandNavigation}) and other
+ * components (separators).
+ *
+ * @JSFComponent
+ * name = "t:panelNavigation"
+ * class = "org.apache.myfaces.custom.navigation.HtmlPanelNavigation"
+ * superClass = "org.apache.myfaces.custom.navigation.AbstractHtmlPanelNavigation"
+ * tagClass = "org.apache.myfaces.custom.navigation.HtmlPanelNavigationTag"
+ *
+ * @author Manfred Geiler (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+public abstract class AbstractHtmlPanelNavigation
+ extends HtmlPanelGroup implements AlignProperty,
+ UniversalProperties, EventAware, DataProperties, PanelProperties
+{
+ private static final Log log = LogFactory.getLog(AbstractHtmlPanelNavigation.class);
+
+ public static final String COMPONENT_TYPE = "org.apache.myfaces.HtmlPanelNavigation";
+ public static final String COMPONENT_FAMILY = "javax.faces.Panel";
+ private static final String DEFAULT_RENDERER_TYPE = "org.apache.myfaces.Navigation";
+
+ private static final int DEFAULT_BORDER = Integer.MIN_VALUE;
+
+ private static final String PREVIOUS_VIEW_ROOT = AbstractHtmlPanelNavigation.class.getName() + ".PREVIOUS_VIEW_ROOT";
+ private boolean _itemOpenActiveStatesRestored = false;
+
+ public void decode(FacesContext context)
+ {
+ super.decode(context); //To change body of overridden methods use File | Settings | File Templates.
+
+ //Save the current view root for later reference...
+ context.getExternalContext().getRequestMap().put(PREVIOUS_VIEW_ROOT, context.getViewRoot());
+ //...and remember that this instance needs NO special treatment on rendering:
+ _itemOpenActiveStatesRestored = true;
+ }
+
+ public void encodeBegin(FacesContext context) throws IOException
+ {
+ if (!_itemOpenActiveStatesRestored && getChildCount() > 0)
+ {
+ UIViewRoot previousRoot = (UIViewRoot)context.getExternalContext().getRequestMap().get(PREVIOUS_VIEW_ROOT);
+ if (previousRoot != null)
+ {
+ restoreOpenActiveStates(context, previousRoot, getChildren());
+ }
+ else
+ {
+ //no previous root, means no decode was done
+ //--> a new request
+ }
+ }
+
+ super.encodeBegin(context); //To change body of overridden methods use File | Settings | File Templates.
+ }
+
+ public void restoreOpenActiveStates(FacesContext facesContext,
+ UIViewRoot previousRoot,
+ List children)
+ {
+ for (Iterator it = children.iterator(); it.hasNext(); )
+ {
+ UIComponent child = (UIComponent)it.next();
+ if (child instanceof HtmlCommandNavigation)
+ {
+ HtmlCommandNavigation previousItem = (HtmlCommandNavigation)previousRoot.findComponent(child.getClientId(facesContext));
+ if (previousItem != null)
+ {
+
+ HtmlCommandNavigation childItem = (HtmlCommandNavigation)child;
+ if(previousItem.getOpenDirectly()!=null)
+ {
+ childItem.setOpen(previousItem.isOpen());
+ }
+ else if(previousItem.getValueExpression("open")!=null)
+ {
+ childItem.setValueExpression("open",previousItem.getValueExpression("open"));
+ }
+
+ if(previousItem.getActiveDirectly()!=null)
+ {
+ childItem.setActive(previousItem.isActive());
+ }
+ else if(previousItem.getValueExpression("active")!=null)
+ {
+ childItem.setValueExpression("active",previousItem.getValueExpression("active"));
+ }
+ }
+ else
+ {
+ log.error("Navigation item " + child.getClientId(facesContext) + " not found in previous view.");
+ }
+ if (child.getChildCount() > 0)
+ {
+ restoreOpenActiveStates(facesContext, previousRoot, child.getChildren());
+ }
+ }
+ }
+ }
+
+ /**
+ * The CSS class of closed navigation items.
+ *
+ * @JSFProperty
+ */
+ public abstract String getItemClass();
+
+ /**
+ * The CSS class of open navigation items.
+ *
+ * @JSFProperty
+ */
+ public abstract String getOpenItemClass();
+
+ /**
+ * The CSS class of the active navigation item.
+ *
+ * @JSFProperty
+ */
+ public abstract String getActiveItemClass();
+
+ /**
+ * The CSS class for the td element of a separator.
+ *
+ * @JSFProperty
+ */
+ public abstract String getSeparatorClass();
+
+ /**
+ * The CSS Style of closed navigation items.
+ *
+ * @JSFProperty
+ */
+ public abstract String getItemStyle();
+
+ /**
+ * The CSS Style of open navigation items.
+ *
+ * @JSFProperty
+ */
+ public abstract String getOpenItemStyle();
+
+ /**
+ * The CSS Style of the active navigation item.
+ *
+ * @JSFProperty
+ */
+ public abstract String getActiveItemStyle();
+
+ /**
+ * The CSS Style for the td element of a separator.
+ *
+ * @JSFProperty
+ */
+ public abstract String getSeparatorStyle();
+
+}
Propchange: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/navigation/AbstractHtmlPanelNavigation.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/navigation/AbstractHtmlPanelNavigation.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/navmenu/AbstractUINavigationMenuItem.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/navmenu/AbstractUINavigationMenuItem.java?rev=662964&view=auto
==============================================================================
--- myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/navmenu/AbstractUINavigationMenuItem.java (added)
+++ myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/navmenu/AbstractUINavigationMenuItem.java Tue Jun 3 20:35:55 2008
@@ -0,0 +1,357 @@
+/*
+ * 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.
+ */
+package org.apache.myfaces.custom.navmenu;
+
+import java.util.Iterator;
+import java.util.StringTokenizer;
+
+import javax.el.MethodExpression;
+import javax.faces.component.ActionSource;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UISelectItem;
+import javax.faces.context.FacesContext;
+import javax.faces.el.EvaluationException;
+import javax.faces.el.MethodBinding;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.ActionEvent;
+import javax.faces.event.ActionListener;
+import javax.faces.event.FacesEvent;
+
+import org.apache.myfaces.component.MethodBindingToMethodExpression;
+import org.apache.myfaces.component.MethodExpressionToMethodBinding;
+import org.apache.myfaces.component.UserRoleAware;
+import org.apache.myfaces.component.UserRoleUtils;
+import org.apache.myfaces.custom.navmenu.htmlnavmenu.HtmlCommandNavigationItem;
+import org.apache.myfaces.custom.navmenu.htmlnavmenu.HtmlPanelNavigationMenu;
+
+/**
+ * A menu item. Used by navigationMenu, jscookMenu.
+ *
+ * Unless otherwise specified, all attributes accept static values or EL expressions.
+ *
+ * @JSFComponent
+ * name = "t:navigationMenuItem"
+ * bodyContent = "JSP"
+ * class = "org.apache.myfaces.custom.navmenu.UINavigationMenuItem"
+ * superClass = "org.apache.myfaces.custom.navmenu.AbstractUINavigationMenuItem"
+ * tagClass = "org.apache.myfaces.custom.navmenu.HtmlNavigationMenuItemTag"
+ *
+ * @author Thomas Spiegl (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+public abstract class AbstractUINavigationMenuItem extends UISelectItem implements
+ UserRoleAware, ActionSource {
+ private static final boolean DEFAULT_IMMEDIATE = true;
+
+ public static final String COMPONENT_TYPE = "org.apache.myfaces.NavigationMenuItem";
+ public static final String COMPONENT_FAMILY = "javax.faces.SelectItem";
+
+ public AbstractUINavigationMenuItem() {
+ super();
+ }
+
+ public String getFamily() {
+ return COMPONENT_FAMILY;
+ }
+
+ /**
+ * @JSFProperty
+ */
+ public abstract String getIcon();
+
+ /**
+ * @JSFProperty
+ * defaultValue="false"
+ */
+ public abstract boolean isSplit();
+
+ /**
+ * @JSFProperty
+ * defaultValue="false"
+ * tagExcluded = "true"
+ */
+ public abstract boolean isOpen();
+
+ public abstract void setOpen(boolean open);
+
+ public abstract void setActive(boolean active);
+
+ /**
+ * @JSFProperty
+ * defaultValue="false"
+ * tagExcluded = "true"
+ */
+ public abstract boolean isActive();
+
+ /**
+ * @JSFProperty
+ * defaultValue="true"
+ * tagExcluded="true"
+ */
+ public abstract boolean isImmediate();
+
+ /**
+ * @JSFProperty
+ * tagExcluded = "true"
+ */
+ public abstract String getExternalLink();
+
+ // Action Source
+ /**
+ * Specifies the action to take when this command is invoked.
+ *
+ * If the value is an expression, it is expected to be a method
+ * binding EL expression that identifies an action method. An action method
+ * accepts no parameters and has a String return value, called the action
+ * outcome, that identifies the next view displayed. The phase that this
+ * event is fired in can be controlled via the immediate attribute.
+ *
+ * If the value is a string literal, it is treated as a navigation outcome
+ * for the current view. This is functionally equivalent to a reference to
+ * an action method that returns the string literal.
+ *
+ * @JSFProperty
+ * stateHolder = "true"
+ * literalOnly = "true"
+ * returnSignature="java.lang.Object"
+ * jspName = "action"
+ */
+ public abstract MethodExpression getActionExpression();
+
+ /**
+ * @deprecated Use getActionExpression() instead.
+ */
+ public MethodBinding getAction()
+ {
+ MethodExpression actionExpression = getActionExpression();
+ if (actionExpression instanceof MethodBindingToMethodExpression) {
+ return ((MethodBindingToMethodExpression)actionExpression).getMethodBinding();
+ }
+ if(actionExpression != null)
+ {
+ return new MethodExpressionToMethodBinding(actionExpression);
+ }
+ return null;
+ }
+
+ public abstract void setActionExpression(MethodExpression actionExpression);
+
+ /**
+ * @deprecated Use setActionExpression instead.
+ */
+ public void setAction(MethodBinding action)
+ {
+ if(action != null)
+ {
+ setActionExpression(new MethodBindingToMethodExpression(action));
+ }
+ else
+ {
+ setActionExpression(null);
+ }
+ }
+
+
+ public abstract void setActionListener(MethodBinding actionListener);
+
+ /**
+ * A method binding EL expression that identifies an action listener method
+ * to be invoked if this component is activated by the user. An action
+ * listener method accepts a parameter of type javax.faces.event.ActionEvent
+ * and returns void. The phase that this event is fired in can be controlled
+ * via the immediate attribute.
+ *
+ * @JSFProperty
+ * stateHolder = "true"
+ * literalOnly = "true"
+ * returnSignature="void"
+ * methodSignature="javax.faces.event.ActionEvent"
+ */
+ public abstract MethodBinding getActionListener();
+
+ public void addActionListener(ActionListener listener) {
+ addFacesListener(listener);
+ }
+
+ public ActionListener[] getActionListeners() {
+ return (ActionListener[]) getFacesListeners(ActionListener.class);
+ }
+
+ public void removeActionListener(ActionListener listener) {
+ removeFacesListener(listener);
+ }
+
+ // Action Source
+
+ /**
+ *
+ * @JSFProperty
+ */
+ public abstract String getTarget();
+
+ /**
+ * When set instead of a Hyperlink a span tag is rendered in
+ * the corresponding Component
+ *
+ * @JSFProperty
+ * defaultValue="false"
+ */
+ public abstract boolean isDisabled();
+
+ /**
+ * CSS-Style Attribute to render when disabled is true
+ *
+ * @JSFProperty
+ */
+ public abstract String getDisabledStyle();
+
+ /**
+ * @see javax.faces.component.UIComponent#broadcast(javax.faces.event.FacesEvent)
+ */
+ public void broadcast(FacesEvent event) throws AbortProcessingException {
+ super.broadcast(event);
+
+ if (event instanceof ActionEvent) {
+ FacesContext context = getFacesContext();
+
+ MethodBinding actionListenerBinding = getActionListener();
+ if (actionListenerBinding != null) {
+ try {
+ actionListenerBinding.invoke(context,
+ new Object[]{event});
+ }
+ catch (EvaluationException e) {
+ Throwable cause = e.getCause();
+ if (cause != null
+ && cause instanceof AbortProcessingException) {
+ throw (AbortProcessingException) cause;
+ }
+ else {
+ throw e;
+ }
+ }
+ }
+
+ ActionListener defaultActionListener = context.getApplication()
+ .getActionListener();
+ if (defaultActionListener != null) {
+ defaultActionListener.processAction((ActionEvent) event);
+ }
+ }
+ }
+
+ /**
+ * CSS-Style Class to use when disabled is true
+ *
+ * @JSFProperty
+ */
+ public abstract String getDisabledStyleClass();
+
+ /**
+ * @JSFProperty
+ * localMethod="true"
+ * tagExcluded = "true"
+ */
+ public abstract String getActiveOnViewIds();
+
+ protected abstract String getLocalActiveOnViewIds();
+
+ public String getActiveOnViewIdsDirectly() {
+ return getLocalActiveOnViewIds();
+ }
+
+ public boolean isRendered() {
+ if (!UserRoleUtils.isVisibleOnUserRole(this))
+ return false;
+ return super.isRendered();
+ }
+
+ public void toggleActive(FacesContext context) {
+ StringTokenizer tokenizer = new StringTokenizer(this.getActiveOnViewIdsDirectly(), ";");
+ while (tokenizer.hasMoreTokens()) {
+ String token = tokenizer.nextToken();
+ if (token.trim().equals(context.getViewRoot().getViewId())) {
+ this.deactivateAll();
+ this.setActive(true);
+ openParents();
+ }
+ else {
+ this.setActive(false);
+ }
+ }
+ }
+
+ private void openParents() {
+ UIComponent comp = this;
+
+ while ((comp = comp.getParent()) instanceof AbstractUINavigationMenuItem) {
+ AbstractUINavigationMenuItem parent = (AbstractUINavigationMenuItem) comp;
+ if (!parent.isOpen())
+ parent.setOpen(true);
+ else
+ return;
+ }
+ }
+
+ public void deactivateAll() {
+ UIComponent parent = this.getParent();
+ while (!(parent instanceof HtmlPanelNavigationMenu) && parent != null) {
+ parent = parent.getParent();
+ }
+ if (parent == null) {
+ throw new IllegalStateException("no PanelNavigationMenu!");
+ }
+
+ HtmlPanelNavigationMenu root = (HtmlPanelNavigationMenu) parent;
+ for (Iterator it = root.getChildren().iterator(); it.hasNext();) {
+ Object o = it.next();
+ if (o instanceof AbstractUINavigationMenuItem) {
+ AbstractUINavigationMenuItem navItem = (AbstractUINavigationMenuItem) o;
+ navItem.setActive(false);
+ if (navItem.getChildCount() > 0) {
+ navItem.deactivateChildren();
+ }
+ }
+ if (o instanceof HtmlCommandNavigationItem) {
+ HtmlCommandNavigationItem current = (HtmlCommandNavigationItem) o;
+ current.setActive(false);
+ if (current.getChildCount() > 0) {
+ current.deactivateChildren();
+ }
+ }
+ }
+ }
+
+ public void deactivateChildren() {
+ for (Iterator it = this.getChildren().iterator(); it.hasNext();) {
+ Object o = it.next();
+ if (o instanceof AbstractUINavigationMenuItem) {
+ AbstractUINavigationMenuItem current = (AbstractUINavigationMenuItem) o;
+ current.setActive(false);
+ if (current.getChildCount() > 0) {
+ current.deactivateChildren();
+ }
+ }
+ }
+ }
+
+ public Boolean getActiveDirectly() {
+ return Boolean.valueOf(isActive());
+ }
+}
Propchange: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/navmenu/AbstractUINavigationMenuItem.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/navmenu/AbstractUINavigationMenuItem.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/regexprvalidator/RegExprValidator.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/regexprvalidator/RegExprValidator.java?rev=662964&view=auto
==============================================================================
--- myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/regexprvalidator/RegExprValidator.java (added)
+++ myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/regexprvalidator/RegExprValidator.java Tue Jun 3 20:35:55 2008
@@ -0,0 +1,125 @@
+/*
+ * 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.
+ */
+package org.apache.myfaces.custom.regexprvalidator;
+
+import javax.el.ValueExpression;
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.validator.ValidatorException;
+
+import org.apache.commons.validator.GenericValidator;
+import org.apache.myfaces.shared_tomahawk.util._ComponentUtils;
+import org.apache.myfaces.validator.ValidatorBase;
+
+/**
+ * A custom validator for reg. expr., based upons Jakarta Commons.
+ *
+ * Unless otherwise specified, all attributes accept static values or EL expressions.
+ *
+ * @JSFValidator
+ * name = "t:validateRegExpr"
+ * tagClass = "org.apache.myfaces.custom.regexprvalidator.ValidateRegExprTag"
+ * tagSuperclass = "org.apache.myfaces.validator.ValidatorBaseTag"
+ * serialuidtag = "-449945949876262076L"
+ *
+ * @JSFJspProperty name = "message" inheritedTag="true" returnType = "java.lang.String" longDesc = "alternate validation error detail message format string (use 'message' and 'detailMessage' alternatively)"
+ * @JSFJspProperty name = "detailMessage" inheritedTag="true" returnType = "java.lang.String" longDesc = "alternate validation error detail message format string (use 'message' and 'detailMessage' alternatively)"
+ * @JSFJspProperty name = "summaryMessage" inheritedTag="true" returnType = "java.lang.String" longDesc = "alternate validation error summary message format string"
+ * @author mwessendorf (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+
+public class RegExprValidator extends ValidatorBase {
+ /**
+ * <p>The standard converter id for this converter.</p>
+ */
+ public static final String VALIDATOR_ID = "org.apache.myfaces.validator.RegExpr";
+
+ /**
+ * <p>The message identifier of the {@link FacesMessage} to be created if
+ * the regex check fails.</p>
+ */
+ public static final String REGEXPR_MESSAGE_ID = "org.apache.myfaces.Regexpr.INVALID";
+
+ public RegExprValidator(){
+ }
+
+ //the pattern on which the validation is based.
+ protected String _pattern= null;
+
+ public void validate(
+ FacesContext facesContext,
+ UIComponent uiComponent,
+ Object value)
+ throws ValidatorException {
+
+ if (facesContext == null) throw new NullPointerException("facesContext");
+ if (uiComponent == null) throw new NullPointerException("uiComponent");
+
+ if (value == null)
+ {
+ return;
+ }
+ Object[] args = {value.toString()};
+ if(!GenericValidator.matchRegexp(value.toString(),"^"+getPattern()+"$")){
+ throw new ValidatorException(getFacesMessage(REGEXPR_MESSAGE_ID, args));
+ }
+ }
+
+
+
+ // -------------------------------------------------------- StateholderIF
+
+ public Object saveState(FacesContext context) {
+ Object values[] = new Object[2];
+ values[0] = super.saveState(context);
+ values[1] = _pattern;
+ return values;
+ }
+
+ public void restoreState(FacesContext context, Object state) {
+ Object[] values = (Object[]) state;
+ super.restoreState(context, values[0]);
+ _pattern = (String) values[1];
+ }
+
+ // -------------------------------------------------------- GETTER & SETTER
+
+ /**
+ * the pattern, which is the base of the validation
+ *
+ * @JSFProperty
+ * @return the pattern, on which a value should be validated
+ */
+ public String getPattern()
+ {
+ if (_pattern != null) return _pattern;
+ ValueExpression vb = getValueExpression("pattern");
+ return vb != null ? getStringValue(getFacesContext(), vb) : null;
+ }
+
+ /**
+ * @param string the pattern, on which a value should be validated
+ */
+ public void setPattern(String string) {
+ _pattern = string;
+ }
+
+}
Propchange: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/regexprvalidator/RegExprValidator.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/regexprvalidator/RegExprValidator.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/savestate/UISaveState.java
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/savestate/UISaveState.java?rev=662964&view=auto
==============================================================================
--- myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/savestate/UISaveState.java (added)
+++ myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/savestate/UISaveState.java Tue Jun 3 20:35:55 2008
@@ -0,0 +1,128 @@
+/*
+ * 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.
+*/
+package org.apache.myfaces.custom.savestate;
+
+import javax.el.ValueExpression;
+import javax.faces.component.StateHolder;
+import javax.faces.component.UIParameter;
+import javax.faces.context.FacesContext;
+
+/**
+ * Provides the ability to store a model value inside the view's component tree.
+ * <p>
+ * JSF provides three scopes for managed beans and therefore all the model
+ * objects that the managed beans reference: request, session, application.
+ * However a common requirement is a way for a model object to have a scope
+ * that is tied to the duration of the current view; that is longer than the
+ * request scope but shorter than session scope.
+ * <p>
+ * This component simply holds a reference to an arbitrary object (specified
+ * by the value property). Because this object is an ordinary component whose
+ * scope is the current view, the reference to the model automatically has that
+ * same scope.
+ * <p>
+ * When the value is an EL expression, then after the view is restored the
+ * recreated target object is stored at the specified location.
+ * <p>
+ * The object being saved must either:
+ * <ul>
+ * <li>implement java.io.Serializable, or
+ * <li>implement javax.faces.component.StateHolder and have a default
+ * constructor.
+ * </ul>
+ * <p>
+ * Note that the saved object can be "chained" from view to view
+ * in order to extend its lifetime from a single view to a sequence
+ * of views if desired. A UISaveState component with an EL expression
+ * such as "#{someBean}" will save the object state after render, and
+ * restore it on postback. If navigation occurs to some other view
+ * and that view has a UISaveState component with the same EL expression
+ * then the object will simply be saved into the new view, thus extending
+ * its lifetime.
+ * <p>
+ *
+ * @JSFComponent
+ * name = "t:saveState"
+ * tagClass = "org.apache.myfaces.custom.savestate.SaveStateTag"
+ * @JSFJspProperty name = "name" returnType = "java.lang.String" tagExcluded = "true"
+ * @author Manfred Geiler (latest modification by $Author$)
+ * @version $Revision$ $Date$
+ */
+public class UISaveState extends UIParameter
+{
+
+ static public final String COMPONENT_FAMILY =
+ "javax.faces.Parameter";
+ static public final String COMPONENT_TYPE =
+ "org.apache.myfaces.SaveState";
+
+ /**
+ * Construct an instance of the UISaveState.
+ */
+ public UISaveState()
+ {
+ setRendererType(null);
+ }
+
+ public Object saveState(FacesContext context)
+ {
+ Object values[] = new Object[3];
+ values[0] = super.saveState(context);
+ Object objectToSave = getValue();
+ if (objectToSave instanceof StateHolder)
+ {
+ values[1] = Boolean.TRUE;
+ values[2] = saveAttachedState(context, objectToSave);
+ }
+ else
+ {
+ values[1] = Boolean.FALSE;
+ values[2] = objectToSave;
+ }
+ return values;
+ }
+
+ public void restoreState(FacesContext context, Object state)
+ {
+ Object values[] = (Object[])state;
+ super.restoreState(context, values[0]);
+
+ Object savedObject;
+ Boolean storedObjectIsAStateHolder = (Boolean) values[1];
+ if ( Boolean.TRUE.equals( storedObjectIsAStateHolder ) )
+ {
+ savedObject = restoreAttachedState(context,values[2]);
+ }
+ else
+ {
+ savedObject = values[2];
+ }
+ ValueExpression vb = getValueExpression("value");
+ if (vb != null)
+ {
+ vb.setValue(context.getELContext(), savedObject);
+ }
+ }
+
+ @Override
+ public String getFamily()
+ {
+ return COMPONENT_FAMILY;
+ }
+}
Propchange: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/core12/src/main/java/org/apache/myfaces/custom/savestate/UISaveState.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Modified: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/examples/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/examples/pom.xml?rev=662964&r1=662963&r2=662964&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/examples/pom.xml (original)
+++ myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/examples/pom.xml Tue Jun 3 20:35:55 2008
@@ -69,6 +69,7 @@
<activation>
<property>
<name>tomahawk</name>
+ <value>11</value>
</property>
</activation>
<dependencies>
@@ -80,6 +81,23 @@
</dependencies>
</profile>
+ <profile>
+ <id>tomahawk-current12</id>
+ <activation>
+ <property>
+ <name>tomahawk</name>
+ <value>12</value>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.myfaces.tomahawk</groupId>
+ <artifactId>tomahawk12</artifactId>
+ <version>${version}</version>
+ </dependency>
+ </dependencies>
+ </profile>
+
<!-- To use the examples using MyFaces 1.2: -Djsf=12 -->
<profile>
@@ -94,12 +112,12 @@
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-api</artifactId>
- <version>1.2.2</version>
+ <version>1.2.4-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-impl</artifactId>
- <version>1.2.2</version>
+ <version>1.2.4-SNAPSHOT</version>
<scope>runtime</scope>
</dependency>
<dependency>
Propchange: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/sandbox/core12/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Jun 3 20:35:55 2008
@@ -0,0 +1,10 @@
+target
+.classpath
+.project
+.wtpmodules
+*.ipr
+*.iml
+*.iws
+.settings
+maven-eclipse.xml
+.externalToolsBuilder
Added: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/sandbox/core12/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/sandbox/core12/pom.xml?rev=662964&view=auto
==============================================================================
--- myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/sandbox/core12/pom.xml (added)
+++ myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/sandbox/core12/pom.xml Tue Jun 3 20:35:55 2008
@@ -0,0 +1,540 @@
+<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">
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>tomahawk-sandbox12</artifactId>
+ <packaging>jar</packaging>
+ <name>Sandbox Core 12</name>
+ <url>http://myfaces.apache.org/sandbox</url>
+ <description>
+ This is the Sandbox Subproject Description [INSERT MORE STUFF HERE]
+ </description>
+
+ <parent>
+ <groupId>org.apache.myfaces.tomahawk</groupId>
+ <artifactId>sandbox-project</artifactId>
+ <version>1.1.7-SNAPSHOT</version>
+ </parent>
+
+ <scm>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/myfaces/tomahawk/trunk/sandbox/core</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/myfaces/tomahawk/trunk/sandbox/core</developerConnection>
+ <url>http://svn.apache.org/viewcvs.cgi/myfaces/tomahawk/trunk/sandbox/core</url>
+ </scm>
+
+ <repositories>
+ <repository>
+ <id>java-net</id>
+ <url>http://download.java.net/maven/1</url>
+ <layout>legacy</layout>
+ </repository>
+ </repositories>
+
+ <dependencies>
+
+ <!-- compile -->
+
+ <dependency>
+ <groupId>org.apache.myfaces.tomahawk</groupId>
+ <artifactId>tomahawk12</artifactId>
+ <version>${version}</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring</artifactId>
+ <version>2.0.1</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1.1</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-validator</groupId>
+ <artifactId>commons-validator</artifactId>
+ <version>1.2.0</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ <version>3.1</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-el</groupId>
+ <artifactId>commons-el</artifactId>
+ <version>1.0</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ <version>1.3</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>portlet-api</groupId>
+ <artifactId>portlet-api</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>poi</groupId>
+ <artifactId>poi</artifactId>
+ <version>2.5.1-final-20040804</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <!-- provided dependencies -->
+
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-api</artifactId>
+ <version>1.2.4-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet.jsp</groupId>
+ <artifactId>jsp-api</artifactId>
+ <version>2.1</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.freemarker</groupId>
+ <artifactId>freemarker</artifactId>
+ <version>2.3.10</version>
+ <scope>compile</scope>
+ </dependency>
+
+ <!-- test dependencies -->
+
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-impl</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>maven-taglib</groupId>
+ <artifactId>maven-taglib-plugin</artifactId>
+ <version>1.4.2</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.shale</groupId>
+ <artifactId>shale-test</artifactId>
+ <version>1.0.4</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.myfaces</groupId>
+ <artifactId>myfaces-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.myfaces</groupId>
+ <artifactId>myfaces-impl</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>myfaces</groupId>
+ <artifactId>myfaces-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>myfaces</groupId>
+ <artifactId>myfaces-impl</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <excludes>
+ <exclude>**/*.vm</exclude>
+ </excludes>
+ </resource>
+ <!--
+ <resource>
+ <directory>src/main/resources-facesconfig</directory>
+ </resource>
+ -->
+ <resource>
+ <directory>target/tomahawk11_resources</directory>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>add-source</id>
+ <phase>generate-sources</phase>
+ <!-- <phase>process-sources</phase> -->
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>
+ ${project.build.directory}/tomahawk11_sources
+ </source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.myfaces.buildtools</groupId>
+ <artifactId>myfaces-builder-plugin</artifactId>
+ <version>1.0.1-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <id>unpack-tomahawk</id>
+ <phase>generate-sources</phase>
+ <!-- <phase>process-resources</phase> -->
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <scanModel>true</scanModel>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.apache.myfaces.tomahawk</groupId>
+ <artifactId>tomahawk-sandbox</artifactId>
+ <version>1.1.7-SNAPSHOT</version>
+ <classifier>sources</classifier>
+ <!-- <outputDirectory>${project.build.directory}/unpacktomahawksources</outputDirectory> -->
+ <outputDirectory>${project.build.directory}/tomahawk11_sources</outputDirectory>
+ <includes>**/*.java</includes>
+ <!-- Conversation tags will not work on 1.2 by architectural problems,
+ use orchestra instead
+ org/apache/myfaces/custom/conversation/*.java -->
+ <excludes>
+ **/*.class,**/META-INF/**,
+ org/apache/myfaces/shared_tomahawk/**/*.java
+ </excludes>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ <execution>
+ <id>unpack-tomahawk-resources</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <baseDirectory1>${basedir}/src/main/resources</baseDirectory1>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.apache.myfaces.tomahawk</groupId>
+ <artifactId>tomahawk-sandbox</artifactId>
+ <version>1.1.7-SNAPSHOT</version>
+ <outputDirectory>${project.build.directory}/tomahawk11_resources</outputDirectory>
+ <excludes>**/*.class,**/META-INF/**</excludes>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ <execution>
+ <!-- A hierarchy of different tag classes must be created,
+ because this classes are not part of the public api. The
+ generation of all html package is the same. Please note that
+ we need only a subset -->
+ <configuration>
+ <replacePackagePrefixTagFrom>org.apache.myfaces.taglib</replacePackagePrefixTagFrom>
+ <replacePackagePrefixTagTo>org.apache.myfaces.shared_tomahawk.taglib</replacePackagePrefixTagTo>
+ </configuration>
+ <goals>
+ <goal>build-metadata</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>makefacesconfig</id>
+ <configuration>
+ <templateFile>faces-config12.vm</templateFile>
+ <xmlFile>META-INF/faces-config.xml</xmlFile>
+ </configuration>
+ <goals>
+ <goal>make-config</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>makecomp</id>
+ <goals>
+ <goal>make-components</goal>
+ </goals>
+ <configuration>
+ <jsfVersion>12</jsfVersion>
+ <templateComponentName>componentClass12.vm</templateComponentName>
+ <mainSourceDirectory2>${project.build.directory}/tomahawk11_sources</mainSourceDirectory2>
+ </configuration>
+ </execution>
+ <execution>
+ <id>maketags</id>
+ <configuration>
+ <jsfVersion>12</jsfVersion>
+ <templateTagName>tagClass12.vm</templateTagName>
+ <mainSourceDirectory2>${project.build.directory}/tomahawk11_sources</mainSourceDirectory2>
+ </configuration>
+ <goals>
+ <goal>make-tags</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>make_validator_tags_tomahawk</id>
+ <configuration>
+ <jsfVersion>12</jsfVersion>
+ </configuration>
+ <goals>
+ <goal>make-validator-tags</goal>
+ <goal>make-converter-tags</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>makesandboxtld</id>
+ <configuration>
+ <xmlFile>META-INF/myfaces_sandbox.tld</xmlFile>
+ <xmlBaseFile>src/main/conf/META-INF/myfaces_sandbox-base.tld</xmlBaseFile>
+ <templateFile>tomahawk12.vm</templateFile>
+ <params>
+ <shortname>s</shortname>
+ <uri>http://myfaces.apache.org/sandbox</uri>
+ <displayname>Tomahawk sandbox tag library.</displayname>
+ <description>Enhanced standard JSP actions and custom MyFaces actions.</description>
+ </params>
+ <modelIds>
+ <modelId>tomahawk-sandbox12</modelId>
+ </modelIds>
+ </configuration>
+ <goals>
+ <goal>make-config</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <!--
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>xslt-maven-plugin</artifactId>
+ <version>1.0</version>
+ <configuration>
+ <xslFile>src/main/tld/misc/resolve_entities.xsl</xslFile>
+ <srcIncludes>**/*.tld</srcIncludes>
+ <srcDir>src/main/tld</srcDir>
+ <destDir>target/classes/META-INF</destDir>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>transform</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ -->
+
+ </plugins>
+ </build>
+
+ <reporting>
+ <plugins>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>changelog-maven-plugin</artifactId>
+ <version>2.0-beta-1</version>
+ <reportSets>
+ <reportSet>
+ <id>dual-report</id>
+ <configuration>
+ <type>range</type>
+ <range>30</range>
+ </configuration>
+ <reports>
+ <report>changelog</report>
+ <report>file-activity</report>
+ <report>dev-activity</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.4</version>
+ <configuration>
+ <sourcepath>${basedir}/src/main/java;${basedir}/target/tomahawk11_sources;${basedir}/target/maven-faces-plugin/main/java</sourcepath>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-jxr-plugin</artifactId>
+ <version>2.1</version>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>taglist-maven-plugin</artifactId>
+ <version>2.0</version>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ <version>2.4</version>
+ </plugin>
+
+ </plugins>
+ </reporting>
+
+ <profiles>
+ <profile>
+ <id>generate-site</id>
+ <build>
+ <plugins>
+ <!--
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>xslt-maven-plugin</artifactId>
+ <version>1.0</version>
+ <executions>
+ <execution>
+ <id>generate-tld-for-tlddoc</id>
+ <goals>
+ <goal>transform</goal>
+ </goals>
+ <configuration>
+ <xslFile>src/main/tld/misc/resolve_entities-tlddoc.xsl</xslFile>
+ <srcIncludes>**/*.tld</srcIncludes>
+ <srcDir>src/main/tld</srcDir>
+ <destDir>target/tlddoc-site</destDir>
+ </configuration>
+ </execution>
+ <execution>
+ <id>generate-tld-for-jar</id>
+ <goals>
+ <goal>transform</goal>
+ </goals>
+ <configuration>
+ <xslFile>src/main/tld/misc/resolve_entities.xsl</xslFile>
+ <srcIncludes>**/*.tld</srcIncludes>
+ <srcDir>src/main/tld</srcDir>
+ <destDir>target/classes/META-INF</destDir>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ -->
+ </plugins>
+
+ </build>
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>net.sourceforge.maven-taglib</groupId>
+ <artifactId>maven-taglib-plugin</artifactId>
+ <configuration>
+ <taglib.src.dir>${basedir}/target/classes/META-INF</taglib.src.dir>
+ <tldDocDir>${basedir}/target/site/tlddoc</tldDocDir>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+ </profile>
+ <profile>
+ <id>generate-assembly</id>
+ <activation>
+ <property>
+ <name>performRelease</name>
+ <value>true</value>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <!--
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>xslt-maven-plugin</artifactId>
+ <version>1.0</version>
+ <executions>
+ <execution>
+ <id>generate-tld-for-tlddoc</id>
+ <goals>
+ <goal>transform</goal>
+ </goals>
+ <configuration>
+ <xslFile>src/main/tld/misc/resolve_entities-tlddoc.xsl</xslFile>
+ <srcIncludes>**/*.tld</srcIncludes>
+ <srcDir>src/main/tld</srcDir>
+ <destDir>target/tlddoc-site</destDir>
+ </configuration>
+ </execution>
+ <execution>
+ <id>generate-tld-for-jar</id>
+ <goals>
+ <goal>transform</goal>
+ </goals>
+ <configuration>
+ <xslFile>src/main/tld/misc/resolve_entities.xsl</xslFile>
+ <srcIncludes>**/*.tld</srcIncludes>
+ <srcDir>src/main/tld</srcDir>
+ <destDir>target/classes/META-INF</destDir>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ -->
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.4</version>
+ <executions>
+ <execution>
+ <id>attach-javadoc</id>
+ <goals><goal>jar</goal></goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>net.sourceforge.maven-taglib</groupId>
+ <artifactId>maven-taglib-plugin</artifactId>
+ <configuration>
+ <taglib.src.dir>${basedir}/target/classes/META-INF</taglib.src.dir>
+ <tldDocDir>${basedir}/target/tlddoc</tldDocDir>
+ </configuration>
+ <executions>
+ <execution>
+ <id>attach-javadoc</id>
+ <goals><goal>taglibdocjar</goal></goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
Propchange: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/sandbox/core12/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/sandbox/core12/pom.xml
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Modified: myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/sandbox/examples/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/sandbox/examples/pom.xml?rev=662964&r1=662963&r2=662964&view=diff
==============================================================================
--- myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/sandbox/examples/pom.xml (original)
+++ myfaces/myfaces-build-tools/branches/builder_plugin/bigtest/tomahawk12_trunk/sandbox/examples/pom.xml Tue Jun 3 20:35:55 2008
@@ -99,13 +99,13 @@
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-api</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.2.4-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-impl</artifactId>
- <version>1.2.0-SNAPSHOT</version>
+ <version>1.2.4-SNAPSHOT</version>
<!-- Tomahawk examples must only have runtime dependency to myfaces-impl
so that it will be automatically added to war. But there must not be
any compile dependency on impl so that is is always possible to use
@@ -272,15 +272,51 @@
</build>
</profile>
+ <profile>
+ <id>tomahawk-current</id>
+ <activation>
+ <property>
+ <name>!tomahawk</name>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.myfaces.tomahawk</groupId>
+ <artifactId>tomahawk-sandbox</artifactId>
+ <version>${version}</version>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <id>tomahawk-current12</id>
+ <activation>
+ <property>
+ <name>tomahawk</name>
+ <value>12</value>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.myfaces.tomahawk</groupId>
+ <artifactId>tomahawk-sandbox12</artifactId>
+ <version>${version}</version>
+ </dependency>
+ <dependency>
+ <groupId>batik</groupId>
+ <artifactId>batik-awt-util</artifactId>
+ <version>1.6-1</version>
+ </dependency>
+ <dependency>
+ <groupId>com.lowagie</groupId>
+ <artifactId>itext</artifactId>
+ <version>1.4.8</version>
+ </dependency>
+ </dependencies>
+ </profile>
</profiles>
<dependencies>
<dependency>
- <groupId>org.apache.myfaces.tomahawk</groupId>
- <artifactId>tomahawk-sandbox</artifactId>
- <version>${version}</version>
- </dependency>
- <dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.0.4</version>