[richfaces-svn-commits] JBoss Rich Faces SVN: r4833 - in trunk: extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context and 6 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Thu Dec 13 17:33:56 EST 2007


Author: alexsmirnov
Date: 2007-12-13 17:33:55 -0500 (Thu, 13 Dec 2007)
New Revision: 4833

Modified:
   trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/application/PortletViewState.java
   trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/AbstractExternalContext.java
   trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/FacesContextFactoryImpl.java
   trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/FacesContextImpl.java
   trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/PortletContextImpl.java
   trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/PortletRenderContextImpl.java
   trunk/framework/impl/pom.xml
   trunk/framework/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java
   trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/HeaderResourcesRendererBase.java
   trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/components.xml
   trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/book.xhtml
   trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/home.xhtml
   trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/main.xhtml
   trunk/ui/assembly/pom.xml
Log:
Create aggregated JavaScript files, and test it.
Fix some portal-seam issues.


Modified: trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/application/PortletViewState.java
===================================================================
--- trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/application/PortletViewState.java	2007-12-13 21:00:40 UTC (rev 4832)
+++ trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/application/PortletViewState.java	2007-12-13 22:33:55 UTC (rev 4833)
@@ -51,11 +51,11 @@
 			javax.servlet.ServletContext.class,
 			javax.servlet.ServletRequest.class,
 			javax.servlet.ServletResponse.class,
-			javax.servlet.http.HttpSession.class,
-			AjaxContext.class};
+			javax.servlet.http.HttpSession.class, AjaxContext.class };
 
 	private static final String[] excludedRequestAttributes = {
-			"javax.servlet.include", ResponseStateManager.VIEW_STATE_PARAM, AbstractExternalContext.EXCLUDED_PARAMETERS_ATTRIBUTE };
+			"javax.servlet.include", ResponseStateManager.VIEW_STATE_PARAM,
+			AbstractExternalContext.EXCLUDED_PARAMETERS_ATTRIBUTE };
 
 	public static final String REQUEST_PARAMETERS_ATTRIBUTE = PortletViewState.class
 			.getName()
@@ -69,15 +69,12 @@
 
 	private Object componentsState;
 
-	private UIViewRoot viewRoot;
+	private transient UIViewRoot viewRoot;
 
 	private String viewId;
 
-
 	private Map<String, String[]> _requestParameters;
 
-
-
 	/**
 	 * @return the viewId
 	 */
@@ -218,7 +215,8 @@
 		beans = null;
 		Map<String, Object> requestMap = facesContext.getExternalContext()
 				.getRequestMap();
-		List existingAttributes = (List) requestMap.get(AbstractExternalContext.EXCLUDED_PARAMETERS_ATTRIBUTE);
+		List existingAttributes = (List) requestMap
+				.get(AbstractExternalContext.EXCLUDED_PARAMETERS_ATTRIBUTE);
 		if (null == existingAttributes) {
 			existingAttributes = Collections.EMPTY_LIST;
 		}
@@ -249,6 +247,17 @@
 		}
 		_requestParameters = new HashMap<String, String[]>(facesContext
 				.getExternalContext().getRequestParameterValuesMap());
+		// Seam hack - save conversation Id for a request parameter.
+		try {
+			Object conversationId = facesContext.getApplication()
+					.evaluateExpressionGet(facesContext, "#{conversation.id}",
+							Object.class);
+			if(null != conversationId){
+				_requestParameters.put("conversationId", new String[]{conversationId.toString()});
+			}
+		} catch (Exception e) {
+			// Do nothing - no seam conversation found !
+		}
 	}
 
 	public void restoreBeans(FacesContext facesContext) {
@@ -270,13 +279,17 @@
 			restoreBeans(facesContext);
 		}
 		String viewId = getViewId();
