Author: alexsmirnov
Date: 2007-10-19 20:34:09 -0400 (Fri, 19 Oct 2007)
New Revision: 3454
Added:
trunk/extensions/portlet/src/main/java/javax/portlet/faces/component/
trunk/extensions/portlet/src/main/java/javax/portlet/faces/component/PortletNamingContainer.java
trunk/extensions/portlet/src/main/java/javax/portlet/faces/el/
trunk/extensions/portlet/src/main/java/javax/portlet/faces/el/PortletELResolver.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/component/UIPortletViewRoot.java
trunk/samples/ajaxPortlet/src/main/webapp/jsf/edit.jspx
trunk/samples/ajaxPortlet/src/main/webapp/jsf/help.jspx
trunk/samples/ajaxPortlet/src/main/webapp/jsf/help2.jspx
trunk/samples/ajaxPortlet/src/main/webapp/jsf/xxx.jspx
Modified:
trunk/cdk/generator/src/main/resources/META-INF/templates12/faces-config.vm
trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/faces-config.vm
trunk/extensions/portlet/pom.xml
trunk/extensions/portlet/src/main/java/javax/portlet/faces/Bridge.java
trunk/extensions/portlet/src/main/java/javax/portlet/faces/GenericFacesPortlet.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/AjaxFacesPortlet.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletStateHolder.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletViewHandler.java
trunk/framework/impl/src/main/resources/META-INF/faces-config.xml
trunk/framework/pom.xml
trunk/samples/ajaxPortlet/pom.xml
trunk/samples/ajaxPortlet/src/main/webapp/WEB-INF/faces-config.xml
trunk/samples/ajaxPortlet/src/main/webapp/WEB-INF/portlet.xml
trunk/samples/pom.xml
Log:
Continue to implement JSR-301 bridge.
Modified: trunk/cdk/generator/src/main/resources/META-INF/templates12/faces-config.vm
===================================================================
--- trunk/cdk/generator/src/main/resources/META-INF/templates12/faces-config.vm 2007-10-19
13:31:55 UTC (rev 3453)
+++ trunk/cdk/generator/src/main/resources/META-INF/templates12/faces-config.vm 2007-10-20
00:34:09 UTC (rev 3454)
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces
Config 1.1//EN"
-
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
-<faces-config>
-
+<faces-config
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-facesconfig_1_2.xsd"
+ version="1.2">
${facesConfig.includeContent}
#foreach( $validator in ${validators})
Modified: trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/faces-config.vm
===================================================================
--- trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/faces-config.vm 2007-10-19
13:31:55 UTC (rev 3453)
+++ trunk/cdk/maven-cdk-plugin/src/main/resources/templates12/faces-config.vm 2007-10-20
00:34:09 UTC (rev 3454)
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces
Config 1.1//EN"
-
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
-<faces-config>
+<faces-config
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-facesconfig_1_2.xsd"
+ version="1.2">
${content}
#foreach( $kit in ${renderkits})
Modified: trunk/extensions/portlet/pom.xml
===================================================================
--- trunk/extensions/portlet/pom.xml 2007-10-19 13:31:55 UTC (rev 3453)
+++ trunk/extensions/portlet/pom.xml 2007-10-20 00:34:09 UTC (rev 3454)
@@ -1,4 +1,6 @@
-<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">
+<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">
<parent>
<artifactId>extensions</artifactId>
<groupId>org.richfaces</groupId>
@@ -10,6 +12,18 @@
<version>3.2.0-SNAPSHOT</version>
<name>ajax4jsf portlet brige</name>
<
url>http://labs.jboss.com/wiki/Ajax4jsf/a4j-portlet</url>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
<dependencies>
<dependency>
<groupId>junit</groupId>
@@ -26,13 +40,13 @@
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
- <version>1.2_04</version>
+ <version>1.2_05</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-impl</artifactId>
- <version>1.2_04</version>
+ <version>1.2_05</version>
<scope>provided</scope>
</dependency>
<dependency>
@@ -50,7 +64,7 @@
<dependency>
<groupId>com.sun.facelets</groupId>
<artifactId>jsf-facelets</artifactId>
- <version>1.1.12</version>
+ <version>1.1.14</version>
<optional>true</optional>
</dependency>
<dependency>
Modified: trunk/extensions/portlet/src/main/java/javax/portlet/faces/Bridge.java
===================================================================
--- trunk/extensions/portlet/src/main/java/javax/portlet/faces/Bridge.java 2007-10-19
13:31:55 UTC (rev 3453)
+++ trunk/extensions/portlet/src/main/java/javax/portlet/faces/Bridge.java 2007-10-20
00:34:09 UTC (rev 3454)
@@ -9,6 +9,79 @@
public interface Bridge {
+ // Base Bridge attribute/context parameter prefix
+ public static final String BRIDGE_PACKAGE_PREFIX = "javax.portlet.faces.";
+
+ // Following are the names of context init parameters that control
+ // Bridge behavior. These are specified in the web.xml
+
+ public static final String MAX_MANAGED_REQUEST_SCOPES =
+ BRIDGE_PACKAGE_PREFIX + "MAX_MANAGED_REQUEST_SCOPES";
+
+ public static final String LIFECYCLE_ID =
+ "javax.faces.LIFECYCLE_ID";;
+
+ // Attribute signifying whether this render is a postback or not.
+ public static final String IS_POSTBACK_ATTRIBUTE =
+ BRIDGE_PACKAGE_PREFIX + "isPostback";
+
+ // Special session attribute name to hold the application_scope in the
+ // portlet_scope of the session so these are accessible as well.
+ public static final String APPLICATION_SCOPE_MAP =
"javax.portlet.faces.ApplicationScopeMap";
+
+
+ // Following are the names of context attributes that a portlet can set prior
+ // to calling the bridge's init() method to control Bridge behavior.
+
+ // These attributes are scoped to a specific portlet in the context
+ // hence to acquire one must include the portlet name within attribute name:
+ // BRIDGE_PACKAGE_PREFIX + context.getPortletName() + attributeName
+
+ // if "true" indicates the bridge will preserve all the action params in
its
+ // request scope and restore them as parameters in the subsequent renders
+ public static final String PRESERVE_ACTION_PARAMS =
"preserveActionParams";
+
+ // allows a portlet to control render delgation. A value of
"ALWAYS_DELEGATE" indicates
+ // the bridge doesn't render itself, it merely delegates. A value of
"NEVER_DELEGATE"
+ // indicates the bridge never delegates, rather it always overrides and renders.
+ // A value of "DEFAULT" indicates the bridge will delegate first and only
render
+ // if the delegatee throws an exception/throwable.
+ public static final String RENDER_POLICY = "renderPolicy";
+
+
+ // Parameter that can be added to an ActionURL to signify it is a direct link
+ // and hence shouldn't be encoded by encodeActionURL as an actionURL
+ public static final String DIRECT_LINK = BRIDGE_PACKAGE_PREFIX +
"DirectLink";
+
+ // Session attribute pushed by bridge into session scope to give one access
+ // to Application scope
+ public static final String SESSION_APPLICATION_SCOPE_MAP = BRIDGE_PACKAGE_PREFIX
+ + "ApplicationScopeMap";
+
+ // Request attribute pushed by bridge in renderView to indicate it can
+ // handle a filter putting the AFTER_VIEW_CONTENT in a buffer on the request.
+ // Allows rendering order to be preserved in jsps
+ public static final String RENDER_CONTENT_AFTER_VIEW = BRIDGE_PACKAGE_PREFIX
+ + "RenderContentAfterView";
+
+ // Request attribute set by servlet filter in request/responseWrapper to
+ // place the AFTER_VIEW_CONTENT in a buffer on the request.
+ // Allows filter to transfer such content back to the bridge/renderView so
+ // if can output in correct order. Should only be done if
+ // RENDER_CONTENT_AFTER_VIEW request attribute is true.
+ public static final String AFTER_VIEW_CONTENT = BRIDGE_PACKAGE_PREFIX
+ + "AfterViewContent";
+
+
+ // Following are names of request attributes a portlet must set before
+ // calling the Bridge to process a request
+ public static final String DEFAULT_VIEWID = BRIDGE_PACKAGE_PREFIX +
"defaultViewId";
+
+ // Following are the names of request attributes the Bridge must set before
+ // acquiring its first FacesContext/FacesContextFactory in each request
+ public static final String PORTLET_LIFECYCLE_PHASE = BRIDGE_PACKAGE_PREFIX +
"phase";
+
+ public static final String PORTLET_ISNAMESPACED_PROPERTY =
"X-JAVAX-PORTLET-IS-NAMESPACED";
/**
* Name of the init parameter with maximum number of bridge request scopes
* maintained by the bridge. See JSR-301 PLT 3.2
@@ -32,6 +105,18 @@
*/
public static final String DEFAULT_VIEW_ID_ATTR =
"javax.portlet.faces.defaultViewId";
+
+ public static enum PortletPhase{
+ ActionPhase,
+ RenderPhase
+ }
+
+ public static enum BridgeRenderPolicy {
+ DEFAULT,
+ ALWAYS_DELEGATE,
+ NEVER_DELEGATE
+ }
+
/*
* (non-Javadoc)
*
@@ -52,7 +137,7 @@
* @throws PortletException
*/
public void doFacesRequest(ActionRequest request, ActionResponse response)
- throws PortletException;
+ throws BridgeException;
/**
* @param request
@@ -60,6 +145,6 @@
* @throws PortletException
*/
public void doFacesRequest(RenderRequest request, RenderResponse response)
- throws PortletException;
+ throws BridgeException;
}
\ No newline at end of file
Modified:
trunk/extensions/portlet/src/main/java/javax/portlet/faces/GenericFacesPortlet.java
===================================================================
---
trunk/extensions/portlet/src/main/java/javax/portlet/faces/GenericFacesPortlet.java 2007-10-19
13:31:55 UTC (rev 3453)
+++
trunk/extensions/portlet/src/main/java/javax/portlet/faces/GenericFacesPortlet.java 2007-10-20
00:34:09 UTC (rev 3454)
@@ -3,7 +3,11 @@
*/
package javax.portlet.faces;
+import java.io.BufferedReader;
import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.UnsupportedEncodingException;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
@@ -16,29 +20,52 @@
import javax.portlet.RenderResponse;
import javax.portlet.WindowState;
+import org.ajax4jsf.portlet.AjaxFacesPortlet;
+
/**
* JSR 301 generic faces pottlet implementation.
+ *
* @author asmirnov
- *
+ *
*/
public class GenericFacesPortlet extends GenericPortlet {
+
+ private static final String BRIDGE_SERVICE_CLASSPATH =
"META-INF/services/javax.portlet.faces.Bridge";
+ public static final String BRIDGE_CLASS =
"javax.portlet.faces.BridgeClassName";
- private String bridgeClassName = null;
- private Bridge facesPortletBrige = null;
-
+ private static final String DEFAULT_BRIDGE_CLASS = AjaxFacesPortlet.class
+ .getName();
+ private volatile String bridgeClassName = null;
+ private volatile Bridge facesPortletBrige = null;
+
public void init(PortletConfig config) throws PortletException {
super.init(config);
+ bridgeClassName = this.getPortletContext().getInitParameter(
+ BRIDGE_CLASS);
+ String renderPolicy =
+ this.getPortletConfig().getInitParameter(Bridge.BRIDGE_PACKAGE_PREFIX +
Bridge.RENDER_POLICY);
+ if (renderPolicy != null)
+ this.getPortletContext().setAttribute(Bridge.BRIDGE_PACKAGE_PREFIX +
+ this.getPortletName() + "." +
Bridge.RENDER_POLICY,
+
Bridge.BridgeRenderPolicy.valueOf(renderPolicy));
+ String preserveActionParams =
+ this.getPortletConfig().getInitParameter(Bridge.BRIDGE_PACKAGE_PREFIX +
Bridge.PRESERVE_ACTION_PARAMS);
+ if (preserveActionParams != null)
+ this.getPortletContext().setAttribute(Bridge.BRIDGE_PACKAGE_PREFIX +
+ this.getPortletName() + "." +
Bridge.PRESERVE_ACTION_PARAMS,
+
Boolean.valueOf(preserveActionParams));
}
protected void doDispatch(RenderRequest request, RenderResponse response)
throws PortletException, IOException {
PortletMode mode = request.getPortletMode();
- if( mode == PortletMode.VIEW || mode == PortletMode.EDIT || mode == PortletMode.HELP
){
- super.doDispatch(request, response);
+ if (mode == PortletMode.VIEW || mode == PortletMode.EDIT
+ || mode == PortletMode.HELP) {
+ super.doDispatch(request, response);
} else {
doFacesDispatch(request, response);
}
-
+
}
protected void doEdit(RenderRequest request, RenderResponse response)
@@ -58,43 +85,128 @@
public void processAction(ActionRequest request, ActionResponse response)
throws PortletException, IOException {
- super.processAction(request, response);
+ String defaultViewId = getDefaultViewId(request, request
+ .getPortletMode());
+ Bridge brige = getFacesPortletBrige();
+ request.setAttribute(Bridge.DEFAULT_VIEWID, defaultViewId);
+ try {
+ brige.doFacesRequest(request, response);
+
+ } catch (BridgeException e) {
+ throw new PortletException("Error process faces request", e);
+ }
}
-
- void doFacesDispatch(RenderRequest request, RenderResponse response) throws
PortletException,IOException {
- String defaultViewId = getDefaultViewId(request, request.getPortletMode());
- if(null != defaultViewId && !
request.getWindowState().equals(WindowState.MINIMIZED) ){
-
+ void doFacesDispatch(RenderRequest request, RenderResponse response)
+ throws PortletException, IOException {
+ String defaultViewId = getDefaultViewId(request, request
+ .getPortletMode());
+ if (null != defaultViewId
+ && !request.getWindowState().equals(WindowState.MINIMIZED)) {
+ Bridge brige = getFacesPortletBrige();
+ request.setAttribute(Bridge.DEFAULT_VIEWID, defaultViewId);
+ try {
+ brige.doFacesRequest(request, response);
+
+ } catch (BridgeException e) {
+ throw new PortletException("Error process faces request", e);
+ }
}
}
+
/**
* JSR 301 API method
+ *
* @return
*/
public String getBrigeClassName() {
if (bridgeClassName == null) {
-
+ ClassLoader loader = getClassLoader();
+ InputStream stream = loader
+ .getResourceAsStream(BRIDGE_SERVICE_CLASSPATH);
+ if (null != stream) {
+ try {
+ BufferedReader reader = null;
+ try {
+ reader = new BufferedReader(new InputStreamReader(
+ stream, "UTF-8"));
+ } catch (UnsupportedEncodingException e) {
+ reader = new BufferedReader(new InputStreamReader(
+ stream));
+ }
+ bridgeClassName = reader.readLine();
+ if (null != bridgeClassName) {
+ bridgeClassName.trim();
+ }
+ } catch (IOException e) {
+ // Ignore
+ } catch (SecurityException e) {
+ // Ignore
+ } finally {
+ if (null != stream) {
+ try {
+ stream.close();
+ } catch (IOException e) {
+ // Ignore
+ }
+ }
+ }
+ }
}
+ if (null == bridgeClassName) {
+ bridgeClassName = DEFAULT_BRIDGE_CLASS;
+ }
return bridgeClassName;
}
-
+
+ private ClassLoader getClassLoader() {
+ ClassLoader classLoader = Thread.currentThread()
+ .getContextClassLoader();
+ if (null == classLoader) {
+ classLoader = this.getClass().getClassLoader();
+ }
+ return classLoader;
+ }
+
public String getDefaultViewId(PortletRequest request, PortletMode mode) {
- return null;
+ return this.getPortletConfig().getInitParameter(
+ Bridge.DEFAULT_VIEWID + "." + mode.toString());
}
-
- private void initBrige(){
- if(null == facesPortletBrige){
-
- }
- }
+
public void destroy() {
bridgeClassName = null;
// If brige was initialized, destroy it.
- if(null != facesPortletBrige){
+ if (null != facesPortletBrige) {
facesPortletBrige.destroy();
facesPortletBrige = null;
}
super.destroy();
}
+
+ /**
+ * @return the facesPortletBrige
+ * @throws PortletException
+ */
+ @SuppressWarnings("unchecked")
+ protected Bridge getFacesPortletBrige() throws PortletException {
+ if (null == facesPortletBrige) {
+ String brigeClassName = getBrigeClassName();
+ try {
+ Class bridgeClass = getClassLoader().loadClass(brigeClassName);
+ facesPortletBrige = (Bridge) bridgeClass.newInstance();
+ facesPortletBrige.init(getPortletConfig());
+ } catch (ClassNotFoundException e) {
+ throw new PortletException(
+ "Class for a JSF Portlet Bridge not found", e);
+ } catch (InstantiationException e) {
+ throw new PortletException(
+ "Error on create instance of a JSF Portlet Bridge", e);
+ } catch (IllegalAccessException e) {
+ throw new PortletException(
+ "IllegalAccess on create instance of a JSF Portlet Bridge",
+ e);
+ }
+ }
+ return facesPortletBrige;
+ }
}
Added:
trunk/extensions/portlet/src/main/java/javax/portlet/faces/component/PortletNamingContainer.java
===================================================================
---
trunk/extensions/portlet/src/main/java/javax/portlet/faces/component/PortletNamingContainer.java
(rev 0)
+++
trunk/extensions/portlet/src/main/java/javax/portlet/faces/component/PortletNamingContainer.java 2007-10-20
00:34:09 UTC (rev 3454)
@@ -0,0 +1,14 @@
+/**
+ *
+ */
+package javax.portlet.faces.component;
+
+import javax.faces.component.NamingContainer;
+
+/**
+ * @author asmirnov
+ *
+ */
+public interface PortletNamingContainer extends NamingContainer {
+
+}
Property changes on:
trunk/extensions/portlet/src/main/java/javax/portlet/faces/component/PortletNamingContainer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added:
trunk/extensions/portlet/src/main/java/javax/portlet/faces/el/PortletELResolver.java
===================================================================
--- trunk/extensions/portlet/src/main/java/javax/portlet/faces/el/PortletELResolver.java
(rev 0)
+++
trunk/extensions/portlet/src/main/java/javax/portlet/faces/el/PortletELResolver.java 2007-10-20
00:34:09 UTC (rev 3454)
@@ -0,0 +1,198 @@
+/* Copyright (c) 2007, Oracle. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+
+package javax.portlet.faces.el;
+
+import java.beans.FeatureDescriptor;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.el.ELContext;
+import javax.el.ELException;
+import javax.el.ELResolver;
+import javax.el.PropertyNotFoundException;
+import javax.el.PropertyNotWritableException;
+
+import javax.faces.context.FacesContext;
+import javax.faces.context.ExternalContext;
+
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletRequest;
+
+import javax.portlet.faces.Bridge;
+
+
+public class PortletELResolver extends ELResolver {
+
+ // Important preserve index (order) between array and constants
+ public static final String[] IMPLICIT_OBJECTS = new String[] {
+ "portletConfig", "sessionApplicationScope",
"sessionPortletScope", "portletPreferenceValue",
"portletPreferenceValues" };
+
+ public static final int PORTLET_CONFIG = 0;
+ public static final int SESSION_APPLICATION_SCOPE = 1;
+ public static final int SESSION_PORTLET_SCOPE = 2;
+ public static final int PORTLET_PREFERENCE_VALUE = 3;
+ public static final int PORTLET_PREFERENCE_VALUES = 4;
+
+ public PortletELResolver() {
+ }
+
+ public Object getValue(ELContext context, Object base, Object property)
+ throws ELException {
+ // variable resolution is a special case of property resolution
+ // where the base is null.
+ if (base != null) {
+ return null;
+ }
+ if (property == null) {
+ throw new PropertyNotFoundException("Null property");
+ }
+
+ FacesContext facesContext =
+ (FacesContext) context.getContext(FacesContext.class);
+ ExternalContext extCtx = facesContext.getExternalContext();
+
+ // only process if running in a portlet request
+ if (!(extCtx.getRequest() instanceof PortletRequest)) {
+ return null;
+ }
+
+ int index = Arrays.binarySearch(IMPLICIT_OBJECTS, property);
+ if (index < 0) {
+ return null;
+ } else {
+ switch (index) {
+ case PORTLET_CONFIG:
+ context.setPropertyResolved(true);
+ return context.getContext(PortletConfig.class);
+ case SESSION_APPLICATION_SCOPE:
+ context.setPropertyResolved(true);
+ return extCtx.getSessionMap().get(Bridge.APPLICATION_SCOPE_MAP);
+ case SESSION_PORTLET_SCOPE:
+ context.setPropertyResolved(true);
+ return extCtx.getSessionMap();
+ case PORTLET_PREFERENCE_VALUE:
+ context.setPropertyResolved(true);
+ return getPreferencesValueMap(extCtx);
+ case PORTLET_PREFERENCE_VALUES:
+ context.setPropertyResolved(true);
+ return
((PortletRequest)extCtx.getRequest()).getPreferences().getMap();
+ default:
+ return null;
+ }
+ }
+ }
+
+ public void setValue(ELContext context, Object base, Object property,
+ Object val) throws ELException {
+ if (base != null) {
+ return;
+ }
+ if (property == null) {
+ throw new PropertyNotFoundException("Null property");
+ }
+
+ int index = Arrays.binarySearch(IMPLICIT_OBJECTS, property);
+ if (index >= 0) {
+ throw new PropertyNotWritableException((String)property);
+ }
+ }
+
+ public boolean isReadOnly(ELContext context, Object base, Object property)
+ throws ELException{
+ if (base != null) {
+ return false;
+ }
+ if (property == null) {
+ throw new PropertyNotFoundException("Null property");
+ }
+
+ int index = Arrays.binarySearch(IMPLICIT_OBJECTS, property);
+ if (index >= 0) {
+ context.setPropertyResolved(true);
+ return true;
+ }
+ return false;
+ }
+
+ public Class<?> getType(ELContext context, Object base, Object property)
+ throws ELException {
+ if (base != null) {
+ return null;
+ }
+ if (property == null) {
+ throw new PropertyNotFoundException("Null property");
+ }
+
+ int index = Arrays.binarySearch(IMPLICIT_OBJECTS, property);
+ if (index >= 0) {
+ context.setPropertyResolved(true);
+ }
+ return null;
+ }
+
+ public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context,
Object base) {
+ if (base != null) {
+ return null;
+ }
+ ArrayList<FeatureDescriptor> list = new
ArrayList<FeatureDescriptor>(14);
+ list.add(getFeatureDescriptor("portletConfig",
"portletConfig",
+ "portletConfig",false, false, true,
Object.class, Boolean.TRUE));
+ list.add(getFeatureDescriptor("sessionApplicationScope",
"sessionApplicationScope",
+ "sessionApplicationScope",false,
false, true, Map.class, Boolean.TRUE));
+ list.add(getFeatureDescriptor("sessionPortletScope",
"sessionPortletScope",
+ "sessionPortletScope",false, false,
true, Map.class, Boolean.TRUE));
+ list.add(getFeatureDescriptor("portletPreferenceValue",
"portletPreferenceValue",
+ "portletPreferenceValue",false,
false, true, Map.class, Boolean.TRUE));
+ list.add(getFeatureDescriptor("portletPreferenceValues",
"portletPreferenceValues",
+ "portletPreferenceValues",false,
false, true, Map.class, Boolean.TRUE));
+ return list.iterator();
+
+ }
+
+ public Class<?> getCommonPropertyType(ELContext context, Object base) {
+ if (base != null) {
+ return null;
+ }
+ return String.class;
+ }
+
+ private FeatureDescriptor getFeatureDescriptor(String name, String
+ displayName, String desc, boolean expert, boolean hidden,
+ boolean preferred, Object type, Boolean designTime) {
+
+ FeatureDescriptor fd = new FeatureDescriptor();
+ fd.setName(name);
+ fd.setDisplayName(displayName);
+ fd.setShortDescription(desc);
+ fd.setExpert(expert);
+ fd.setHidden(hidden);
+ fd.setPreferred(preferred);
+ fd.setValue(ELResolver.TYPE, type);
+ fd.setValue(ELResolver.RESOLVABLE_AT_DESIGN_TIME, designTime);
+ return fd;
+ }
+
+ private Map getPreferencesValueMap(ExternalContext extCtx) {
+ PortletRequest portletRequest = (PortletRequest) extCtx.getRequest();
+ Enumeration e = portletRequest.getPreferences().getNames();
+ Map m = null;
+
+ while (e.hasMoreElements()) {
+ if (m == null)
+ m = new HashMap();
+ String name = (String) e.nextElement();
+ String value = portletRequest.getPreferences().getValue(name, null);
+ if (value != null)
+ m.put(name, value);
+ }
+ return m;
+ }
+
+}
Property changes on:
trunk/extensions/portlet/src/main/java/javax/portlet/faces/el/PortletELResolver.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Modified:
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/AjaxFacesPortlet.java
===================================================================
---
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/AjaxFacesPortlet.java 2007-10-19
13:31:55 UTC (rev 3453)
+++
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/AjaxFacesPortlet.java 2007-10-20
00:34:09 UTC (rev 3454)
@@ -27,6 +27,8 @@
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import javax.portlet.faces.Bridge;
+import javax.portlet.faces.BridgeException;
+import javax.portlet.faces.Bridge.PortletPhase;
import javax.servlet.ServletResponse;
import org.ajax4jsf.context.AjaxContext;
@@ -60,7 +62,9 @@
*
* @see javax.portlet.GenericPortlet#init(javax.portlet.PortletConfig)
*/
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.ajax4jsf.portlet.Brige#init(javax.portlet.PortletConfig)
*/
public void init(PortletConfig config) throws PortletException {
@@ -95,7 +99,6 @@
} catch (FacesException e) {
throw new PortletException("Initialization error", e);
}
- super.init(config);
if (log.isDebugEnabled()) {
log.debug("Done portlet initialisation for "
+ config.getPortletName());
@@ -108,7 +111,9 @@
*
* @see javax.portlet.GenericPortlet#destroy()
*/
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.ajax4jsf.portlet.Brige#destroy()
*/
public void destroy() {
@@ -123,75 +128,56 @@
/*
* (non-Javadoc)
*
- * @see javax.portlet.GenericPortlet#processAction(javax.portlet.ActionRequest,
+ * @see org.ajax4jsf.portlet.Brige#doFacesRequest(javax.portlet.ActionRequest,
* javax.portlet.ActionResponse)
*/
- public void processAction(ActionRequest request, ActionResponse response)
- throws PortletException, IOException {
- if (log.isDebugEnabled()) {
- log.debug("Process action in portlet "
- + getPortletConfig().getPortletName() + " for mode "
- + request.getPortletMode());
- }
- doFacesRequest(request, response);
- }
-
- /* (non-Javadoc)
- * @see org.ajax4jsf.portlet.Brige#doFacesRequest(javax.portlet.ActionRequest,
javax.portlet.ActionResponse)
- */
public void doFacesRequest(ActionRequest request, ActionResponse response)
- throws PortletException {
+ throws BridgeException {
+ initRequest(request,response,Bridge.PortletPhase.ActionPhase);
FacesContext facesContext = getFacesContext(request, response);
try {
- // setViewId(facesContext);
execute(facesContext);
// saveView(facesContext);
} catch (Exception e) {
log.error("Error processing execute lifecycle", e);
- throw new PortletException("Error processing execute lifecycle ", e);
+ throw new BridgeException("Error processing execute lifecycle ", e);
} finally {
facesContext.release();
}
}
+
+
/*
* (non-Javadoc)
*
- * @see javax.portlet.GenericPortlet#doView(javax.portlet.RenderRequest,
+ * @see org.ajax4jsf.portlet.Brige#doFacesRequest(javax.portlet.RenderRequest,
* javax.portlet.RenderResponse)
*/
- protected void doView(RenderRequest request, RenderResponse response)
- throws PortletException, IOException {
- if (log.isDebugEnabled()) {
- log.debug("Process do view in portlet "
- + getPortletConfig().getPortletName());
- }
- doFacesRequest(request, response);
- }
+ public void doFacesRequest(RenderRequest request, RenderResponse response)
+ throws BridgeException {
+ initRequest(request,response,Bridge.PortletPhase.RenderPhase);
- /* (non-Javadoc)
- * @see org.ajax4jsf.portlet.Brige#doFacesRequest(javax.portlet.RenderRequest,
javax.portlet.RenderResponse)
- */
- public void doFacesRequest(RenderRequest request, RenderResponse response)
- throws PortletException {
FacesContext facesContext = getFacesContext(request, response);
try {
- String contenttype = request.getResponseContentType();
- if (contenttype == null) {
- contenttype = "text/html";
+ if (null == response.getContentType()) {
+ String contenttype = request.getResponseContentType();
+ if (contenttype == null) {
+ contenttype = "text/html";
+ }
+ String encoding = response.getCharacterEncoding();
+ if (encoding == null) {
+ encoding = "UTF-8";
+ }
+ response.setContentType(contenttype);
+
}
- String encoding = response.getCharacterEncoding();
- if (encoding == null) {
- encoding = "UTF-8";
- }
- response.setContentType(contenttype);
PrintWriter writer = response.getWriter();
String namespace = response.getNamespace();
// Write anchor for update portlet pages by ajax.
// TODO - configure html element and style/class.
writer.println("<div id='" + namespace + "'>");
// writer.flush();
- // restoreView(facesContext);
AjaxContext ajaxContext = AjaxContext
.getCurrentInstance(facesContext);
ajaxContext.getCommonAjaxParameters().put(
@@ -221,15 +207,57 @@
response.setProperty(RenderResponse.EXPIRATION_CACHE, "0");
} catch (Exception e) {
log.error("Error processing execute lifecycle", e);
- throw new PortletException("Error processing execute lifecycle ", e);
+ throw new BridgeException("Error processing execute lifecycle ", e);
} finally {
facesContext.release();
}
}
+ /**
+ * @param request
+ * @param response
+ * @param actionPhase
+ * @throws BridgeException
+ */
+ protected void initRequest(PortletRequest request, PortletResponse response,
+ PortletPhase actionPhase) throws BridgeException {
+
+ }
+
/*
* (non-Javadoc)
*
+ * @see javax.portlet.GenericPortlet#processAction(javax.portlet.ActionRequest,
+ * javax.portlet.ActionResponse)
+ */
+ public void processAction(ActionRequest request, ActionResponse response)
+ throws PortletException, IOException {
+ if (log.isDebugEnabled()) {
+ log.debug("Process action in portlet "
+ + getPortletConfig().getPortletName() + " for mode "
+ + request.getPortletMode());
+ }
+ doFacesRequest(request, response);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.portlet.GenericPortlet#doView(javax.portlet.RenderRequest,
+ * javax.portlet.RenderResponse)
+ */
+ protected void doView(RenderRequest request, RenderResponse response)
+ throws PortletException, IOException {
+ if (log.isDebugEnabled()) {
+ log.debug("Process do view in portlet "
+ + getPortletConfig().getPortletName());
+ }
+ doFacesRequest(request, response);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
* @see javax.portlet.GenericPortlet#doEdit(javax.portlet.RenderRequest,
* javax.portlet.RenderResponse)
*/
Modified:
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletStateHolder.java
===================================================================
---
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletStateHolder.java 2007-10-19
13:31:55 UTC (rev 3453)
+++
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletStateHolder.java 2007-10-20
00:34:09 UTC (rev 3454)
@@ -13,6 +13,8 @@
import javax.portlet.PortletConfig;
import javax.portlet.PortletMode;
import javax.portlet.PortletRequest;
+import javax.portlet.faces.Bridge;
+import javax.portlet.faces.BridgeDefaultViewNotSpecifiedException;
import org.ajax4jsf.portlet.AjaxFacesPortlet;
import org.ajax4jsf.portlet.context.AbstractExternalContext;
@@ -99,21 +101,10 @@
// If none of above happen, try to get default viewId for a current
// mode.
if (null == viewId) {
- PortletConfig config = (PortletConfig) context.getExternalContext()
- .getRequestMap().get(AjaxFacesPortlet.PORTLET_CONFIG);
- if (null != config) {
- PortletMode portletMode = AjaxFacesPortlet
- .getPortletMode(context);
- if (null == portletMode) {
- portletMode = lastMode;
- }
- viewId = config.getInitParameter(DEFAULT
- + portletMode.toString().toLowerCase());
- }
-
+ viewId = (String)
context.getExternalContext().getRequestMap().get(Bridge.DEFAULT_VIEWID);
}
if (null == viewId) {
- throw new FacesException("could'n determine portlet view id");
+ throw new BridgeDefaultViewNotSpecifiedException("could'n determine portlet
view id");
}
return viewId;
}
Modified:
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletViewHandler.java
===================================================================
---
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletViewHandler.java 2007-10-19
13:31:55 UTC (rev 3453)
+++
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletViewHandler.java 2007-10-20
00:34:09 UTC (rev 3454)
@@ -15,6 +15,7 @@
import org.ajax4jsf.application.AjaxViewHandler;
import org.ajax4jsf.context.AjaxContext;
+import org.ajax4jsf.portlet.component.UIPortletViewRoot;
import org.ajax4jsf.portlet.context.AbstractExternalContext;
/**
@@ -37,7 +38,7 @@
public UIViewRoot createView(FacesContext facesContext, String viewId) {
AjaxContext ajaxContext = AjaxContext.getCurrentInstance(facesContext);
boolean ajaxRequest = ajaxContext.isAjaxRequest(facesContext);
- UIViewRoot root = super.createView(facesContext, viewId);
+ UIViewRoot root = new UIPortletViewRoot(super.createView(facesContext, viewId));
if(ajaxRequest && null != ajaxContext.getViewIdHolder()){
// Store new viewId for a portlet.
}
Added:
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/component/UIPortletViewRoot.java
===================================================================
---
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/component/UIPortletViewRoot.java
(rev 0)
+++
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/component/UIPortletViewRoot.java 2007-10-20
00:34:09 UTC (rev 3454)
@@ -0,0 +1,43 @@
+/**
+ *
+ */
+package org.ajax4jsf.portlet.component;
+
+import java.io.Serializable;
+
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.portlet.faces.component.PortletNamingContainer;
+
+import org.ajax4jsf.component.AjaxViewRoot;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class UIPortletViewRoot extends AjaxViewRoot implements
+ PortletNamingContainer, Serializable {
+
+ /**
+ *
+ */
+ public UIPortletViewRoot(UIViewRoot viewRootToReplace) {
+ super();
+ setViewId(viewRootToReplace.getViewId());
+ setLocale(viewRootToReplace.getLocale());
+ setRenderKitId(viewRootToReplace.getRenderKitId());
+ }
+
+ @Override
+ public String getContainerClientId(FacesContext context) {
+ String containerClientId = super.getContainerClientId(context);
+ ExternalContext externalContext = context.getExternalContext();
+ if(null == containerClientId){
+ containerClientId = externalContext.encodeNamespace("");
+ } else {
+ containerClientId =
externalContext.encodeNamespace(SEPARATOR_CHAR+containerClientId);
+ }
+ return containerClientId;
+ }
+}
Property changes on:
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/component/UIPortletViewRoot.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Modified: trunk/framework/impl/src/main/resources/META-INF/faces-config.xml
===================================================================
--- trunk/framework/impl/src/main/resources/META-INF/faces-config.xml 2007-10-19 13:31:55
UTC (rev 3453)
+++ trunk/framework/impl/src/main/resources/META-INF/faces-config.xml 2007-10-20 00:34:09
UTC (rev 3454)
@@ -1,10 +1,8 @@
<?xml version="1.0"?>
-<!DOCTYPE faces-config PUBLIC
- "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
- "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
-
-
-<faces-config>
+<faces-config
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-facesconfig_1_2.xsd"
+ version="1.2">
<factory>
<render-kit-factory>org.ajax4jsf.renderkit.ChameleonRenderKitFactory</render-kit-factory>
<lifecycle-factory>org.ajax4jsf.application.DebugLifecycleFactory</lifecycle-factory>
Modified: trunk/framework/pom.xml
===================================================================
--- trunk/framework/pom.xml 2007-10-19 13:31:55 UTC (rev 3453)
+++ trunk/framework/pom.xml 2007-10-20 00:34:09 UTC (rev 3454)
@@ -94,9 +94,9 @@
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>javax.servlet</groupId>
+ <groupId>jstl</groupId>
<artifactId>jstl</artifactId>
- <version>1.1.2</version>
+ <version>1.2</version>
<scope>provided</scope>
</dependency>
<dependency>
Modified: trunk/samples/ajaxPortlet/pom.xml
===================================================================
--- trunk/samples/ajaxPortlet/pom.xml 2007-10-19 13:31:55 UTC (rev 3453)
+++ trunk/samples/ajaxPortlet/pom.xml 2007-10-20 00:34:09 UTC (rev 3454)
@@ -47,13 +47,13 @@
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
- <version>1.2_04</version>
+ <version>1.2_05</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-impl</artifactId>
- <version>1.2_04</version>
+ <version>1.2_05</version>
<scope>provided</scope>
</dependency>
</dependencies>
Modified: trunk/samples/ajaxPortlet/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/samples/ajaxPortlet/src/main/webapp/WEB-INF/faces-config.xml 2007-10-19 13:31:55
UTC (rev 3453)
+++ trunk/samples/ajaxPortlet/src/main/webapp/WEB-INF/faces-config.xml 2007-10-20 00:34:09
UTC (rev 3454)
@@ -7,6 +7,21 @@
<managed-bean-class>portal.Bean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
+ <managed-bean>
+ <managed-bean-name>helpbean</managed-bean-name>
+ <managed-bean-class>portal.Bean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>editbean</managed-bean-name>
+ <managed-bean-class>portal.Bean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>requestbean</managed-bean-name>
+ <managed-bean-class>portal.Bean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
<navigation-rule>
<from-view-id>/jsf/start.xhtml</from-view-id>
<navigation-case>
@@ -21,6 +36,36 @@
<to-view-id>/jsf/start.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
+ <!-- Help pages navigation -->
+ <navigation-rule>
+ <from-view-id>/jsf/help.jspx</from-view-id>
+ <navigation-case>
+ <from-outcome>help2</from-outcome>
+ <to-view-id>/jsf/help2.jspx</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/jsf/help2.jspx</from-view-id>
+ <navigation-case>
+ <from-outcome>start</from-outcome>
+ <to-view-id>/jsf/help.jspx</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <!-- Edit mode navigation -->
+ <navigation-rule>
+ <from-view-id>/jsf/edit.jspx</from-view-id>
+ <navigation-case>
+ <from-outcome>edit2</from-outcome>
+ <to-view-id>/jsf/edit2.jspx</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+ <navigation-rule>
+ <from-view-id>/jsf/edit2.jspx</from-view-id>
+ <navigation-case>
+ <from-outcome>start</from-outcome>
+ <to-view-id>/jsf/edit.jspx</to-view-id>
+ </navigation-case>
+ </navigation-rule>
<application>
<view-handler>
org.ajax4jsf.portlet.application.PortletViewHandler
Modified: trunk/samples/ajaxPortlet/src/main/webapp/WEB-INF/portlet.xml
===================================================================
--- trunk/samples/ajaxPortlet/src/main/webapp/WEB-INF/portlet.xml 2007-10-19 13:31:55 UTC
(rev 3453)
+++ trunk/samples/ajaxPortlet/src/main/webapp/WEB-INF/portlet.xml 2007-10-20 00:34:09 UTC
(rev 3454)
@@ -3,21 +3,25 @@
xmlns="http://java.sun.com/xml/ns/portlet">
<portlet>
<portlet-name>ajaxPortlet</portlet-name>
- <portlet-class>org.ajax4jsf.portlet.AjaxFacesPortlet</portlet-class>
- <init-param>
- <name>default-view</name>
- <value>/jsf/start.xhtml</value>
- </init-param>
- <!--
- <init-param>
- <name>default-edit</name>
- <value>/jsf/start-edit.xhtml</value>
- </init-param>
- <init-param>
- <name>default-help</name>
- <value>/jsf/start-help.xhtml</value>
- </init-param>
- -->
+ <portlet-class>
+ javax.portlet.faces.GenericFacesPortlet
+ </portlet-class>
+
+ <init-param>
+ <name>javax.portlet.faces.defaultViewId.view</name>
+ <value>/jsf/start.xhtml</value>
+ </init-param>
+
+ <init-param>
+ <name>javax.portlet.faces.defaultViewId.edit</name>
+ <value>/jsf/edit.jspx</value>
+ </init-param>
+
+ <init-param>
+ <name>javax.portlet.faces.defaultViewId.help</name>
+ <value>/jsf/help.jspx</value>
+ </init-param>
+
<expiration-cache>-0</expiration-cache>
<portlet-info>
<title>Ajax Portlet</title>
@@ -25,10 +29,8 @@
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
- <!--
<portlet-mode>EDIT</portlet-mode>
<portlet-mode>HELP</portlet-mode>
- -->
</supports>
</portlet>
</portlet-app>
Added: trunk/samples/ajaxPortlet/src/main/webapp/jsf/edit.jspx
===================================================================
--- trunk/samples/ajaxPortlet/src/main/webapp/jsf/edit.jspx (rev
0)
+++ trunk/samples/ajaxPortlet/src/main/webapp/jsf/edit.jspx 2007-10-20 00:34:09 UTC (rev
3454)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<jsp:root
xmlns:jsp="http://java.sun.com/JSP/Page"
version="2.0">
+<f:view
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+ >
+
+ <h:form id="portlet_form">
+ <h2>EDIT mode portlet</h2>
+ <h:panelGrid columns="2">
+ <h:inputText value="#{bean.text}" id="repeaterText">
+ <f:validateLength maximum="5" />
+ </h:inputText>
+ <h:outputText id="text" value="#{bean.text}"/>
+ <h:message for="repeaterText"/>
+ <h:commandLink value="Increment counter" action="#{bean.click}"
/>
+ <h:outputText id="counter" value="#{bean.counter}"/>
+ <h:outputText value="Portlet namespace:"/>
+ <h:outputText value="#{bean.namespace}"/>
+ <h:commandButton action="repeater" value="Switch to repeater
page" />
+ </h:panelGrid>
+ </h:form>
+
+</f:view>
+</jsp:root>
\ No newline at end of file
Property changes on: trunk/samples/ajaxPortlet/src/main/webapp/jsf/edit.jspx
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/samples/ajaxPortlet/src/main/webapp/jsf/help.jspx
===================================================================
--- trunk/samples/ajaxPortlet/src/main/webapp/jsf/help.jspx (rev
0)
+++ trunk/samples/ajaxPortlet/src/main/webapp/jsf/help.jspx 2007-10-20 00:34:09 UTC (rev
3454)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<jsp:root
xmlns:jsp="http://java.sun.com/JSP/Page"
version="2.0">
+ <f:view
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:p="http://java.sun.com/jsf/portlet/components">
+ <p:portletPage>
+ <h:form id="portlet_form">
+ <h2>HELP mode portlet</h2>
+ <h:panelGrid columns="2">
+ <h:inputText value="#{helpbean.text}" id="repeaterText">
+ <f:validateLength maximum="5" />
+ </h:inputText>
+ <h:outputText id="text" value="#{helpbean.text}" />
+
+ <h:commandLink value="Increment counter"
action="#{helpbean.click}" />
+ <h:outputText id="counter" value="#{helpbean.counter}" />
+
+ <h:outputText value="Portlet namespace:" />
+ <h:outputText value="#{helpbean.namespace}" />
+ <h:commandButton action="help2"
+ value="Switch to second HELP page" />
+ </h:panelGrid>
+ <h:message for="repeaterText" />
+ </h:form>
+ </p:portletPage>
+ </f:view>
+</jsp:root>
\ No newline at end of file
Property changes on: trunk/samples/ajaxPortlet/src/main/webapp/jsf/help.jspx
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/samples/ajaxPortlet/src/main/webapp/jsf/help2.jspx
===================================================================
--- trunk/samples/ajaxPortlet/src/main/webapp/jsf/help2.jspx (rev
0)
+++ trunk/samples/ajaxPortlet/src/main/webapp/jsf/help2.jspx 2007-10-20 00:34:09 UTC (rev
3454)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<jsp:root
xmlns:jsp="http://java.sun.com/JSP/Page"
version="2.0">
+ <f:view
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:p="http://java.sun.com/jsf/portlet/components">
+ <p:portletPage>
+ <h:form id="portlet_form">
+ <h2>HELP mode portlet - page 2</h2>
+ <h:panelGrid columns="2">
+ <h:inputText value="#{helpbean.text}" id="repeaterText">
+ <f:validateLength maximum="5" />
+ </h:inputText>
+ <h:outputText id="text" value="#{helpbean.text}" />
+
+
+ <h:outputText value="Portlet can have help page:" />
+ <h:outputText value="This is continue portlet help" />
+ <h:commandButton action="start"
+ value="Switch to first HELP page" />
+ </h:panelGrid>
+ <h:message for="repeaterText" />
+ </h:form>
+ </p:portletPage>
+ </f:view>
+</jsp:root>
\ No newline at end of file
Property changes on: trunk/samples/ajaxPortlet/src/main/webapp/jsf/help2.jspx
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/samples/ajaxPortlet/src/main/webapp/jsf/xxx.jspx
===================================================================
--- trunk/samples/ajaxPortlet/src/main/webapp/jsf/xxx.jspx (rev
0)
+++ trunk/samples/ajaxPortlet/src/main/webapp/jsf/xxx.jspx 2007-10-20 00:34:09 UTC (rev
3454)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<jsp:root
xmlns:jsp="http://java.sun.com/JSP/Page"
version="2.0">
+ <jsp:directive.page language="java"
+ contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"
/>
+ <jsp:text>
+ <![CDATA[ <?xml version="1.0" encoding="UTF-8" ?>
]]>
+ </jsp:text>
+ <jsp:text>
+ <![CDATA[ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ]]>
+ </jsp:text>
+<html
xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
/>
+<title>Insert title here</title>
+</head>
+<body>
+
+</body>
+</html>
+</jsp:root>
\ No newline at end of file
Property changes on: trunk/samples/ajaxPortlet/src/main/webapp/jsf/xxx.jspx
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/samples/pom.xml
===================================================================
--- trunk/samples/pom.xml 2007-10-19 13:31:55 UTC (rev 3453)
+++ trunk/samples/pom.xml 2007-10-20 00:34:09 UTC (rev 3454)
@@ -80,7 +80,7 @@
<dependency>
<groupId>com.sun.facelets</groupId>
<artifactId>jsf-facelets</artifactId>
- <version>1.1.12</version>
+ <version>1.1.14</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
@@ -93,6 +93,12 @@
<artifactId>nekohtml</artifactId>
<version>0.9.5</version>
<scope>runtime</scope>
+ <exclusions>
+ <exclusion>
+ <artifactId>xerces</artifactId>
+ <groupId>xerces</groupId>
+ </exclusion>
+ </exclusions>
</dependency>
</dependencies>
<profiles>