You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2013/02/22 15:22:38 UTC
svn commit: r1449056 [1/3] - in /myfaces/tobago/trunk: tobago-assembly/
tobago-core/src/main/faces-config/
tobago-core/src/main/java/org/apache/myfaces/tobago/event/
tobago-core/src/main/java/org/apache/myfaces/tobago/internal/ajax/
tobago-core/src/mai...
Author: lofwyr
Date: Fri Feb 22 14:22:36 2013
New Revision: 1449056
URL: http://svn.apache.org/r1449056
Log:
TOBAGO-1229: Using Facelets 2.0 from JSF 2.0 instead of Facelets 1.1 from Sun
Added:
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/ValueExpressionSheetStateChangeListener.java
- copied, changed from r1445648, myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/ValueExpressionTabChangeListener.java
myfaces/tobago/trunk/tobago-core/src/main/resources/META-INF/services/xxx.javax.faces.lifecycle.LifecycleFactory
- copied unchanged from r1446472, myfaces/tobago/trunk/tobago-core/src/main/resources/META-INF/services/javax.faces.lifecycle.LifecycleFactory
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/DefaultResourceResolver.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/Resource.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/TagMethodExpression.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/resources/META-INF/tobago.faces-config.xml
Removed:
myfaces/tobago/trunk/tobago-core/src/main/resources/META-INF/services/javax.faces.lifecycle.LifecycleFactory
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/AbstractTobagoTagLibrary.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/TobagoTagLibrary.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/TobagoExtensionTagLibrary.java
myfaces/tobago/trunk/tobago-extension/tobago-sandbox/src/main/java/org/apache/myfaces/tobago/facelets/TobagoSandboxTagLibrary.java
Modified:
myfaces/tobago/trunk/tobago-assembly/pom.xml
myfaces/tobago/trunk/tobago-core/src/main/faces-config/faces-config.xml
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/ajax/AjaxResponseRenderer.java
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/application/ViewHandlerImpl.java
myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/WEB-INF/faces-config.xml
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/WEB-INF/web.xml
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook/src/main/webapp/WEB-INF/faces-config.xml
myfaces/tobago/trunk/tobago-example/tobago-example-addressbook/src/main/webapp/WEB-INF/web.xml
myfaces/tobago/trunk/tobago-example/tobago-example-demo/pom.xml
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/resources/log4j.xml
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/faces-config.xml
myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml
myfaces/tobago/trunk/tobago-example/tobago-example-sandbox/src/main/webapp/WEB-INF/faces-config.xml
myfaces/tobago/trunk/tobago-example/tobago-example-test/pom.xml
myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/resources/META-INF/tobago-example-test.taglib.xml
myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/faces-config.xml
myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/web.xml
myfaces/tobago/trunk/tobago-extension/tobago-facelets/pom.xml
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/AttributeHandler.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/ContentTypeRule.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/ConverterHandler.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/DataAttributeHandler.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/DeprecatedDimensionRule.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/FlowLayoutRule.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/GridLayoutConstraintHandler.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/GridLayoutRule.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/LoadBundleHandler.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/MetaInfResourcesClasspathResourceResolver.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/PopupReferenceHandler.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/PositionRule.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/ResetInputActionListenerHandler.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/ScriptHandler.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/SheetStateChangeSourceRule.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/SortActionSourceRule.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/StyleHandler.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/SuggestMethodRule.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/SupportsMarkupRule.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/SupportsRenderedPartiallyRule.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/TabChangeListenerHandler.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/TabChangeSourceRule.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/TobagoComponentHandler.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/TobagoValidateHandler.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/WizardComponentHandler.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/DateExtensionHandler.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/FileExtensionHandler.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/InExtensionHandler.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/MenuCheckboxExtensionHandler.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/MenuRadioExtensionHandler.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/SelectBooleanCheckboxExtensionHandler.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/SelectManyCheckboxExtensionHandler.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/SelectManyListboxExtensionHandler.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/SelectManyShuttleExtensionHandler.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/SelectOneChoiceExtensionHandler.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/SelectOneListboxExtensionHandler.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/SelectOneRadioExtensionHandler.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/SeparatorExtensionHandler.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/TextareaExtensionHandler.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/TimeExtensionHandler.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/TobagoLabelExtensionHandler.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/extension/TobagoMenuExtensionHandler.java
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/resources/META-INF/tobago-extension.taglib.xml
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/resources/META-INF/tobago-facelet-extension.taglib.xml
myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/resources/META-INF/tobago.taglib.xml
myfaces/tobago/trunk/tobago-extension/tobago-sandbox/pom.xml
myfaces/tobago/trunk/tobago-extension/tobago-sandbox/src/main/resources/META-INF/tobago-facelet-sandbox.taglib.xml
myfaces/tobago/trunk/tobago-extension/tobago-sandbox/src/main/resources/META-INF/tobago-sandbox.taglib.xml
Modified: myfaces/tobago/trunk/tobago-assembly/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-assembly/pom.xml?rev=1449056&r1=1449055&r2=1449056&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-assembly/pom.xml (original)
+++ myfaces/tobago/trunk/tobago-assembly/pom.xml Fri Feb 22 14:22:36 2013
@@ -92,12 +92,6 @@
<groupId>${project.groupId}</groupId>
<artifactId>tobago-facelets</artifactId>
<version>${project.version}</version>
- <exclusions>
- <exclusion>
- <groupId>com.sun.facelets</groupId>
- <artifactId>jsf-facelets</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
Modified: myfaces/tobago/trunk/tobago-core/src/main/faces-config/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/faces-config/faces-config.xml?rev=1449056&r1=1449055&r2=1449056&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/faces-config/faces-config.xml (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/faces-config/faces-config.xml Fri Feb 22 14:22:36 2013
@@ -20,7 +20,6 @@
<faces-config>
<application>
<default-render-kit-id>tobago</default-render-kit-id>
- <view-handler>org.apache.myfaces.tobago.internal.application.ViewHandlerImpl</view-handler>
</application>
<component>
<component-type>javax.faces.NamingContainer</component-type>
Copied: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/ValueExpressionSheetStateChangeListener.java (from r1445648, myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/ValueExpressionTabChangeListener.java)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/ValueExpressionSheetStateChangeListener.java?p2=myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/ValueExpressionSheetStateChangeListener.java&p1=myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/ValueExpressionTabChangeListener.java&r1=1445648&r2=1449056&rev=1449056&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/ValueExpressionTabChangeListener.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/event/ValueExpressionSheetStateChangeListener.java Fri Feb 22 14:22:36 2013
@@ -27,27 +27,27 @@ import javax.faces.component.StateHolder
import javax.faces.component.UIComponentBase;
import javax.faces.context.FacesContext;
-public class ValueExpressionTabChangeListener implements TabChangeListener, StateHolder {
+public class ValueExpressionSheetStateChangeListener implements SheetStateChangeListener, StateHolder {
- private static final Logger LOG = LoggerFactory.getLogger(ValueExpressionTabChangeListener.class);
+ private static final Logger LOG = LoggerFactory.getLogger(ValueExpressionSheetStateChangeListener.class);
private String type;
private ValueExpression valueExpression;
- public ValueExpressionTabChangeListener() {
+ public ValueExpressionSheetStateChangeListener() {
}
- public ValueExpressionTabChangeListener(String type, ValueExpression valueExpression) {
+ public ValueExpressionSheetStateChangeListener(String type, ValueExpression valueExpression) {
this.type = type;
this.valueExpression = valueExpression;
}
- public void processTabChange(TabChangeEvent tabChangeEvent) {
- TabChangeListener handler = getTabChangeListener();
+ public void processSheetStateChange(SheetStateChangeEvent sheetStateChangeEvent) {
+ SheetStateChangeListener handler = getSheetStateChangeListener();
if (handler != null) {
- handler.processTabChange(tabChangeEvent);
+ handler.processSheetStateChange(sheetStateChangeEvent);
} else {
- LOG.error("Ignoring TabChangeEvent. No TabChangeListener found.");
+ LOG.error("Ignoring SheetStateChangeEvent. No SheetStateChangeListener found.");
}
}
@@ -73,16 +73,16 @@ public class ValueExpressionTabChangeLis
// ignore
}
- private TabChangeListener getTabChangeListener() {
- TabChangeListener handler = null;
+ private SheetStateChangeListener getSheetStateChangeListener() {
+ SheetStateChangeListener handler = null;
if (valueExpression != null) {
Object obj = valueExpression.getValue(FacesContext.getCurrentInstance().getELContext());
- if (obj != null && obj instanceof TabChangeListener) {
- handler = (TabChangeListener) obj;
+ if (obj != null && obj instanceof SheetStateChangeListener) {
+ handler = (SheetStateChangeListener) obj;
}
}
if (handler == null && type != null) {
- handler = createTabChangeListener(type);
+ handler = createSheetStateChangeListener(type);
if (handler != null && valueExpression != null) {
valueExpression.setValue(FacesContext.getCurrentInstance().getELContext(), handler);
}
@@ -90,10 +90,10 @@ public class ValueExpressionTabChangeLis
return handler;
}
- private TabChangeListener createTabChangeListener(String className) {
+ private SheetStateChangeListener createSheetStateChangeListener(String className) {
try {
Class clazz = getClass().getClassLoader().loadClass(className);
- return ((TabChangeListener) clazz.newInstance());
+ return ((SheetStateChangeListener) clazz.newInstance());
} catch (Exception e) {
LOG.error("", e);
}
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/ajax/AjaxResponseRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/ajax/AjaxResponseRenderer.java?rev=1449056&r1=1449055&r2=1449056&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/ajax/AjaxResponseRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/ajax/AjaxResponseRenderer.java Fri Feb 22 14:22:36 2013
@@ -42,9 +42,6 @@ import javax.faces.render.RenderKitFacto
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
import java.util.Map;
public class AjaxResponseRenderer {
@@ -75,6 +72,8 @@ public class AjaxResponseRenderer {
UIViewRoot incomingViewRoot = (UIViewRoot)
facesContext.getExternalContext().getRequestMap().get(TobagoLifecycle.VIEW_ROOT_KEY);
+ LOG.error("TODO: Reimplement AJAX stuff for JSF 2.0");
+/* XXX: reimplement it for JSF 2.0? Works only, when the TobagoLifecycle is active...
if (viewRoot != incomingViewRoot) {
if (LOG.isDebugEnabled()) {
LOG.debug("requesting full page reload because of navigation to {} from {}",
@@ -101,8 +100,9 @@ public class AjaxResponseRenderer {
}
writeResponse(facesContext, renderKit, true);
} else {
+*/
writeResponse(facesContext, renderKit, false);
- }
+// }
}
private void renderComponent(FacesContext facesContext, RenderKit renderKit, String clientId, UIComponent component)
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/application/ViewHandlerImpl.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/application/ViewHandlerImpl.java?rev=1449056&r1=1449055&r2=1449056&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/application/ViewHandlerImpl.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/application/ViewHandlerImpl.java Fri Feb 22 14:22:36 2013
@@ -32,6 +32,12 @@ import javax.faces.context.FacesContext;
import java.io.IOException;
import java.util.Locale;
+/**
+ * Not longer needed.
+ *
+ * @deprecated since Tobago 1.6.0
+ */
+@Deprecated
public class ViewHandlerImpl extends ViewHandler {
private static final Logger LOG = LoggerFactory.getLogger(ViewHandlerImpl.class);
Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java?rev=1449056&r1=1449055&r2=1449056&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/util/ComponentUtils.java Fri Feb 22 14:22:36 2013
@@ -52,6 +52,7 @@ import javax.faces.component.UIInput;
import javax.faces.component.UIOutput;
import javax.faces.component.UIParameter;
import javax.faces.component.UISelectMany;
+import javax.faces.component.UIViewRoot;
import javax.faces.component.ValueHolder;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
@@ -64,6 +65,7 @@ import javax.faces.model.SelectItem;
import javax.faces.render.RenderKit;
import javax.faces.render.RenderKitFactory;
import javax.faces.render.Renderer;
+import javax.faces.view.facelets.FaceletContext;
import javax.faces.webapp.UIComponentTag;
import javax.servlet.jsp.JspException;
import java.util.ArrayList;
@@ -144,15 +146,27 @@ public class ComponentUtils {
}
public static void resetPage(FacesContext context) {
- javax.faces.component.UIViewRoot view = context.getViewRoot();
+ UIViewRoot view = context.getViewRoot();
if (view != null) {
view.getAttributes().remove(PAGE_KEY);
}
}
- @SuppressWarnings("unchecked")
+ /**
+ * Tries to walk up the parents to find the UIViewRoot, if not found, then go to FaceletContext's FacesContext for
+ * the view root.
+ */
+ public static UIViewRoot findViewRoot(FaceletContext faceletContext, UIComponent component) {
+ UIViewRoot viewRoot = findAncestor(component, UIViewRoot.class);
+ if (viewRoot != null) {
+ return viewRoot;
+ } else {
+ return faceletContext.getFacesContext().getViewRoot();
+ }
+ }
+
public static AbstractUIPage findPage(FacesContext context, UIComponent component) {
- javax.faces.component.UIViewRoot view = context.getViewRoot();
+ UIViewRoot view = context.getViewRoot();
if (view != null) {
TransientStateHolder stateHolder = (TransientStateHolder) view.getAttributes().get(PAGE_KEY);
if (stateHolder == null || stateHolder.isEmpty()) {
@@ -381,8 +395,7 @@ public class ComponentUtils {
}
public static FacesMessage.Severity getMaximumSeverity(UIComponent component) {
- final boolean invalid = component instanceof javax.faces.component.UIInput
- && !((javax.faces.component.UIInput) component).isValid();
+ final boolean invalid = component instanceof UIInput && !((UIInput) component).isValid();
FacesMessage.Severity max = invalid ? FacesMessage.SEVERITY_ERROR : null;
FacesContext facesContext = FacesContext.getCurrentInstance();
final Iterator messages = facesContext.getMessages(component.getClientId(facesContext));
@@ -395,7 +408,7 @@ public class ComponentUtils {
return max;
}
- public static boolean isError(javax.faces.component.UIInput uiInput) {
+ public static boolean isError(UIInput uiInput) {
FacesContext facesContext = FacesContext.getCurrentInstance();
return !uiInput.isValid()
|| facesContext.getMessages(uiInput.getClientId(facesContext)).hasNext();
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/WEB-INF/faces-config.xml?rev=1449056&r1=1449055&r2=1449056&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/WEB-INF/faces-config.xml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/WEB-INF/faces-config.xml Fri Feb 22 14:22:36 2013
@@ -29,7 +29,6 @@
<supported-locale>en_GB</supported-locale>
<supported-locale>en_US</supported-locale>
</locale-config>
- <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
<action-listener>org.apache.myfaces.tobago.util.DebugActionListener</action-listener>
<navigation-handler>org.apache.myfaces.tobago.util.DebugNavigationHandler</navigation-handler>
<message-bundle>error.messages</message-bundle>
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/WEB-INF/web.xml?rev=1449056&r1=1449055&r2=1449056&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/WEB-INF/web.xml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook-cdi/src/main/webapp/WEB-INF/web.xml Fri Feb 22 14:22:36 2013
@@ -45,12 +45,6 @@
</context-param>
<context-param>
- <description>For backward compatibility (using "old" Facelets with JSF 2.0)</description>
- <param-name>javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER</param-name>
- <param-value>true</param-value>
- </context-param>
-
- <context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook/src/main/webapp/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook/src/main/webapp/WEB-INF/faces-config.xml?rev=1449056&r1=1449055&r2=1449056&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook/src/main/webapp/WEB-INF/faces-config.xml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook/src/main/webapp/WEB-INF/faces-config.xml Fri Feb 22 14:22:36 2013
@@ -30,7 +30,6 @@
<supported-locale>en_GB</supported-locale>
<supported-locale>en_US</supported-locale>
</locale-config>
- <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
<action-listener>org.apache.myfaces.tobago.util.DebugActionListener</action-listener>
<navigation-handler>org.apache.myfaces.tobago.util.DebugNavigationHandler</navigation-handler>
<variable-resolver>org.springframework.web.jsf.DelegatingVariableResolver</variable-resolver>
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-addressbook/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-addressbook/src/main/webapp/WEB-INF/web.xml?rev=1449056&r1=1449055&r2=1449056&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-addressbook/src/main/webapp/WEB-INF/web.xml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-addressbook/src/main/webapp/WEB-INF/web.xml Fri Feb 22 14:22:36 2013
@@ -48,12 +48,6 @@
</context-param>
<context-param>
- <description>For backward compatibility (using "old" Facelets with JSF 2.0)</description>
- <param-name>javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER</param-name>
- <param-value>true</param-value>
- </context-param>
-
- <context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/pom.xml?rev=1449056&r1=1449055&r2=1449056&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/pom.xml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/pom.xml Fri Feb 22 14:22:36 2013
@@ -251,11 +251,6 @@
<scope>compile</scope>
</dependency>
<dependency>
- <groupId>com.sun.facelets</groupId>
- <artifactId>jsf-facelets</artifactId>
- <version>${facelets.version}</version>
- </dependency>
- <dependency>
<groupId>org.apache.myfaces.test</groupId>
<artifactId>myfaces-test20</artifactId>
<version>${myfaces-test20.version}</version>
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/resources/log4j.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/resources/log4j.xml?rev=1449056&r1=1449055&r2=1449056&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/resources/log4j.xml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/resources/log4j.xml Fri Feb 22 14:22:36 2013
@@ -58,10 +58,6 @@
<!--<priority value="debug" />-->
<!--</category>-->
- <!--<category name="org.apache.myfaces.tobago.internal.application.ViewHandlerImpl">-->
- <!--<priority value="debug" />-->
- <!--</category>-->
-
<!-- <category name="org.apache.catalina.core.ApplicationDispatcher">-->
<!-- <priority value="debug" />-->
<!-- </category>-->
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/faces-config.xml?rev=1449056&r1=1449055&r2=1449056&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/faces-config.xml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/faces-config.xml Fri Feb 22 14:22:36 2013
@@ -24,9 +24,6 @@
version="1.2">
<application>
- <view-handler>
- com.sun.facelets.FaceletViewHandler
- </view-handler>
<navigation-handler>
org.apache.myfaces.tobago.example.demo.MultiplePageDeclarationLanguageNavigationHandler
</navigation-handler>
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml?rev=1449056&r1=1449055&r2=1449056&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/web.xml Fri Feb 22 14:22:36 2013
@@ -64,12 +64,6 @@
</context-param>
<context-param>
- <description>For backward compatibility (using "old" Facelets with JSF 2.0)</description>
- <param-name>javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER</param-name>
- <param-value>true</param-value>
- </context-param>
-
- <context-param>
<param-name>javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL</param-name>
<param-value>true</param-value>
</context-param>
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-sandbox/src/main/webapp/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-sandbox/src/main/webapp/WEB-INF/faces-config.xml?rev=1449056&r1=1449055&r2=1449056&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-sandbox/src/main/webapp/WEB-INF/faces-config.xml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-sandbox/src/main/webapp/WEB-INF/faces-config.xml Fri Feb 22 14:22:36 2013
@@ -24,9 +24,6 @@
<faces-config>
<application>
- <view-handler>
- com.sun.facelets.FaceletViewHandler
- </view-handler>
<locale-config>
<default-locale>en</default-locale>
</locale-config>
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-test/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-test/pom.xml?rev=1449056&r1=1449055&r2=1449056&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-test/pom.xml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-test/pom.xml Fri Feb 22 14:22:36 2013
@@ -168,11 +168,13 @@
<artifactId>tobago-fileupload</artifactId>
<version>${project.version}</version>
</dependency>
+<!--
<dependency>
<groupId>org.apache.myfaces.tomahawk</groupId>
<artifactId>tomahawk12</artifactId>
<version>1.1.11</version>
</dependency>
+-->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
@@ -193,11 +195,6 @@
<scope>compile</scope>
</dependency>
<dependency>
- <groupId>com.sun.facelets</groupId>
- <artifactId>jsf-facelets</artifactId>
- <version>${facelets.version}</version>
- </dependency>
- <dependency>
<groupId>org.seleniumhq.selenium.client-drivers</groupId>
<artifactId>selenium-java-client-driver</artifactId>
<version>1.0.1</version>
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/resources/META-INF/tobago-example-test.taglib.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/resources/META-INF/tobago-example-test.taglib.xml?rev=1449056&r1=1449055&r2=1449056&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/resources/META-INF/tobago-example-test.taglib.xml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/resources/META-INF/tobago-example-test.taglib.xml Fri Feb 22 14:22:36 2013
@@ -16,13 +16,17 @@
* limitations under the License.
-->
-<!DOCTYPE facelet-taglib PUBLIC
- "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
- "http://java.sun.com/dtd/facelet-taglib_1_0.dtd">
-<facelet-taglib>
+<facelet-taglib
+ version="2.0"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd">
+
<namespace>http://myfaces.apache.org/tobago/example/test</namespace>
+
<tag>
<tag-name>popup</tag-name>
<source>popup.xhtml</source>
</tag>
+
</facelet-taglib>
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/faces-config.xml?rev=1449056&r1=1449055&r2=1449056&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/faces-config.xml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/faces-config.xml Fri Feb 22 14:22:36 2013
@@ -23,12 +23,6 @@
<faces-config>
- <application>
- <view-handler>
- com.sun.facelets.FaceletViewHandler
- </view-handler>
- </application>
-
<managed-bean>
<managed-bean-name>browser</managed-bean-name>
<managed-bean-class>org.apache.myfaces.tobago.example.test.DirectoryBrowser</managed-bean-class>
@@ -58,13 +52,13 @@
<managed-bean-class>org.apache.myfaces.tobago.example.test.Immediate</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
-
+
<managed-bean>
<managed-bean-name>hidden</managed-bean-name>
<managed-bean-class>org.apache.myfaces.tobago.example.test.Hidden</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
-
+
<managed-bean>
<managed-bean-name>upload</managed-bean-name>
<managed-bean-class>org.apache.myfaces.tobago.example.test.Upload</managed-bean-class>
@@ -239,5 +233,5 @@
<to-view-id>/tf/wizard/navi/finish.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
-
+
</faces-config>
Modified: myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/web.xml?rev=1449056&r1=1449055&r2=1449056&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/web.xml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-test/src/main/webapp/WEB-INF/web.xml Fri Feb 22 14:22:36 2013
@@ -54,11 +54,6 @@
</context-param>
<context-param>
- <param-name>javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER</param-name>
- <param-value>true</param-value>
- </context-param>
-
- <context-param>
<param-name>javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL</param-name>
<param-value>true</param-value>
</context-param>
@@ -100,6 +95,7 @@
<url-pattern>/ScriptEventServlet</url-pattern>
</servlet-mapping>
+<!--
<filter>
<filter-name>MyFacesExtensionsFilter</filter-name>
<filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
@@ -109,18 +105,19 @@
</init-param>
</filter>
- <!-- extension mapping for adding <script/>, <link/>, and other resource tags to JSF-pages -->
+ <!– extension mapping for adding <script/>, <link/>, and other resource tags to JSF-pages –>
<filter-mapping>
<filter-name>MyFacesExtensionsFilter</filter-name>
- <!-- servlet-name must match the name of your javax.faces.webapp.FacesServlet entry -->
+ <!– servlet-name must match the name of your javax.faces.webapp.FacesServlet entry –>
<servlet-name>FacesServlet</servlet-name>
</filter-mapping>
- <!-- extension mapping for serving page-independent resources (javascript, stylesheets, images, etc.) -->
+ <!– extension mapping for serving page-independent resources (javascript, stylesheets, images, etc.) –>
<filter-mapping>
<filter-name>MyFacesExtensionsFilter</filter-name>
<url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
</filter-mapping>
+-->
<error-page>
<error-code>404</error-code>
Modified: myfaces/tobago/trunk/tobago-extension/tobago-facelets/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-extension/tobago-facelets/pom.xml?rev=1449056&r1=1449055&r2=1449056&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-extension/tobago-facelets/pom.xml (original)
+++ myfaces/tobago/trunk/tobago-extension/tobago-facelets/pom.xml Fri Feb 22 14:22:36 2013
@@ -68,11 +68,6 @@
<artifactId>el-api</artifactId>
</dependency>
<dependency>
- <groupId>com.sun.facelets</groupId>
- <artifactId>jsf-facelets</artifactId>
- <version>${facelets.version}</version>
- </dependency>
- <dependency>
<groupId>org.apache.myfaces.tobago</groupId>
<artifactId>tobago-tool-annotation</artifactId>
<version>${project.version}</version>
Modified: myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/AttributeHandler.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/AttributeHandler.java?rev=1449056&r1=1449055&r2=1449056&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/AttributeHandler.java (original)
+++ myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/AttributeHandler.java Fri Feb 22 14:22:36 2013
@@ -19,14 +19,6 @@
package org.apache.myfaces.tobago.facelets;
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.el.ELAdaptor;
-import com.sun.facelets.el.TagMethodExpression;
-import com.sun.facelets.tag.TagAttribute;
-import com.sun.facelets.tag.TagConfig;
-import com.sun.facelets.tag.TagException;
-import com.sun.facelets.tag.TagHandler;
-import com.sun.facelets.tag.jsf.ComponentSupport;
import org.apache.commons.beanutils.PropertyUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.myfaces.tobago.component.Attributes;
@@ -52,6 +44,12 @@ import javax.faces.convert.Converter;
import javax.faces.event.MethodExpressionActionListener;
import javax.faces.event.MethodExpressionValueChangeListener;
import javax.faces.validator.MethodExpressionValidator;
+import javax.faces.view.facelets.ComponentHandler;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.TagAttribute;
+import javax.faces.view.facelets.TagConfig;
+import javax.faces.view.facelets.TagException;
+import javax.faces.view.facelets.TagHandler;
import java.beans.IntrospectionException;
import java.beans.PropertyDescriptor;
@@ -78,7 +76,7 @@ public final class AttributeHandler exte
throw new TagException(tag, "Parent UIComponent was null");
}
- if (ComponentSupport.isNew(parent)) {
+ if (ComponentHandler.isNew(parent)) {
if (mode != null) {
if ("isNotSet".equals(mode.getValue())) {
@@ -205,7 +203,7 @@ public final class AttributeHandler exte
final String attributeName = name.getValue(faceletContext);
if (containsMethodOrValueExpression(expressionString)) {
ValueExpression expression = value.getValueExpression(faceletContext, Object.class);
- ELAdaptor.setExpression(parent, attributeName, expression);
+ parent.setValueExpression(attributeName, expression);
} else {
final Object literalValue = getValue(faceletContext, parent, expressionString, attributeName);
parent.getAttributes().put(attributeName, literalValue);
@@ -221,7 +219,7 @@ public final class AttributeHandler exte
if (value.isLiteral()) {
parent.setRendered(value.getBoolean(faceletContext));
} else {
- ELAdaptor.setExpression(parent, nameValue, value.getValueExpression(faceletContext, Boolean.class));
+ parent.setValueExpression(nameValue, value.getValueExpression(faceletContext, Boolean.class));
}
} else if (Attributes.RENDERED_PARTIALLY.equals(nameValue)
&& parent instanceof SupportsRenderedPartially) {
@@ -230,7 +228,7 @@ public final class AttributeHandler exte
String[] components = ComponentUtils.splitList(value.getValue());
((SupportsRenderedPartially) parent).setRenderedPartially(components);
} else {
- ELAdaptor.setExpression(parent, nameValue, value.getValueExpression(faceletContext, Object.class));
+ parent.setValueExpression(nameValue, value.getValueExpression(faceletContext, Object.class));
}
} else if (Attributes.STYLE_CLASS.equals(nameValue)) {
// TODO expression
@@ -241,7 +239,7 @@ public final class AttributeHandler exte
((SupportsMarkup) parent).setMarkup(Markup.valueOf(value.getValue()));
} else {
ValueExpression expression = value.getValueExpression(faceletContext, Object.class);
- ELAdaptor.setExpression(parent, nameValue, expression);
+ parent.setValueExpression(nameValue, expression);
}
} else {
LOG.error("Component is not instanceof SupportsMarkup. Instance is: " + parent.getClass().getName());
@@ -275,7 +273,7 @@ public final class AttributeHandler exte
if (value.isLiteral()) {
parent.getAttributes().put(nameValue, value.getValue());
} else {
- ELAdaptor.setExpression(parent, nameValue, value.getValueExpression(faceletContext, Object.class));
+ parent.setValueExpression(nameValue, value.getValueExpression(faceletContext, Object.class));
}
}
}
@@ -358,7 +356,7 @@ public final class AttributeHandler exte
faceletContext.getFacesContext().getApplication().createConverter(expression.getExpressionString());
((ValueHolder) parent).setConverter(converter);
} else {
- ELAdaptor.setExpression(parent, nameValue, expression);
+ parent.setValueExpression(nameValue, expression);
}
}
}
Modified: myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/ContentTypeRule.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/ContentTypeRule.java?rev=1449056&r1=1449055&r2=1449056&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/ContentTypeRule.java (original)
+++ myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/ContentTypeRule.java Fri Feb 22 14:22:36 2013
@@ -19,14 +19,15 @@
package org.apache.myfaces.tobago.facelets;
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.tag.MetaRule;
-import com.sun.facelets.tag.Metadata;
-import com.sun.facelets.tag.MetadataTarget;
-import com.sun.facelets.tag.TagAttribute;
import org.apache.myfaces.tobago.util.ComponentUtils;
import org.apache.myfaces.tobago.validator.FileItemValidator;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.MetaRule;
+import javax.faces.view.facelets.Metadata;
+import javax.faces.view.facelets.MetadataTarget;
+import javax.faces.view.facelets.TagAttribute;
+
public class ContentTypeRule extends MetaRule {
public static final ContentTypeRule INSTANCE = new ContentTypeRule();
Modified: myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/ConverterHandler.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/ConverterHandler.java?rev=1449056&r1=1449055&r2=1449056&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/ConverterHandler.java (original)
+++ myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/ConverterHandler.java Fri Feb 22 14:22:36 2013
@@ -19,24 +19,26 @@
package org.apache.myfaces.tobago.facelets;
-import com.sun.facelets.tag.TagHandler;
-import com.sun.facelets.tag.TagAttribute;
-import com.sun.facelets.tag.TagConfig;
-import com.sun.facelets.tag.TagAttributeException;
-import com.sun.facelets.tag.TagException;
-import com.sun.facelets.tag.jsf.ComponentSupport;
-import com.sun.facelets.FaceletContext;
-
+import javax.el.ELException;
+import javax.el.ValueExpression;
+import javax.faces.FacesException;
import javax.faces.component.UIComponent;
import javax.faces.component.ValueHolder;
-import javax.faces.FacesException;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
-import javax.el.ELException;
-import javax.el.ValueExpression;
+import javax.faces.view.facelets.ComponentHandler;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.TagAttribute;
+import javax.faces.view.facelets.TagAttributeException;
+import javax.faces.view.facelets.TagConfig;
+import javax.faces.view.facelets.TagException;
+import javax.faces.view.facelets.TagHandler;
import java.io.IOException;
/*
+
+ TBD: Why we don't use a converter directly via the tobago.taglib.xml?
+
* Date: Oct 13, 2006
* Time: 6:17:49 PM
*/
@@ -55,7 +57,7 @@ public class ConverterHandler extends Ta
public void apply(FaceletContext faceletContext, UIComponent parent)
throws IOException, FacesException, ELException {
if (parent instanceof ValueHolder) {
- if (ComponentSupport.isNew(parent)) {
+ if (ComponentHandler.isNew(parent)) {
ValueHolder valueHolder = (ValueHolder) parent;
Converter converter = null;
ValueExpression valueExpression = null;
Modified: myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/DataAttributeHandler.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/DataAttributeHandler.java?rev=1449056&r1=1449055&r2=1449056&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/DataAttributeHandler.java (original)
+++ myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/DataAttributeHandler.java Fri Feb 22 14:22:36 2013
@@ -19,18 +19,18 @@
package org.apache.myfaces.tobago.facelets;
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.tag.TagAttribute;
-import com.sun.facelets.tag.TagConfig;
-import com.sun.facelets.tag.TagException;
-import com.sun.facelets.tag.TagHandler;
-import com.sun.facelets.tag.jsf.ComponentSupport;
import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.util.ComponentUtils;
import javax.el.ELException;
import javax.faces.FacesException;
import javax.faces.component.UIComponent;
+import javax.faces.view.facelets.ComponentHandler;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.TagAttribute;
+import javax.faces.view.facelets.TagConfig;
+import javax.faces.view.facelets.TagException;
+import javax.faces.view.facelets.TagHandler;
public final class DataAttributeHandler extends TagHandler {
@@ -50,7 +50,7 @@ public final class DataAttributeHandler
throw new TagException(tag, "Parent UIComponent was null");
}
- if (ComponentSupport.isNew(parent)) {
+ if (ComponentHandler.isNew(parent)) {
Object attributeName = name.isLiteral()
? (Object) name.getValue(faceletContext)
Added: myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/DefaultResourceResolver.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/DefaultResourceResolver.java?rev=1449056&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/DefaultResourceResolver.java (added)
+++ myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/DefaultResourceResolver.java Fri Feb 22 14:22:36 2013
@@ -0,0 +1,49 @@
+/*
+ * 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.tobago.facelets;
+
+import javax.faces.FacesException;
+import javax.faces.context.FacesContext;
+import javax.faces.view.facelets.ResourceResolver;
+import java.io.IOException;
+import java.net.URL;
+
+/*
+ * Was copied from MyFaces-Impl, because there is no JSF base class.
+ */
+public class DefaultResourceResolver extends ResourceResolver {
+
+ public DefaultResourceResolver() {
+ super();
+ }
+
+ public URL resolveUrl(String path) {
+ try {
+ return Resource.getResourceUrl(FacesContext.getCurrentInstance(), path);
+ } catch (IOException e) {
+ throw new FacesException(e);
+ }
+ }
+
+ public String toString() {
+ return "DefaultResourceResolver";
+ }
+
+}
Modified: myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/DeprecatedDimensionRule.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/DeprecatedDimensionRule.java?rev=1449056&r1=1449055&r2=1449056&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/DeprecatedDimensionRule.java (original)
+++ myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/DeprecatedDimensionRule.java Fri Feb 22 14:22:36 2013
@@ -19,18 +19,17 @@
package org.apache.myfaces.tobago.facelets;
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.el.ELAdaptor;
-import com.sun.facelets.tag.MetaRule;
-import com.sun.facelets.tag.Metadata;
-import com.sun.facelets.tag.MetadataTarget;
-import com.sun.facelets.tag.TagAttribute;
import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.DeprecatedDimension;
import org.apache.myfaces.tobago.layout.Measure;
import javax.el.ValueExpression;
import javax.faces.component.UIComponent;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.MetaRule;
+import javax.faces.view.facelets.Metadata;
+import javax.faces.view.facelets.MetadataTarget;
+import javax.faces.view.facelets.TagAttribute;
public class DeprecatedDimensionRule extends MetaRule {
@@ -58,7 +57,7 @@ public class DeprecatedDimensionRule ext
((DeprecatedDimension) instance).setWidth(Measure.parse(attribute.getValue()));
} else {
ValueExpression expression = attribute.getValueExpression(ctx, Object.class);
- ELAdaptor.setExpression((UIComponent) instance, Attributes.WIDTH, expression);
+ ((UIComponent) instance).setValueExpression(Attributes.WIDTH, expression);
}
}
}
@@ -75,7 +74,7 @@ public class DeprecatedDimensionRule ext
((DeprecatedDimension) instance).setHeight(Measure.parse(attribute.getValue()));
} else {
ValueExpression expression = attribute.getValueExpression(ctx, Object.class);
- ELAdaptor.setExpression((UIComponent) instance, Attributes.HEIGHT, expression);
+ ((UIComponent) instance).setValueExpression(Attributes.HEIGHT, expression);
}
}
}
Modified: myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/FlowLayoutRule.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/FlowLayoutRule.java?rev=1449056&r1=1449055&r2=1449056&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/FlowLayoutRule.java (original)
+++ myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/FlowLayoutRule.java Fri Feb 22 14:22:36 2013
@@ -19,16 +19,17 @@
package org.apache.myfaces.tobago.facelets;
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.tag.MetaRule;
-import com.sun.facelets.tag.Metadata;
-import com.sun.facelets.tag.MetadataTarget;
-import com.sun.facelets.tag.TagAttribute;
import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.UIFlowLayout;
import org.apache.myfaces.tobago.layout.Measure;
import org.apache.myfaces.tobago.layout.TextAlign;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.MetaRule;
+import javax.faces.view.facelets.Metadata;
+import javax.faces.view.facelets.MetadataTarget;
+import javax.faces.view.facelets.TagAttribute;
+
public class FlowLayoutRule extends MetaRule {
public static final FlowLayoutRule INSTANCE = new FlowLayoutRule();
Modified: myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/GridLayoutConstraintHandler.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/GridLayoutConstraintHandler.java?rev=1449056&r1=1449055&r2=1449056&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/GridLayoutConstraintHandler.java (original)
+++ myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/GridLayoutConstraintHandler.java Fri Feb 22 14:22:36 2013
@@ -19,22 +19,22 @@
package org.apache.myfaces.tobago.facelets;
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.tag.TagAttribute;
-import com.sun.facelets.tag.TagConfig;
-import com.sun.facelets.tag.TagHandler;
-import org.apache.myfaces.tobago.component.UIExtensionPanel;
-import org.apache.myfaces.tobago.layout.LayoutContainer;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.apache.myfaces.tobago.component.Attributes;
+import org.apache.myfaces.tobago.component.UIExtensionPanel;
import org.apache.myfaces.tobago.layout.LayoutBase;
import org.apache.myfaces.tobago.layout.LayoutComponent;
+import org.apache.myfaces.tobago.layout.LayoutContainer;
import org.apache.myfaces.tobago.layout.Measure;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.el.ELException;
import javax.faces.FacesException;
import javax.faces.component.UIComponent;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.TagAttribute;
+import javax.faces.view.facelets.TagConfig;
+import javax.faces.view.facelets.TagHandler;
import java.io.IOException;
public class GridLayoutConstraintHandler extends TagHandler {
Modified: myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/GridLayoutRule.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/GridLayoutRule.java?rev=1449056&r1=1449055&r2=1449056&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/GridLayoutRule.java (original)
+++ myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/GridLayoutRule.java Fri Feb 22 14:22:36 2013
@@ -19,15 +19,16 @@
package org.apache.myfaces.tobago.facelets;
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.tag.MetaRule;
-import com.sun.facelets.tag.Metadata;
-import com.sun.facelets.tag.MetadataTarget;
-import com.sun.facelets.tag.TagAttribute;
import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.UIGridLayout;
import org.apache.myfaces.tobago.layout.Measure;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.MetaRule;
+import javax.faces.view.facelets.Metadata;
+import javax.faces.view.facelets.MetadataTarget;
+import javax.faces.view.facelets.TagAttribute;
+
public class GridLayoutRule extends MetaRule {
public static final GridLayoutRule INSTANCE = new GridLayoutRule();
Modified: myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/LoadBundleHandler.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/LoadBundleHandler.java?rev=1449056&r1=1449055&r2=1449056&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/LoadBundleHandler.java (original)
+++ myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/LoadBundleHandler.java Fri Feb 22 14:22:36 2013
@@ -19,11 +19,11 @@
package org.apache.myfaces.tobago.facelets;
-import com.sun.facelets.tag.TagHandler;
-import com.sun.facelets.tag.TagAttribute;
-import com.sun.facelets.tag.TagConfig;
+import javax.faces.view.facelets.TagHandler;
+import javax.faces.view.facelets.TagAttribute;
+import javax.faces.view.facelets.TagConfig;
-import com.sun.facelets.FaceletContext;
+import javax.faces.view.facelets.FaceletContext;
import org.apache.myfaces.tobago.util.BundleMapWrapper;
Modified: myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/MetaInfResourcesClasspathResourceResolver.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/MetaInfResourcesClasspathResourceResolver.java?rev=1449056&r1=1449055&r2=1449056&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/MetaInfResourcesClasspathResourceResolver.java (original)
+++ myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/MetaInfResourcesClasspathResourceResolver.java Fri Feb 22 14:22:36 2013
@@ -19,7 +19,6 @@
package org.apache.myfaces.tobago.facelets;
-import com.sun.facelets.impl.DefaultResourceResolver;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Modified: myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/PopupReferenceHandler.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/PopupReferenceHandler.java?rev=1449056&r1=1449055&r2=1449056&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/PopupReferenceHandler.java (original)
+++ myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/PopupReferenceHandler.java Fri Feb 22 14:22:36 2013
@@ -19,12 +19,6 @@
package org.apache.myfaces.tobago.facelets;
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.tag.TagAttribute;
-import com.sun.facelets.tag.TagConfig;
-import com.sun.facelets.tag.TagException;
-import com.sun.facelets.tag.TagHandler;
-import com.sun.facelets.tag.jsf.ComponentSupport;
import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.event.PopupActionListener;
import org.apache.myfaces.tobago.event.ValueExpressionPopupActionListener;
@@ -34,6 +28,12 @@ import javax.el.ValueExpression;
import javax.faces.FacesException;
import javax.faces.component.ActionSource;
import javax.faces.component.UIComponent;
+import javax.faces.view.facelets.ComponentHandler;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.TagAttribute;
+import javax.faces.view.facelets.TagConfig;
+import javax.faces.view.facelets.TagException;
+import javax.faces.view.facelets.TagHandler;
import java.io.IOException;
public class PopupReferenceHandler extends TagHandler {
@@ -48,7 +48,7 @@ public class PopupReferenceHandler exten
public void apply(FaceletContext faceletContext, UIComponent parent)
throws IOException, FacesException, ELException {
if (parent instanceof ActionSource) {
- if (ComponentSupport.isNew(parent)) {
+ if (ComponentHandler.isNew(parent)) {
ActionSource actionSource = (ActionSource) parent;
if (forComponent.isLiteral()) {
actionSource.addActionListener(new PopupActionListener(forComponent.getValue()));
Modified: myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/PositionRule.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/PositionRule.java?rev=1449056&r1=1449055&r2=1449056&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/PositionRule.java (original)
+++ myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/PositionRule.java Fri Feb 22 14:22:36 2013
@@ -19,18 +19,17 @@
package org.apache.myfaces.tobago.facelets;
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.el.ELAdaptor;
-import com.sun.facelets.tag.MetaRule;
-import com.sun.facelets.tag.Metadata;
-import com.sun.facelets.tag.MetadataTarget;
-import com.sun.facelets.tag.TagAttribute;
import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.component.Position;
import org.apache.myfaces.tobago.layout.Measure;
import javax.el.ValueExpression;
import javax.faces.component.UIComponent;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.MetaRule;
+import javax.faces.view.facelets.Metadata;
+import javax.faces.view.facelets.MetadataTarget;
+import javax.faces.view.facelets.TagAttribute;
public class PositionRule extends MetaRule {
@@ -58,7 +57,7 @@ public class PositionRule extends MetaRu
((Position) instance).setLeft(Measure.parse(attribute.getValue()));
} else {
ValueExpression expression = attribute.getValueExpression(ctx, Object.class);
- ELAdaptor.setExpression((UIComponent) instance, Attributes.LEFT, expression);
+ ((UIComponent) instance).setValueExpression(Attributes.LEFT, expression);
}
}
}
@@ -75,7 +74,7 @@ public class PositionRule extends MetaRu
((Position) instance).setTop(Measure.parse(attribute.getValue()));
} else {
ValueExpression expression = attribute.getValueExpression(ctx, Object.class);
- ELAdaptor.setExpression((UIComponent) instance, Attributes.TOP, expression);
+ ((UIComponent) instance).setValueExpression(Attributes.TOP, expression);
}
}
}
Modified: myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/ResetInputActionListenerHandler.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/ResetInputActionListenerHandler.java?rev=1449056&r1=1449055&r2=1449056&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/ResetInputActionListenerHandler.java (original)
+++ myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/ResetInputActionListenerHandler.java Fri Feb 22 14:22:36 2013
@@ -19,12 +19,6 @@
package org.apache.myfaces.tobago.facelets;
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.tag.TagAttribute;
-import com.sun.facelets.tag.TagConfig;
-import com.sun.facelets.tag.TagException;
-import com.sun.facelets.tag.TagHandler;
-import com.sun.facelets.tag.jsf.ComponentSupport;
import org.apache.myfaces.tobago.component.Attributes;
import org.apache.myfaces.tobago.event.ResetFormActionListener;
import org.apache.myfaces.tobago.event.ResetInputActionListener;
@@ -36,6 +30,12 @@ import javax.el.ValueExpression;
import javax.faces.FacesException;
import javax.faces.component.ActionSource;
import javax.faces.component.UIComponent;
+import javax.faces.view.facelets.ComponentHandler;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.TagAttribute;
+import javax.faces.view.facelets.TagConfig;
+import javax.faces.view.facelets.TagException;
+import javax.faces.view.facelets.TagHandler;
import java.io.IOException;
public class ResetInputActionListenerHandler extends TagHandler {
@@ -50,7 +50,7 @@ public class ResetInputActionListenerHan
public void apply(FaceletContext faceletContext, UIComponent parent)
throws IOException, FacesException, ELException {
if (parent instanceof ActionSource) {
- if (ComponentSupport.isNew(parent)) {
+ if (ComponentHandler.isNew(parent)) {
ActionSource actionSource = (ActionSource) parent;
if (execute == null) {
actionSource.addActionListener(new ResetFormActionListener());
Added: myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/Resource.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/Resource.java?rev=1449056&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/Resource.java (added)
+++ myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/Resource.java Fri Feb 22 14:22:36 2013
@@ -0,0 +1,139 @@
+/*
+ * 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.tobago.facelets;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.servlet.ServletContext;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.URLStreamHandler;
+
+/*
+ * Was copied from MyFaces-Impl, because there is no JSF base class.
+ */
+public class Resource {
+
+ private static final Logger LOG = LoggerFactory.getLogger(Resource.class);
+
+ /**
+ * Get an URL of an internal resource. First, {@link javax.faces.context.ExternalContext#getResource(String)} is
+ * checked for an non-null URL return value. In the case of a null return value (as it is the case for Weblogic 8.1
+ * for a packed war), a URL with a special URL handler is constructed, which can be used for <em>opening</em> a
+ * serlvet resource later. Internally, this special URL handler will call
+ * {@link javax.servlet.ServletContext#getResourceAsStream(String)} when an inputstream is requested.
+ * This works even on Weblogic 8.1
+ *
+ * @param ctx the faces context from which to retrieve the resource
+ * @param path an URL path
+ * @return an url representing the URL and on which getInputStream() can be called to get the resource
+ * @throws java.net.MalformedURLException
+ */
+ public static URL getResourceUrl(FacesContext ctx, String path) throws MalformedURLException {
+ final ExternalContext externalContext = ctx.getExternalContext();
+ URL url = externalContext.getResource(path);
+ if (LOG.isTraceEnabled()) {
+ LOG.trace("Resource-Url from external context: " + url);
+ }
+ if (url == null) {
+ // This might happen on Servlet container which doesnot return
+ // anything
+ // for getResource() (like weblogic 8.1 for packaged wars) we
+ // are trying
+ // to use an own URL protocol in order to use
+ // ServletContext.getResourceAsStream()
+ // when opening the url
+ if (resourceExist(externalContext, path)) {
+ url = getUrlForResourceAsStream(externalContext, path);
+ }
+ }
+ return url;
+ }
+
+ // This method could be used above to provide a 'fail fast' if a
+ // resource
+ // doesnt exist. Otherwise, the URL will fail on the first access.
+ private static boolean resourceExist(ExternalContext externalContext, String path) {
+ if ("/".equals(path)) {
+ // The root context exists always
+ return true;
+ }
+ Object ctx = externalContext.getContext();
+ if (ctx instanceof ServletContext) {
+ ServletContext servletContext = (ServletContext) ctx;
+ InputStream stream = servletContext.getResourceAsStream(path);
+ if (stream != null) {
+ try {
+ stream.close();
+ } catch (IOException e) {
+ // Ignore here, since we donnot wanted to read from this
+ // resource anyway
+ }
+ return true;
+ }
+ }
+ return false;
+ }
+
+ // Construct URL with special URLStreamHandler for proxying
+ // ServletContext.getResourceAsStream()
+ private static URL getUrlForResourceAsStream(final ExternalContext externalContext, String path)
+ throws MalformedURLException {
+ URLStreamHandler handler = new URLStreamHandler() {
+ protected URLConnection openConnection(URL u) throws IOException {
+ final String file = u.getFile();
+ return new URLConnection(u) {
+ public void connect() throws IOException {
+ }
+
+ public InputStream getInputStream() throws IOException {
+ if (LOG.isTraceEnabled()) {
+ LOG.trace("Opening internal url to " + file);
+ }
+ Object ctx = externalContext.getContext();
+ // Or maybe fetch the external context afresh ?
+ // Object ctx =
+ // FacesContext.getCurrentInstance().getExternalContext().getContext();
+
+ if (ctx instanceof ServletContext) {
+ ServletContext servletContext = (ServletContext) ctx;
+ InputStream stream = servletContext.getResourceAsStream(file);
+ if (stream == null) {
+ throw new FileNotFoundException("Cannot open resource " + file);
+ }
+ return stream;
+ } else {
+ throw new IOException("Cannot open resource for an context of "
+ + (ctx != null ? ctx.getClass() : null));
+ }
+ }
+ };
+ }
+ };
+ return new URL("internal", null, 0, path, handler);
+ }
+}
Modified: myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/ScriptHandler.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/ScriptHandler.java?rev=1449056&r1=1449055&r2=1449056&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/ScriptHandler.java (original)
+++ myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/ScriptHandler.java Fri Feb 22 14:22:36 2013
@@ -19,39 +19,39 @@
package org.apache.myfaces.tobago.facelets;
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.tag.TextHandler;
-import com.sun.facelets.tag.jsf.ComponentConfig;
-import com.sun.facelets.tag.jsf.ComponentHandler;
+import org.apache.myfaces.tobago.component.UIScript;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.faces.component.UIComponent;
-import java.util.Iterator;
-
-import org.apache.myfaces.tobago.component.UIScript;
+import javax.faces.view.facelets.ComponentConfig;
+import javax.faces.view.facelets.ComponentHandler;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.FaceletHandler;
+import javax.faces.view.facelets.TextHandler;
-/*
- * Date: Feb 3, 2007
- * Time: 8:46:45 AM
- */
public class ScriptHandler extends ComponentHandler {
+ private static final Logger LOG = LoggerFactory.getLogger(ScriptHandler.class);
+
public ScriptHandler(ComponentConfig config) {
super(config);
}
- protected void onComponentCreated(FaceletContext context, UIComponent component, UIComponent parent) {
- StringBuffer content = new StringBuffer();
- Iterator iter = findNextByType(TextHandler.class);
- while (iter.hasNext()) {
- TextHandler text = (TextHandler) iter.next();
- content.append(text.getText(context));
- }
- if (component instanceof UIScript) {
- ((UIScript) component).setScript(content.toString());
+ public void onComponentCreated(FaceletContext context, UIComponent component, UIComponent parent) {
+ StringBuilder content = new StringBuilder();
+ final FaceletHandler next = getComponentConfig().getNextHandler();
+ if (next instanceof TextHandler) {
+ content.append(((TextHandler) next).getText(context));
+ } else {
+ // TBD: is this okay, or is here something to do?
+ // on the other side, Script inside the page is deprecated.
+ LOG.warn("Not applied for handler: " + next.getClass().getName());
}
+ ((UIScript) component).setScript(content.toString());
}
- protected void applyNextHandler(FaceletContext ctx, UIComponent c) {
+ public void applyNextHandler(FaceletContext ctx, UIComponent c) {
}
}
Modified: myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/SheetStateChangeSourceRule.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/SheetStateChangeSourceRule.java?rev=1449056&r1=1449055&r2=1449056&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/SheetStateChangeSourceRule.java (original)
+++ myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/SheetStateChangeSourceRule.java Fri Feb 22 14:22:36 2013
@@ -19,26 +19,27 @@
package org.apache.myfaces.tobago.facelets;
-import com.sun.facelets.tag.MetaRule;
-import com.sun.facelets.tag.Metadata;
-import com.sun.facelets.tag.TagAttribute;
-import com.sun.facelets.tag.MetadataTarget;
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.el.LegacyMethodBinding;
+import org.apache.myfaces.tobago.component.MethodExpressionToMethodBinding;
import org.apache.myfaces.tobago.event.SheetStateChangeSource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.faces.event.ActionEvent;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.MetaRule;
+import javax.faces.view.facelets.Metadata;
+import javax.faces.view.facelets.MetadataTarget;
+import javax.faces.view.facelets.TagAttribute;
-/*
- * Date: 15.04.2006
- * Time: 14:25:10
- */
public class SheetStateChangeSourceRule extends MetaRule {
+
+ private static final Logger LOG = LoggerFactory.getLogger(SheetStateChangeSourceRule.class);
+
static final Class[] ACTION_LISTENER = new Class[]{ActionEvent.class};
+
public static final SheetStateChangeSourceRule INSTANCE = new SheetStateChangeSourceRule();
- public Metadata applyRule(String name, TagAttribute attribute,
- MetadataTarget metadataTarget) {
+ public Metadata applyRule(String name, TagAttribute attribute, MetadataTarget metadataTarget) {
if (metadataTarget.isTargetInstanceOf(SheetStateChangeSource.class)) {
if ("stateChangeListener".equals(name)) {
return new SheetStateChangeListenerMapper(attribute);
@@ -56,10 +57,12 @@ public class SheetStateChangeSourceRule
}
public void applyMetadata(FaceletContext ctx, Object instance) {
+LOG.error("TODO: implementation for JSF 1.2 / JSF 2.0");
((SheetStateChangeSource) instance)
- .setStateChangeListener(new LegacyMethodBinding(attribute
+// XXX
+ .setStateChangeListener(new MethodExpressionToMethodBinding(attribute
.getMethodExpression(ctx, null,
- SheetStateChangeSourceRule.ACTION_LISTENER)));
+ SheetStateChangeSourceRule.ACTION_LISTENER)));
}
}
}
Modified: myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/SortActionSourceRule.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/SortActionSourceRule.java?rev=1449056&r1=1449055&r2=1449056&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/SortActionSourceRule.java (original)
+++ myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/SortActionSourceRule.java Fri Feb 22 14:22:36 2013
@@ -19,23 +19,24 @@
package org.apache.myfaces.tobago.facelets;
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.el.LegacyMethodBinding;
-import com.sun.facelets.tag.MetaRule;
-import com.sun.facelets.tag.Metadata;
-import com.sun.facelets.tag.MetadataTarget;
-import com.sun.facelets.tag.TagAttribute;
+import org.apache.myfaces.tobago.component.MethodExpressionToMethodBinding;
import org.apache.myfaces.tobago.event.SortActionSource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.faces.event.ActionEvent;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.MetaRule;
+import javax.faces.view.facelets.Metadata;
+import javax.faces.view.facelets.MetadataTarget;
+import javax.faces.view.facelets.TagAttribute;
-/*
- * User: bommel
- * Date: 15.04.2006
- * Time: 13:53:41
- */
public class SortActionSourceRule extends MetaRule {
+
+ private static final Logger LOG = LoggerFactory.getLogger(SortActionSourceRule.class);
+
static final Class[] ACTION_LISTENER = new Class[]{ActionEvent.class};
+
public static final SortActionSourceRule INSTANCE = new SortActionSourceRule();
public Metadata applyRule(String name, TagAttribute attribute,
@@ -57,10 +58,9 @@ public class SortActionSourceRule extend
}
public void applyMetadata(FaceletContext ctx, Object instance) {
- ((SortActionSource) instance)
- .setSortActionListener(new LegacyMethodBinding(attribute
- .getMethodExpression(ctx, null,
- SortActionSourceRule.ACTION_LISTENER)));
+ LOG.error("TODO: implementation for JSF 1.2 / JSF 2.0");
+ ((SortActionSource) instance).setSortActionListener(new MethodExpressionToMethodBinding(attribute
+ .getMethodExpression(ctx, null, SortActionSourceRule.ACTION_LISTENER)));
}
}
Modified: myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/StyleHandler.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/StyleHandler.java?rev=1449056&r1=1449055&r2=1449056&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/StyleHandler.java (original)
+++ myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/StyleHandler.java Fri Feb 22 14:22:36 2013
@@ -19,37 +19,40 @@
package org.apache.myfaces.tobago.facelets;
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.tag.TextHandler;
-import com.sun.facelets.tag.jsf.ComponentConfig;
-import com.sun.facelets.tag.jsf.ComponentHandler;
import org.apache.myfaces.tobago.component.UIStyle;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import javax.faces.component.UIComponent;
-import java.util.Iterator;
+import javax.faces.view.facelets.ComponentConfig;
+import javax.faces.view.facelets.ComponentHandler;
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.FaceletHandler;
+import javax.faces.view.facelets.TextHandler;
-/*
- * Date: Feb 3, 2007
- * Time: 9:35:18 AM
- */
public class StyleHandler extends ComponentHandler {
+ private static final Logger LOG = LoggerFactory.getLogger(StyleHandler.class);
+
public StyleHandler(ComponentConfig config) {
super(config);
}
- protected void onComponentCreated(FaceletContext context, UIComponent component, UIComponent parent) {
- StringBuffer content = new StringBuffer();
- Iterator iter = findNextByType(TextHandler.class);
- while (iter.hasNext()) {
- TextHandler text = (TextHandler) iter.next();
- content.append(text.getText(context));
- }
- if (component instanceof UIStyle) {
- ((UIStyle) component).setStyle(content.toString());
+ public void onComponentCreated(FaceletContext context, UIComponent component, UIComponent parent) {
+
+ StringBuilder content = new StringBuilder();
+ final FaceletHandler next = getComponentConfig().getNextHandler();
+ if (next instanceof TextHandler) {
+ content.append(((TextHandler) next).getText(context));
+ } else {
+ // TBD: is this okay, or is here something to do?
+ // on the other side, Script inside the page is deprecated.
+ LOG.warn("Not applied for handler: " + next.getClass().getName());
}
+
+ ((UIStyle) component).setStyle(content.toString());
}
- protected void applyNextHandler(FaceletContext ctx, UIComponent c) {
+ public void applyNextHandler(FaceletContext ctx, UIComponent c) {
}
}
Modified: myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/SuggestMethodRule.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/SuggestMethodRule.java?rev=1449056&r1=1449055&r2=1449056&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/SuggestMethodRule.java (original)
+++ myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/SuggestMethodRule.java Fri Feb 22 14:22:36 2013
@@ -19,19 +19,15 @@
package org.apache.myfaces.tobago.facelets;
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.el.LegacyMethodBinding;
-import com.sun.facelets.tag.MetaRule;
-import com.sun.facelets.tag.Metadata;
-import com.sun.facelets.tag.MetadataTarget;
-import com.sun.facelets.tag.TagAttribute;
import org.apache.myfaces.tobago.component.InputSuggest;
import org.apache.myfaces.tobago.component.UIIn;
-/**
- * Date: Sep 17, 2007
- * Time: 8:59:29 PM
- */
+import javax.faces.view.facelets.FaceletContext;
+import javax.faces.view.facelets.MetaRule;
+import javax.faces.view.facelets.Metadata;
+import javax.faces.view.facelets.MetadataTarget;
+import javax.faces.view.facelets.TagAttribute;
+
public class SuggestMethodRule extends MetaRule {
static final Class[] SUGGEST_METHOD = new Class[]{javax.faces.component.UIInput.class};
public static final SuggestMethodRule INSTANCE = new SuggestMethodRule();
@@ -54,8 +50,8 @@ public class SuggestMethodRule extends M
}
public void applyMetadata(FaceletContext ctx, Object instance) {
- ((UIIn) instance).setSuggestMethod(new LegacyMethodBinding(attribute.getMethodExpression(ctx,
- null, SuggestMethodRule.SUGGEST_METHOD)));
+ ((UIIn) instance).setSuggestMethodExpression(
+ attribute.getMethodExpression(ctx, null, SuggestMethodRule.SUGGEST_METHOD));
}
}
}