-		if(null == viewId && Bridge.PortletPhase.ActionPhase.equals(requestMap.get(Bridge.PORTLET_LIFECYCLE_PHASE))){
-			viewId = (String) externalContext.getRequestParameterMap().get(AbstractExternalContext.VIEW_ID_PARAMETER);
+		if (null == viewId
+				&& Bridge.PortletPhase.ActionPhase.equals(requestMap
+						.get(Bridge.PORTLET_LIFECYCLE_PHASE))) {
+			viewId = (String) externalContext.getRequestParameterMap().get(
+					AbstractExternalContext.VIEW_ID_PARAMETER);
 		}
 		if (null == viewId) {
 			viewId = (String) requestMap.get(Bridge.DEFAULT_VIEWID);
 			if (null == viewId) {
-				throw new BridgeDefaultViewNotSpecifiedException("could'n determine portlet view id");
+				throw new BridgeDefaultViewNotSpecifiedException(
+						"could'n determine portlet view id");
 			}
 		} else {
 			requestMap.put(Bridge.IS_POSTBACK_ATTRIBUTE, Boolean.TRUE);

Modified: trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/AbstractExternalContext.java
===================================================================
--- trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/AbstractExternalContext.java	2007-12-13 21:00:40 UTC (rev 4832)
+++ trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/AbstractExternalContext.java	2007-12-13 22:33:55 UTC (rev 4833)
@@ -133,8 +133,24 @@
 	private Map actionSettings;
 
 	private Object context;
+	
+	private boolean hasNavigationRedirect = false;
 
 	/**
+	 * @return the hasNavigationRedirect
+	 */
+	boolean isHasNavigationRedirect() {
+		return hasNavigationRedirect;
+	}
+
+	/**
+	 * @param hasNavigationRedirect the hasNavigationRedirect to set
+	 */
+	void setHasNavigationRedirect(boolean hasNavigationRedirect) {
+		this.hasNavigationRedirect = hasNavigationRedirect;
+	}
+
+	/**
 	 * 
 	 * @param context
 	 * @param request

Modified: trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/FacesContextFactoryImpl.java
===================================================================
--- trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/FacesContextFactoryImpl.java	2007-12-13 21:00:40 UTC (rev 4832)
+++ trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/FacesContextFactoryImpl.java	2007-12-13 22:33:55 UTC (rev 4833)
@@ -133,7 +133,7 @@
 			throw new NullPointerException(
 					"One or more parameters for a faces context instantiation is null");
 		}
-		ExternalContext externalContext;
+		AbstractExternalContext externalContext;
 		if ((context instanceof PortletContext)
 				&& (request instanceof ActionRequest)
 				&& (response instanceof ActionResponse)) {

Modified: trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/FacesContextImpl.java
===================================================================
--- trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/FacesContextImpl.java	2007-12-13 21:00:40 UTC (rev 4832)
+++ trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/FacesContextImpl.java	2007-12-13 22:33:55 UTC (rev 4833)
@@ -79,307 +79,314 @@
 
 /**
  * 
- * Implementation for <code>FacesContext</code> in Portlet Environment. 
+ * Implementation for <code>FacesContext</code> in Portlet Environment.
+ * 
  * @author shura
  * 
  * 
  */
 public class FacesContextImpl extends FacesContext {
-    
-    private boolean released = true;
 
-    private boolean renderResponse;
+	private boolean released = true;
 
-    private boolean responseComplete;
+	private boolean renderResponse;
 
-    private Application application;
+	private boolean responseComplete;
 
-    private UIViewRoot viewRoot;
+	private Application application;
 
-    private Map messages;
+	private UIViewRoot viewRoot;
 
-    private ExternalContext externalContext;
+	private Map messages;
 
-    private Lifecycle lifecycle;
+	private AbstractExternalContext externalContext;
 
-    private ResponseWriter responseWriter;
+	private Lifecycle lifecycle;
 
-    private ResponseStream responseStream;
+	private ResponseWriter responseWriter;
 
-    private ELContext elContext;
+	private ResponseStream responseStream;
 
-    public FacesContextImpl(ExternalContext externalContext, Lifecycle lifecycle) {
-	super();
-	setCurrentInstance(this);
-	this.externalContext = externalContext;
-	this.lifecycle = lifecycle;
-	this.released = false;
-    }
+	private ELContext elContext;
 
-    /*
-         * 
-         * (non-Javadoc)
-         * 
-         * 
-         * 
-         * @see org.apache.cocoon.components.faces.context.CocoonFacesContext#getLifecycle()
-         * 
-         */
-    public Lifecycle getLifecycle() {
-	checkReleased();
-	return this.lifecycle;
-    }
+	public FacesContextImpl(AbstractExternalContext externalContext,
+			Lifecycle lifecycle) {
+		super();
+		setCurrentInstance(this);
+		this.externalContext = externalContext;
+		this.lifecycle = lifecycle;
+		this.released = false;
+	}
 
-    public ELContext getELContext() {
-	checkReleased();
-	if (this.elContext == null) {
-	    Application application = getApplication();
-	    this.elContext = new ELContextImpl(application.getELResolver());
-	    this.elContext.putContext(FacesContext.class, this);
-	    UIViewRoot root = getViewRoot();
-	    if (null != root) {
-		this.elContext.setLocale(root.getLocale());
-	    }
+	/*
+	 * 
+	 * (non-Javadoc)
+	 * 
+	 * 
+	 * 
+	 * @see org.apache.cocoon.components.faces.context.CocoonFacesContext#getLifecycle()
+	 * 
+	 */
+	public Lifecycle getLifecycle() {
+		checkReleased();
+		return this.lifecycle;
 	}
-	return this.elContext;
-    }
 
-    /*
-         * 
-         * (non-Javadoc)
-         * 
-         * 
-         * 
-         * @see javax.faces.context.FacesContext#getExternalContext()
-         * 
-         */
-    public ExternalContext getExternalContext() {
-	checkReleased();
-	return this.externalContext;
-    }
+	public ELContext getELContext() {
+		checkReleased();
+		if (this.elContext == null) {
+			Application application = getApplication();
+			this.elContext = new ELContextImpl(application.getELResolver());
+			this.elContext.putContext(FacesContext.class, this);
+			UIViewRoot root = getViewRoot();
+			if (null != root) {
+				this.elContext.setLocale(root.getLocale());
+			}
+		}
+		return this.elContext;
+	}
 
-    /**
-         * 
-         * @param externalContext
-         * 
-         * The externalContext to set.
-         * 
-         */
-    // public void setExternalContext(ExternalContext externalContext) {
-    // this.externalContext = externalContext;
-    // }
-    /*
-         * 
-         * (non-Javadoc)
-         * 
-         * 
-         * 
-         * @see javax.faces.context.FacesContext#getResponseStream()
-         * 
-         */
-    public ResponseStream getResponseStream() {
-	checkReleased();
-	return this.responseStream;
-    }
+	/*
+	 * 
+	 * (non-Javadoc)
+	 * 
+	 * 
+	 * 
+	 * @see javax.faces.context.FacesContext#getExternalContext()
+	 * 
+	 */
+	public ExternalContext getExternalContext() {
+		checkReleased();
+		return this.externalContext;
+	}
 
-    /*
-         * 
-         * (non-Javadoc)
-         * 
-         * 
-         * 
-         * @see javax.faces.context.FacesContext#setResponseStream(javax.faces.context.ResponseStream)
-         * 
-         */
-    public void setResponseStream(ResponseStream responseStream) {
-	checkReleased();
-	this.responseStream = responseStream;
-    }
+	/**
+	 * 
+	 * @param externalContext
+	 * 
+	 * The externalContext to set.
+	 * 
+	 */
+	// public void setExternalContext(ExternalContext externalContext) {
+	// this.externalContext = externalContext;
+	// }
+	/*
+	 * 
+	 * (non-Javadoc)
+	 * 
+	 * 
+	 * 
+	 * @see javax.faces.context.FacesContext#getResponseStream()
+	 * 
+	 */
+	public ResponseStream getResponseStream() {
+		checkReleased();
+		return this.responseStream;
+	}
 
-    /*
-         * 
-         * (non-Javadoc)
-         * 
-         * 
-         * 
-         * @see javax.faces.context.FacesContext#getResponseWriter()
-         * 
-         */
-    public ResponseWriter getResponseWriter() {
-	checkReleased();
-	return this.responseWriter;
-    }
+	/*
+	 * 
+	 * (non-Javadoc)
+	 * 
+	 * 
+	 * 
+	 * @see javax.faces.context.FacesContext#setResponseStream(javax.faces.context.ResponseStream)
+	 * 
+	 */
+	public void setResponseStream(ResponseStream responseStream) {
+		checkReleased();
+		this.responseStream = responseStream;
+	}
 
-    /*
-         * 
-         * (non-Javadoc)
-         * 
-         * 
-         * 
-         * @see javax.faces.context.FacesContext#setResponseWriter(javax.faces.context.ResponseWriter)
-         * 
-         */
-    public void setResponseWriter(ResponseWriter responseWriter) {
-	checkReleased();
-	this.responseWriter = responseWriter;
-    }
+	/*
+	 * 
+	 * (non-Javadoc)
+	 * 
+	 * 
+	 * 
+	 * @see javax.faces.context.FacesContext#getResponseWriter()
+	 * 
+	 */
+	public ResponseWriter getResponseWriter() {
+		checkReleased();
+		return this.responseWriter;
+	}
 
-    /*
-         * 
-         * (non-Javadoc)
-         * 
-         * 
-         * 
-         * @see javax.faces.context.FacesContext#release()
-         * 
-         */
-    public void release() {
-	// Release this and default instances...
-	this.released = true;
-	FacesContext.setCurrentInstance(null);
-	// defaultContext = null;
-	this.lifecycle = null;
-	this.externalContext = null;
-	this.responseWriter = null;
-	this.application = null;
-	this.viewRoot = null;
-	this.messages = null;
-	this.responseWriter = null;
-    }
+	/*
+	 * 
+	 * (non-Javadoc)
+	 * 
+	 * 
+	 * 
+	 * @see javax.faces.context.FacesContext#setResponseWriter(javax.faces.context.ResponseWriter)
+	 * 
+	 */
+	public void setResponseWriter(ResponseWriter responseWriter) {
+		checkReleased();
+		this.responseWriter = responseWriter;
+	}
 
-    public Application getApplication() {
-	checkReleased();
-	if (this.application == null) {
-	    ApplicationFactory aFactory = (ApplicationFactory) FactoryFinder
-		    .getFactory(FactoryFinder.APPLICATION_FACTORY);
-	    this.application = aFactory.getApplication();
+	/*
+	 * 
+	 * (non-Javadoc)
+	 * 
+	 * 
+	 * 
+	 * @see javax.faces.context.FacesContext#release()
+	 * 
+	 */
+	public void release() {
+		// Release this and default instances...
+		this.released = true;
+		FacesContext.setCurrentInstance(null);
+		// defaultContext = null;
+		this.lifecycle = null;
+		this.externalContext = null;
+		this.responseWriter = null;
+		this.application = null;
+		this.viewRoot = null;
+		this.messages = null;
+		this.responseWriter = null;
 	}
-	return this.application;
-    }
 
-    public Iterator getClientIdsWithMessages() {
-	checkReleased();
-	if (this.messages == null) {
-	    return Collections.EMPTY_LIST.iterator();
-	} else {
-	    return this.messages.keySet().iterator();
+	public Application getApplication() {
+		checkReleased();
+		if (this.application == null) {
+			ApplicationFactory aFactory = (ApplicationFactory) FactoryFinder
+					.getFactory(FactoryFinder.APPLICATION_FACTORY);
+			this.application = aFactory.getApplication();
+		}
+		return this.application;
 	}
-    }
 
-    public Severity getMaximumSeverity() {
-	checkReleased();
-	Severity max = null;
-	Iterator messages = getMessages();
-	while (messages.hasNext()) {
-	    FacesMessage msg = (FacesMessage) messages.next();
-	    Severity severity = msg.getSeverity();
-	    if ((null == max) || (max.getOrdinal() < severity.getOrdinal())) {
-		max = severity;
-	    }
+	public Iterator getClientIdsWithMessages() {
+		checkReleased();
+		if (this.messages == null) {
+			return Collections.EMPTY_LIST.iterator();
+		} else {
+			return this.messages.keySet().iterator();
+		}
 	}
-	return max;
-    }
 
-    public Iterator getMessages() {
-	checkReleased();
-	if (this.messages == null) {
-	    return Collections.EMPTY_LIST.iterator();
+	public Severity getMaximumSeverity() {
+		checkReleased();
+		Severity max = null;
+		Iterator messages = getMessages();
+		while (messages.hasNext()) {
+			FacesMessage msg = (FacesMessage) messages.next();
+			Severity severity = msg.getSeverity();
+			if ((null == max) || (max.getOrdinal() < severity.getOrdinal())) {
+				max = severity;
+			}
+		}
+		return max;
 	}
-	List messages = new ArrayList();
-	for (Iterator i = this.messages.values().iterator(); i.hasNext();) {
-	    final List list = (List) i.next();
-	    messages.addAll(list);
+
+	public Iterator getMessages() {
+		checkReleased();
+		if (this.messages == null) {
+			return Collections.EMPTY_LIST.iterator();
+		}
+		List messages = new ArrayList();
+		for (Iterator i = this.messages.values().iterator(); i.hasNext();) {
+			final List list = (List) i.next();
+			messages.addAll(list);
+		}
+		if (messages.size() > 0) {
+			return messages.iterator();
+		}
+		return Collections.EMPTY_LIST.iterator();
 	}
-	if (messages.size() > 0) {
-	    return messages.iterator();
+
+	public Iterator getMessages(String clientID) {
+		checkReleased();
+		if (this.messages != null) {
+			final List list = (List) this.messages.get(clientID);
+			if (list != null) {
+				return list.iterator();
+			}
+		}
+		return Collections.EMPTY_LIST.iterator();
 	}
-	return Collections.EMPTY_LIST.iterator();
-    }
 
-    public Iterator getMessages(String clientID) {
-	checkReleased();
-	if (this.messages != null) {
-	    final List list = (List) this.messages.get(clientID);
-	    if (list != null) {
-		return list.iterator();
-	    }
+	public RenderKit getRenderKit() {
+		checkReleased();
+		UIViewRoot viewRoot = getViewRoot();
+		if (viewRoot == null) {
+			return null;
+		}
+		String renderKitId = viewRoot.getRenderKitId();
+		if (renderKitId == null) {
+			return null;
+		} else {
+			RenderKitFactory rkFactory = (RenderKitFactory) FactoryFinder
+					.getFactory(FactoryFinder.RENDER_KIT_FACTORY);
+			return rkFactory.getRenderKit(this, renderKitId);
+		}
 	}
-	return Collections.EMPTY_LIST.iterator();
-    }
 
-    public RenderKit getRenderKit() {
-	checkReleased();
-	UIViewRoot viewRoot = getViewRoot();
-	if (viewRoot == null) {
-	    return null;
+	public boolean getRenderResponse() {
+		checkReleased();
+		return this.renderResponse;
 	}
-	String renderKitId = viewRoot.getRenderKitId();
-	if (renderKitId == null) {
-	    return null;
-	} else {
-	    RenderKitFactory rkFactory = (RenderKitFactory) FactoryFinder
-		    .getFactory(FactoryFinder.RENDER_KIT_FACTORY);
-	    return rkFactory.getRenderKit(this, renderKitId);
+
+	public boolean getResponseComplete() {
+		checkReleased();
+		return this.responseComplete;
 	}
-    }
 
-    public boolean getRenderResponse() {
-	checkReleased();
-	return this.renderResponse;
-    }
+	public UIViewRoot getViewRoot() {
+		checkReleased();
+		return this.viewRoot;
+	}
 
-    public boolean getResponseComplete() {
-	checkReleased();
-	return this.responseComplete;
-    }
+	public void setViewRoot(UIViewRoot viewRoot) {
+		checkReleased();
+		this.viewRoot = viewRoot;
+		// JSR-301 PLT 6.1.2 FacesContext
+		if (viewRoot instanceof PortletNamingContainer) {
+			Object response = getExternalContext().getResponse();
+			if (response instanceof PortletResponse) {
+				PortletResponse portletResponse = (PortletResponse) response;
+				portletResponse.setProperty("X-JAVAX-PORTLET-IS-NAMESPACED",
+						"true");
+			}
+		}
+	}
 
-    public UIViewRoot getViewRoot() {
-	checkReleased();
-	return this.viewRoot;
-    }
-
-    public void setViewRoot(UIViewRoot viewRoot) {
-	checkReleased();
-	this.viewRoot = viewRoot;
-	// JSR-301 PLT 6.1.2 FacesContext
-	if( viewRoot instanceof PortletNamingContainer ){
-		Object response = getExternalContext().getResponse();
-		if (response instanceof PortletResponse) {
-			PortletResponse portletResponse = (PortletResponse) response;
-			portletResponse.setProperty("X-JAVAX-PORTLET-IS-NAMESPACED" , "true");
+	public void addMessage(String clientID, FacesMessage message) {
+		checkReleased();
+		if (message == null) {
+			throw new NullPointerException("Message can't be null");
 		}
+		if (this.messages == null) {
+			this.messages = new HashMap();
+		}
+		List list = (List) this.messages.get(clientID);
+		if (list == null) {
+			list = new ArrayList();
+			this.messages.put(clientID, list);
+		}
+		list.add(message);
 	}
-    }
 
-    public void addMessage(String clientID, FacesMessage message) {
-	checkReleased();
-	if (message == null) {
-	    throw new NullPointerException("Message can't be null");
+	public void renderResponse() {
+		checkReleased();
+		this.renderResponse = true;
 	}
-	if (this.messages == null) {
-	    this.messages = new HashMap();
+
+	public void responseComplete() {
+		checkReleased();
+		if (externalContext.isHasNavigationRedirect()) {
+			this.renderResponse = true;
+		} else {
+			this.responseComplete = true;
+		}
 	}
-	List list = (List) this.messages.get(clientID);
-	if (list == null) {
-	    list = new ArrayList();
-	    this.messages.put(clientID, list);
-	}
-	list.add(message);
-    }
 
-    public void renderResponse() {
-	checkReleased();
-	this.renderResponse = true;
-    }
-
-    public void responseComplete() {
-	checkReleased();
-	this.responseComplete = true;
-    }
-
-    private void checkReleased() {
-	if (this.released) {
-	    throw new IllegalStateException("Context is released.");
+	private void checkReleased() {
+		if (this.released) {
+			throw new IllegalStateException("Context is released.");
+		}
 	}
-    }
 }
\ No newline at end of file

Modified: trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/PortletContextImpl.java
===================================================================
--- trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/PortletContextImpl.java	2007-12-13 21:00:40 UTC (rev 4832)
+++ trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/PortletContextImpl.java	2007-12-13 22:33:55 UTC (rev 4833)
@@ -8,6 +8,8 @@
 import java.io.UnsupportedEncodingException;
 import java.net.MalformedURLException;
 import java.net.URL;
+import java.net.URLDecoder;
+import java.net.URLEncoder;
 import java.security.Principal;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -19,7 +21,9 @@
 import java.util.Set;
 import java.util.regex.Pattern;
 
+import javax.faces.application.ViewHandler;
 import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
 import javax.faces.context.FacesContextFactory;
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
@@ -37,23 +41,27 @@
 import org.ajax4jsf.webapp.WebXml;
 
 /**
- * Version of the {@link ExternalContext} for a Portlet request. {@link FacesContextFactory} will create instance of this class
- * for a portal <code>action</code> phase.
+ * Version of the {@link ExternalContext} for a Portlet request.
+ * {@link FacesContextFactory} will create instance of this class for a portal
+ * <code>action</code> phase.
+ * 
  * @author asmirnov
  * 
  */
 public class PortletContextImpl extends AbstractExternalContext {
 
+	public static final String ACTION_URL_DO_NOTHITG = "/ajax4jsfPortletBridge/actionUrl/do/nothitg";
 	private String namespace;
 
 	public PortletContextImpl(PortletContext context, PortletRequest request,
 			PortletResponse response) {
 		super(context, request, response);
 		WebXml webXml = (WebXml) context.getAttribute(WebXml.CONTEXT_ATTRIBUTE);
-		if(null != webXml){
-			_servletPath = webXml.getFacesServletPrefix();			
+		if (null != webXml) {
+			_servletPath = webXml.getFacesServletPrefix();
 		}
-		ArrayList excludedAttributes = Collections.list(request.getAttributeNames());
+		ArrayList excludedAttributes = Collections.list(request
+				.getAttributeNames());
 		request.setAttribute(EXCLUDED_PARAMETERS_ATTRIBUTE, excludedAttributes);
 	}
 
@@ -62,26 +70,26 @@
 	}
 
 	public String getResponseCharacterEncoding() {
-			return null;
+		return null;
 	}
 
 	public String getResponseContentType() {
-			return null;
+		return null;
 	}
 
 	public void setRequestCharacterEncoding(String encoding)
 			throws UnsupportedEncodingException {
-			try {
-				ActionRequest actionRequest = (ActionRequest) getPortletRequest();
-				actionRequest.setCharacterEncoding(encoding);
-			} catch (IllegalStateException e) {
-				// TODO: handle exception
-			}
+		try {
+			ActionRequest actionRequest = (ActionRequest) getPortletRequest();
+			actionRequest.setCharacterEncoding(encoding);
+		} catch (IllegalStateException e) {
+			// TODO: handle exception
+		}
 	}
 
 	public String getRequestCharacterEncoding() {
-			ActionRequest actionRequest = (ActionRequest) getPortletRequest();
-			return actionRequest.getCharacterEncoding();
+		ActionRequest actionRequest = (ActionRequest) getPortletRequest();
+		return actionRequest.getCharacterEncoding();
 	}
 
 	public String getRequestContentType() {
@@ -106,12 +114,11 @@
 
 	protected String getNamespace() {
 		if (null == namespace) {
-				namespace = (String) getRequestParameter(
-						AbstractExternalContext.NAMESPACE_PARAMETER);
-				if(null == namespace){
-					throw new IllegalStateException(
-					"Can not determine portlet namespace");
-				}
+			namespace = (String) getRequestParameter(AbstractExternalContext.NAMESPACE_PARAMETER);
+			if (null == namespace) {
+				throw new IllegalStateException(
+						"Can not determine portlet namespace");
+			}
 		}
 		return namespace;
 	}
@@ -222,31 +229,35 @@
 		if (null == path) {
 			throw new NullPointerException("Path to new view is null");
 		}
-			throw new IllegalStateException(
-					"Dispatch to new view not at render phase");
+		throw new IllegalStateException(
+				"Dispatch to new view not at render phase");
 	}
 
-	private static final Pattern absoluteUrl = Pattern.compile(""); 
-	private static final Pattern directLink = Pattern.compile(""); 
-	private static final Pattern viewIdParam = Pattern.compile(""); 
+	private static final Pattern absoluteUrl = Pattern.compile("");
+	private static final Pattern directLink = Pattern.compile("");
+	private static final Pattern viewIdParam = Pattern.compile("");
 
 	/**
 	 * @param parameters
 	 * @return
 	 */
 	@Override
-	protected String createActionUrl(Map<String, String> parameters){
-		RenderResponse renderResponse = (RenderResponse) getPortletResponse();
-		PortletURL portletURL = renderResponse.createActionURL();
-		portletURL.setParameter(AbstractExternalContext.NAMESPACE_PARAMETER,
-				renderResponse.getNamespace());
-		for (Iterator<Map.Entry<String, String>> param = parameters.entrySet()
-				.iterator(); param.hasNext();) {
-			Map.Entry<String, String> parameter = param.next();
-			portletURL.setParameter(parameter.getKey(), parameter.getValue());
+	protected String createActionUrl(Map<String, String> parameters) {
+		String dummyActionURL = getRequestContextPath() + ACTION_URL_DO_NOTHITG;
+		try {
+			PortalActionURL actionUrl = new PortalActionURL(dummyActionURL);
+			for (Iterator<Map.Entry<String, String>> param = parameters
+					.entrySet().iterator(); param.hasNext();) {
+				Map.Entry<String, String> parameter = param.next();
+				actionUrl
+						.addParameter(parameter.getKey(), parameter.getValue());
+			}
+			return actionUrl.toString();
+		} catch (MalformedURLException e) {
+
 		}
-		return portletURL.toString();
-   }
+		return dummyActionURL;
+	}
 
 	public String encodeResourceURL(String url) {
 		return encodeURL(url);
@@ -257,7 +268,7 @@
 	 * @return
 	 */
 	protected String encodeURL(String url) {
-      return getPortletResponse().encodeURL(url);
+		return getPortletResponse().encodeURL(url);
 	}
 
 	public String getAuthType() {
@@ -281,7 +292,7 @@
 	}
 
 	private String _pathInfo = null;
-	
+
 	public String getRequestPathInfo() {
 		String pathInfo = (String) getRequestParameter(VIEW_ID_PARAMETER);
 		if (null == pathInfo) {
@@ -291,7 +302,7 @@
 	}
 
 	private String _servletPath = null;
-	
+
 	public String getRequestServletPath() {
 		return _servletPath;
 	}
@@ -321,8 +332,34 @@
 			throw new NullPointerException("Path to redirect is null");
 		}
 		PortalActionURL actionURL = new PortalActionURL(url);
-      if(url.startsWith("#") || (!actionURL.isInContext(getRequestContextPath())) || "true".equalsIgnoreCase(actionURL.getParameter(Bridge.DIRECT_LINK))){
+		if (url.startsWith("#")
+				|| (!actionURL.isInContext(getRequestContextPath()))
+				|| "true".equalsIgnoreCase(actionURL
+						.getParameter(Bridge.DIRECT_LINK))) {
 			((ActionResponse) getResponse()).sendRedirect(url);
+		} else {
+			internalRedirect(actionURL);
 		}
 	}
+
+	/**
+	 * @param actionURL
+	 */
+	protected void internalRedirect(PortalActionURL actionURL) {
+		// Detect ViewId from URL and create new view for them.
+		String viewId = actionURL.getParameter(VIEW_ID_PARAMETER);
+		if (null != viewId) {
+			try {
+				viewId = URLDecoder.decode(viewId, "UTF8");
+				FacesContext facesContext = FacesContext.getCurrentInstance();
+				ViewHandler viewHandler = facesContext.getApplication()
+						.getViewHandler();
+				facesContext.setViewRoot(viewHandler.createView(facesContext,
+						viewId));
+				setHasNavigationRedirect(true);
+			} catch (UnsupportedEncodingException e) {
+				// Do nothing - UTF-8 encoding is a default.
+			}
+		}
+	}
 }

Modified: trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/PortletRenderContextImpl.java
===================================================================
--- trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/PortletRenderContextImpl.java	2007-12-13 21:00:40 UTC (rev 4832)
+++ trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/PortletRenderContextImpl.java	2007-12-13 22:33:55 UTC (rev 4833)
@@ -91,13 +91,15 @@
 			throw new NullPointerException("Path to redirect is null");
 		}
 		PortalActionURL actionURL = new PortalActionURL(url);
-      if(!actionURL.isInContext(getRequestContextPath()) || "true".equalsIgnoreCase(actionURL.getParameter(Bridge.DIRECT_LINK))){
-			dispatch(url);
+      if((!actionURL.isInContext(getRequestContextPath()) && null == actionURL.getParameter(VIEW_ID_PARAMETER)) || "true".equalsIgnoreCase(actionURL.getParameter(Bridge.DIRECT_LINK))){
+//			dispatch(url);
 
 //         throw new IllegalStateException(
 //			"Redirect to new url not at action phase");
+		} else {
+		// HACK - if page is in the context, just treat it as navigation case
+			internalRedirect(actionURL);
 		}
-		// HACK - if page is in the context, just treat it as navigation case
 	}
 
 	@Override

Modified: trunk/framework/impl/pom.xml
===================================================================
--- trunk/framework/impl/pom.xml	2007-12-13 21:00:40 UTC (rev 4832)
+++ trunk/framework/impl/pom.xml	2007-12-13 22:33:55 UTC (rev 4833)
@@ -90,16 +90,17 @@
               <includes>
                 <include>${project.build.directory}/compressed/org/ajax4jsf/javascript/scripts/prototype-min.js</include>
                 <include>${project.build.directory}/compressed/org/ajax4jsf/javascript/scripts/AJAX-min.js</include>
+                <include>${project.build.directory}/compressed/org/richfaces/renderkit/html/scripts/scriptaculous/scriptaculous-min.js</include>
+                <include>${project.build.directory}/compressed/org/richfaces/renderkit/html/scripts/jquery/jquery-min.js</include>
                 <include>${project.build.directory}/compressed/org/ajax4jsf/javascript/scripts/dnd-min.js</include>
-                <include>${project.build.directory}/compressed/org/richfaces/renderkit/html/scripts/scriptaculous/scriptaculous-min.js</include>
                 <include>**/*-min.js</include>
               </includes>
               <!-- files to exclude, path relative to output's directory -->
               <excludes>
                 <exclude>**/*.pack.js</exclude>
                 <!-- exclude parts of the scriptaculous, so big file already included -->
-                <exclude>${project.build.directory}/compressed/org/richfaces/renderkit/html/scripts/scriptaculous/*.js</exclude>
-                <exclude>${project.build.directory}/compressed/org/richfaces/renderkit/html/scripts/jquery.jcarousel-min.js</exclude>
+                <exclude>**/scriptaculous/*.js</exclude>
+                <exclude>**/jquery.jcarousel-min.js</exclude>
                 <exclude>**/compressed.css</exclude>
               </excludes>
             </aggregation>

Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java	2007-12-13 21:00:40 UTC (rev 4832)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java	2007-12-13 22:33:55 UTC (rev 4833)
@@ -58,6 +58,7 @@
 import org.ajax4jsf.renderkit.RendererUtils;
 import org.ajax4jsf.renderkit.RendererUtils.HTML;
 import org.ajax4jsf.resource.InternetResourceBuilder;
+import org.ajax4jsf.resource.ResourceNotFoundException;
 import org.ajax4jsf.webapp.BaseFilter;
 import org.ajax4jsf.webapp.FilterServletResponseWrapper;
 import org.apache.commons.logging.Log;
@@ -103,7 +104,7 @@
 	Map responseDataMap = new HashMap();
 
 	Map commonAjaxParameters = new HashMap();
-	
+
 	Object oncomplete = null;
 
 	static {
@@ -114,9 +115,9 @@
 			invoker = new JsfOneOneInvoker();
 		}
 	}
-	
+
 	public void release() {
-		
+
 		ajaxAreasToRender = new HashSet();
 
 		ajaxRenderedAreas = new LinkedHashSet();
@@ -138,7 +139,7 @@
 		responseDataMap = new HashMap();
 
 		commonAjaxParameters = new HashMap();
-		
+
 	}
 
 	/**
@@ -355,43 +356,78 @@
 				UIViewRoot root = context.getViewRoot();
 				ViewResources viewResources = new ViewResources();
 				try {
-					Skin skin = SkinFactory.getInstance().getSkin(
-							context);
+					Skin skin = SkinFactory.getInstance().getSkin(context);
 					// Set default style sheet for current skin.
 					String styleSheetUri = (String) skin.getParameter(context,
 							Skin.generalStyleSheet);
-					if(null != styleSheetUri){
+					if (null != styleSheetUri) {
 						String resourceURL = context.getApplication()
-						.getViewHandler().getResourceURL(context,
-								styleSheetUri);
+								.getViewHandler().getResourceURL(context,
+										styleSheetUri);
 						viewResources.addStyle(resourceURL);
 					}
 					// For a "NULL" skin, do not collect components stylesheets
-					if("false".equals(skin.getParameter(context, Skin.loadStyleSheets))){
+					if ("false".equals(skin.getParameter(context,
+							Skin.loadStyleSheets))) {
 						viewResources.setProcessStyles(false);
 					}
 				} catch (SkinNotFoundException e) {
 					log.warn("Current Skin is not found", e);
 				}
-				InternetResourceBuilder internetResourceBuilder = InternetResourceBuilder.getInstance();
+				InternetResourceBuilder internetResourceBuilder = InternetResourceBuilder
+						.getInstance();
 				// Check init parameters for a resources processing.
-				String scriptStrategy = externalContext.getInitParameter(InternetResourceBuilder.LOAD_SCRIPT_STRATEGY_PARAM);
-				if(null != scriptStrategy){
-					if(InternetResourceBuilder.LOAD_NONE.equals(scriptStrategy)){
+				String scriptStrategy = externalContext
+						.getInitParameter(InternetResourceBuilder.LOAD_SCRIPT_STRATEGY_PARAM);
+				if (null != scriptStrategy) {
+					if (InternetResourceBuilder.LOAD_NONE
+							.equals(scriptStrategy)) {
 						viewResources.setProcessScripts(false);
-					} else if (InternetResourceBuilder.LOAD_ALL.equals(scriptStrategy)) {
+					} else if (InternetResourceBuilder.LOAD_ALL
+							.equals(scriptStrategy)) {
 						viewResources.setProcessScripts(false);
-						viewResources.addScript(internetResourceBuilder.createResource(this, InternetResourceBuilder.COMMON_FRAMEWORK_SCRIPT).getUri(context, null));
-						viewResources.addScript(internetResourceBuilder.createResource(this, InternetResourceBuilder.COMMON_UI_SCRIPT).getUri(context, null));
+						try {
+							viewResources
+									.addScript(internetResourceBuilder
+											.createResource(
+													this,
+													InternetResourceBuilder.COMMON_FRAMEWORK_SCRIPT)
+											.getUri(context, null));
+							viewResources
+									.addScript(internetResourceBuilder
+											.createResource(
+													this,
+													InternetResourceBuilder.COMMON_UI_SCRIPT)
+											.getUri(context, null));
+
+						} catch (ResourceNotFoundException e) {
+							if(log.isWarnEnabled()){
+								log.warn("No aggregated javaScript library found "+e.getMessage());
+							}
+						}
 					}
 				}
-				String styleStrategy = externalContext.getInitParameter(InternetResourceBuilder.LOAD_STYLE_STRATEGY_PARAM);
-				if(null != styleStrategy){
-					if(InternetResourceBuilder.LOAD_NONE.equals(styleStrategy)){
+				String styleStrategy = externalContext
+						.getInitParameter(InternetResourceBuilder.LOAD_STYLE_STRATEGY_PARAM);
+				if (null != styleStrategy) {
+					if (InternetResourceBuilder.LOAD_NONE.equals(styleStrategy)) {
 						viewResources.setProcessStyles(false);
-					} else if (InternetResourceBuilder.LOAD_ALL.equals(styleStrategy)) {
+					} else if (InternetResourceBuilder.LOAD_ALL
+							.equals(styleStrategy)) {
 						viewResources.setProcessStyles(false);
-						viewResources.addStyle(internetResourceBuilder.createResource(this, InternetResourceBuilder.COMMON_STYLE).getUri(context, null));
+						try {
+							viewResources
+									.addStyle(internetResourceBuilder
+											.createResource(
+													this,
+													InternetResourceBuilder.COMMON_STYLE)
+											.getUri(context, null));
+
+						} catch (ResourceNotFoundException e) {
+							if(log.isWarnEnabled()){
+								log.warn("No aggregated stylesheet found "+e.getMessage());
+							}
+						}
 					}
 				}
 				viewResources.collect(context);
@@ -430,7 +466,6 @@
 		}
 	}
 
-
 	public void saveViewState(FacesContext context) throws IOException {
 		// TODO - for facelets environment, we need to remove transient
 		// components.
@@ -542,8 +577,8 @@
 			throw new NullPointerException(
 					"Base component for search re-rendered compnnent is null");
 		}
-		UIComponent target = RendererUtils.getInstance().
-			findComponentFor(component, id);
+		UIComponent target = RendererUtils.getInstance().findComponentFor(
+				component, id);
 		if (null != target) {
 			return AjaxRendererUtils.getAbsoluteId(target);
 		}
@@ -702,9 +737,9 @@
 		ViewHandler viewHandler = context.getApplication().getViewHandler();
 		String actionURL = viewHandler.getActionURL(context, viewId);
 		// Mark Ajax action url as transparent with jsf-portlet bridge.
-		actionURL = actionURL + ((actionURL.lastIndexOf('?')>0)?"&":"?")+"javax.portlet.faces.DirectLink=true";
-		return context.getExternalContext().encodeActionURL(
-				actionURL);
+		actionURL = actionURL + ((actionURL.lastIndexOf('?') > 0) ? "&" : "?")
+				+ "javax.portlet.faces.DirectLink=true";
+		return context.getExternalContext().encodeActionURL(actionURL);
 	}
 
 	/**
@@ -722,7 +757,8 @@
 	}
 
 	/**
-	 * @param oncomplete the oncomplete to set
+	 * @param oncomplete
+	 *            the oncomplete to set
 	 */
 	public void setOncomplete(Object oncomplete) {
 		this.oncomplete = oncomplete;

Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/HeaderResourcesRendererBase.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/HeaderResourcesRendererBase.java	2007-12-13 21:00:40 UTC (rev 4832)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/HeaderResourcesRendererBase.java	2007-12-13 22:33:55 UTC (rev 4833)
@@ -25,10 +25,12 @@
 import java.util.LinkedHashSet;
 
 import javax.faces.component.UIComponent;
+import javax.faces.context.ExternalContext;
 import javax.faces.context.FacesContext;
 
 import org.ajax4jsf.renderkit.HeaderResourceProducer;
 import org.ajax4jsf.resource.InternetResource;
+import org.ajax4jsf.resource.InternetResourceBuilder;
 import org.ajax4jsf.webapp.BaseFilter;
 
 /**
@@ -47,7 +49,7 @@
 	 * 
 	 * @see org.ajax4jsf.renderkit.HeaderResourceProducer#getHeaderScripts(javax.faces.context.FacesContext)
 	 */
-	public  LinkedHashSet<String> getHeaderScripts(FacesContext context,
+	public LinkedHashSet<String> getHeaderScripts(FacesContext context,
 			UIComponent component) {
 		return getUrisSet(context, getScripts(), component);
 	}
@@ -67,7 +69,7 @@
 	 * 
 	 * @see org.ajax4jsf.renderkit.HeaderResourceProducer#getHeaderStyles(javax.faces.context.FacesContext)
 	 */
-	public  LinkedHashSet<String> getHeaderStyles(FacesContext context,
+	public LinkedHashSet<String> getHeaderStyles(FacesContext context,
 			UIComponent component) {
 		return getUrisSet(context, getStyles(), component);
 	}
@@ -93,7 +95,7 @@
 			InternetResource[] resources, UIComponent component) {
 		if (null != resources) {
 			LinkedHashSet<String> uris = new LinkedHashSet<String>(); // Collections.singleton(ajaxScript.getUri(context,
-														// null));
+			// null));
 			for (int i = 0; i < resources.length; i++) {
 				InternetResource resource = resources[i];
 				uris.add(resource.getUri(context, component));
@@ -113,10 +115,19 @@
 			throws IOException {
 		if ((null == context.getExternalContext().getRequestMap().get(
 				BaseFilter.RESPONSE_WRAPPER_ATTRIBUTE))
-				/*&& (!AjaxRendererUtils.isAjaxRequest(context))*/) {
+		/* && (!AjaxRendererUtils.isAjaxRequest(context)) */) {
 			// Filter not used - encode scripts and CSS before component.
-			encodeResourcesArray(context, component, getScripts());
-			encodeResourcesArray(context, component, getStyles());
+			ExternalContext externalContext = context.getExternalContext();
+			String scriptStrategy = externalContext
+					.getInitParameter(InternetResourceBuilder.LOAD_STYLE_STRATEGY_PARAM);
+			if (null == scriptStrategy || !InternetResourceBuilder.LOAD_NONE.equals(scriptStrategy)) {
+					encodeResourcesArray(context, component, getScripts());
+			}
+			String styleStrategy = externalContext
+					.getInitParameter(InternetResourceBuilder.LOAD_STYLE_STRATEGY_PARAM);
+			if (null != styleStrategy || !InternetResourceBuilder.LOAD_NONE.equals(styleStrategy)) {
+					encodeResourcesArray(context, component, getStyles());
+			}
 		}
 	}
 
@@ -126,10 +137,12 @@
 	 * @param scripts
 	 * @throws IOException
 	 */
-	protected void encodeResourcesArray(FacesContext context, UIComponent component, InternetResource[] scripts) throws IOException {
+	protected void encodeResourcesArray(FacesContext context,
+			UIComponent component, InternetResource[] scripts)
+			throws IOException {
 		if (scripts != null) {
 			for (int i = 0; i < scripts.length; i++) {
-				scripts[i].encode(context,component);
+				scripts[i].encode(context, component);
 			}
 		}
 	}

Modified: trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/components.xml
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/components.xml	2007-12-13 21:00:40 UTC (rev 4832)
+++ trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/components.xml	2007-12-13 22:33:55 UTC (rev 4833)
@@ -18,7 +18,7 @@
                  http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.0.xsd">
 
 
-    <core:init jndi-pattern="seamEAR/#{ejbName}/local" debug="true"/>
+    <core:init jndi-pattern="seamEAR/#{ejbName}/local" debug="false"/>
 
     <core:manager conversation-timeout="120000"
                   concurrent-request-timeout="500"

Modified: trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/book.xhtml
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/book.xhtml	2007-12-13 21:00:40 UTC (rev 4832)
+++ trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/book.xhtml	2007-12-13 22:33:55 UTC (rev 4833)
@@ -94,7 +94,7 @@
 		<div class="buttonBox">
 			<a:commandButton id="proceed" value="Proceed" action="#{hotelBooking.setBookingDetails}"/>
 			&#160;
-			<a:commandButton id="cancel" value="Cancel" action="#{hotelBooking.cancel}"/>
+			<a:commandButton id="cancel" value="Cancel" action="#{hotelBooking.cancel}" immediate="true"/>
 		</div>
 		
 	</fieldset>

Modified: trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/home.xhtml
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/home.xhtml	2007-12-13 21:00:40 UTC (rev 4832)
+++ trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/home.xhtml	2007-12-13 22:33:55 UTC (rev 4833)
@@ -9,6 +9,7 @@
 	</div>
 	<div id="container">
 		<div id="sidebar">
+		   <ui:remove>
             <h:form id="login">
 			<fieldset>
 				<div>
@@ -25,6 +26,8 @@
 				<div class="notes"><s:link id="register" view="/register.xhtml" value="Register New User"/></div>
 			</fieldset>
             </h:form>
+            </ui:remove>
+            <p>In the portal environment, this application use portal authentication. Please, login into portal to access hotels pages</p>
 		</div>
 		<div id="content">
 			<div class="section">

Modified: trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/main.xhtml
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/main.xhtml	2007-12-13 21:00:40 UTC (rev 4832)
+++ trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/main.xhtml	2007-12-13 22:33:55 UTC (rev 4833)
@@ -64,8 +64,12 @@
 			#{hot.zip}
 		</h:column>
 		<h:column>
+			<f:facet name="header">AJAX Action</f:facet>
+			<a:commandLink id="viewHotelAJAX" value="View Hotel" action="#{hotelBooking.selectHotel(hot)}"/>
+		</h:column>
+		<h:column>
 			<f:facet name="header">Action</f:facet>
-			<a:commandLink id="viewHotel" value="View Hotel" action="#{hotelBooking.selectHotel(hot)}"/>
+			<s:link id="viewHotel" value="View Hotel" action="#{hotelBooking.selectHotel(hot)}"/>
 		</h:column>
 	</h:dataTable>
 	<a:commandLink value="More results" action="#{hotelSearch.nextPage}" rendered="#{hotelSearch.nextPageAvailable}" reRender="searchResults"/>

Modified: trunk/ui/assembly/pom.xml
===================================================================
--- trunk/ui/assembly/pom.xml	2007-12-13 21:00:40 UTC (rev 4832)
+++ trunk/ui/assembly/pom.xml	2007-12-13 22:33:55 UTC (rev 4833)
@@ -59,9 +59,11 @@
 								<includeModules>core</includeModules>
 							</taglib>
 						</taglibs>
-					</library><!--
-					<templateXpath>/*[local-name()='template']/*</templateXpath>
-					--><commonStyle>org/richfaces/skin.xcss</commonStyle>
+					</library>
+					<!--
+						<templateXpath>/*[local-name()='template']/*</templateXpath>
+					-->
+					<commonStyle>org/richfaces/skin.xcss</commonStyle>
 				</configuration>
 				<executions>
 					<execution>
@@ -156,6 +158,20 @@
 										${project.build.directory}/docs/userguide/en
 									</outputDirectory>
 								</artifactItem>
+								<artifactItem>
+									<groupId>
+										org.richfaces.docs.faq
+									</groupId>
+									<artifactId>en</artifactId>
+									<version>
+										${project.version}
+									</version>
+									<type>war</type>
+									<classifier>pdf</classifier>
+									<outputDirectory>
+										${project.build.directory}/docs/faq/en
+									</outputDirectory>
+								</artifactItem>
 							</artifactItems>
 							<outputDirectory>
 								${project.build.directory}/docs
@@ -202,8 +218,9 @@
 				</configuration>
 			</plugin>
 			<plugin>
-				<groupId>net.sf.alchim</groupId>
-				<artifactId>yuicompressor-maven-plugin</artifactId>
+				<groupId>org.richfaces.cdk</groupId>
+				<artifactId>maven-javascript-plugin</artifactId>
+				<version>${project.version}</version>
 				<executions>
 					<execution>
 						<goals>
@@ -224,14 +241,38 @@
 							<!-- insert new line after each concatenation (default: false) -->
 							<insertNewLine>true</insertNewLine>
 							<output>
-								${project.build.directory}/compressed/ui.pack.js
+								${project.build.outputDirectory}/org/richfaces/ui.pack.js
 							</output>
 							<!-- files to include, path relative to output's directory or absolute path-->
-							<includes><!--
-									<include>
-									${project.build.directory}/compressed/org/richfaces/renderkit/html/scripts/scriptaculous/scriptaculous-min.js
-									</include>
-								--><include>**/*-min.js</include>
+							<includes>
+								<include>
+									${project.build.directory}/compressed/org/richfaces/renderkit/html/scripts/drag-indicator-min.js
+								</include>
+								<include>
+									${project.build.directory}/compressed/org/richfaces/renderkit/html/scripts/simple-draggable-min.js
+								</include>
+								<include>
+									${project.build.directory}/compressed/org/richfaces/renderkit/html/scripts/simple-dropzone-min.js
+								</include>
+								<include>
+									${project.build.directory}/compressed/org/richfaces/renderkit/html/scripts/tree-min.js
+								</include>
+								<include>
+									${project.build.directory}/compressed/org/richfaces/renderkit/html/scripts/tree-selection-min.js
+								</include>
+								<include>
+									${project.build.directory}/compressed/org/richfaces/renderkit/html/scripts/tree-item-min.js
+								</include>
+								<include>
+									${project.build.directory}/compressed/org/richfaces/renderkit/html/scripts/tree-item-dnd-min.js
+								</include>
+								<include>
+									${project.build.directory}/compressed/org/richfaces/renderkit/html/scripts/modalPanel-min.js
+								</include>
+								<include>
+									${project.build.directory}/compressed/org/richfaces/renderkit/html/scripts/modalPanelBorders-min.js
+								</include>
+								<include>**/*-min.js</include>
 							</includes>
 							<!-- files to exclude, path relative to output's directory -->
 							<excludes>
@@ -245,31 +286,17 @@
 								<exclude>**/scriptaculo*/**</exclude>
 							</excludes>
 						</aggregation>
-					</aggregations><!--
-					<warSourceDirectory>${project.build.directory}/modules</warSourceDirectory>
-					<webappDirectory>${project.build.directory}/compressed</webappDirectory>
-					--><includes>
+					</aggregations>
+					<!--
+						<warSourceDirectory>${project.build.directory}/modules</warSourceDirectory>
+						<webappDirectory>${project.build.directory}/compressed</webappDirectory>
+					-->
+					<includes>
 						<include>**/*.js</include>
 					</includes>
 				</configuration>
 			</plugin>
-			<plugin>
-				<artifactId>maven-antrun-plugin</artifactId>
-				<executions>
-					<execution>
-						<id>framevork-javascript</id>
-						<phase>compile</phase>
-						<goals>
-							<goal>run</goal>
-						</goals>
-						<configuration>
-							<tasks>
-								<copy todir="target/classes/org/richfaces" file="target/compressed/ui.pack.js"/>
-							</tasks>
-						</configuration>
-					</execution>
-				</executions>
-			</plugin>		</plugins>
+		</plugins>
 	</build>
 	<dependencies />
 </project>
\ No newline at end of file




More information about the richfaces-svn-commits mailing list