JBoss Rich Faces SVN: r5555 - trunk/samples/richfaces-demo/src/main/webapp/richfaces/orderingList/example.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2008-01-23 07:29:45 -0500 (Wed, 23 Jan 2008)
New Revision: 5555
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/orderingList/example/playlist.xhtml
Log:
http://jira.jboss.com/jira/browse/RF-1956
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/orderingList/example/playlist.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/orderingList/example/playlist.xhtml 2008-01-23 10:52:59 UTC (rev 5554)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/orderingList/example/playlist.xhtml 2008-01-23 12:29:45 UTC (rev 5555)
@@ -12,13 +12,13 @@
<rich:orderingList value="#{library.libraryAsList}" var="lib" listHeight="300" listWidth="350">
<rich:column width="180">
<f:facet name="header">
- Song Name
+ <h:outputText value="Song Name" />
</f:facet>
<h:outputText value="#{lib.title}"></h:outputText>
</rich:column>
<rich:column>
<f:facet name="header">
- Artist Name
+ <h:outputText value="Artist Name" />
</f:facet>
<h:outputText value="#{lib.album.artist.name}"></h:outputText>
</rich:column>
16 years, 11 months
JBoss Rich Faces SVN: r5554 - branches/3.1.x/ui/menu-components/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: akushunin
Date: 2008-01-23 05:52:59 -0500 (Wed, 23 Jan 2008)
New Revision: 5554
Modified:
branches/3.1.x/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java
Log:
http://jira.jboss.com/jira/browse/RF-1992
Modified: branches/3.1.x/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java
===================================================================
--- branches/3.1.x/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java 2008-01-23 10:30:10 UTC (rev 5553)
+++ branches/3.1.x/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java 2008-01-23 10:52:59 UTC (rev 5554)
@@ -165,7 +165,7 @@
writer.endElement("div");
writer.startElement("iframe", layer);
- writer.writeAttribute("src","", null);
+ writer.writeAttribute("src","javascript:''", null);
writer.writeAttribute("id", clientId+"_menu_iframe", null);
writer.writeAttribute("class", "underneath_iframe", null);
writer.writeAttribute("style", "position:absolute; z-index: 1;", null);
16 years, 11 months
JBoss Rich Faces SVN: r5553 - trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: akushunin
Date: 2008-01-23 05:30:10 -0500 (Wed, 23 Jan 2008)
New Revision: 5553
Modified:
trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java
Log:
http://jira.jboss.com/jira/browse/RF-1992
Modified: trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java
===================================================================
--- trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java 2008-01-23 02:07:03 UTC (rev 5552)
+++ trunk/ui/menu-components/src/main/java/org/richfaces/renderkit/html/AbstractMenuRenderer.java 2008-01-23 10:30:10 UTC (rev 5553)
@@ -166,7 +166,7 @@
writer.endElement("div");
writer.startElement("iframe", layer);
- writer.writeAttribute("src","", null);
+ writer.writeAttribute("src","javascript:''", null);
writer.writeAttribute("id", clientId+"_menu_iframe", null);
writer.writeAttribute("class", "underneath_iframe", null);
writer.writeAttribute("style", "position:absolute; z-index: 1;", null);
16 years, 11 months
JBoss Rich Faces SVN: r5552 - trunk/ui/gmap/src/main/templates.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-01-22 21:07:03 -0500 (Tue, 22 Jan 2008)
New Revision: 5552
Modified:
trunk/ui/gmap/src/main/templates/gmap.jspx
Log:
http://jira.jboss.com/jira/browse/RF-1978
Modified: trunk/ui/gmap/src/main/templates/gmap.jspx
===================================================================
--- trunk/ui/gmap/src/main/templates/gmap.jspx 2008-01-23 02:05:09 UTC (rev 5551)
+++ trunk/ui/gmap/src/main/templates/gmap.jspx 2008-01-23 02:07:03 UTC (rev 5552)
@@ -41,7 +41,7 @@
function __initGMap() { __initGmapdiv("#{map}","#{clientId}", "#{warningMessage}");
__applyGmapparam("#{map}",#{lat}, #{lng},#{zoom},#{mapType},#{enableDragging},#{enableInfoWindow},#{enableDoubleClickZoom},#{enableContinuousZoom},#{isGMapType},#{isGScale},#{isGLarge});
- var userfunc = new Function('event', '#{oninit}'); userfunc();};__addLoadEvent(__initGMap);__addUnLoadEvent(GUnload);
+ var userfunc = function(event) { #{oninit} }; userfunc();};__addLoadEvent(__initGMap);__addUnLoadEvent(GUnload);
//]]>
</script>
</div>
16 years, 11 months
JBoss Rich Faces SVN: r5551 - branches/3.1.x/ui/gmap/src/main/templates.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-01-22 21:05:09 -0500 (Tue, 22 Jan 2008)
New Revision: 5551
Modified:
branches/3.1.x/ui/gmap/src/main/templates/gmap.jspx
Log:
http://jira.jboss.com/jira/browse/RF-1978
Modified: branches/3.1.x/ui/gmap/src/main/templates/gmap.jspx
===================================================================
--- branches/3.1.x/ui/gmap/src/main/templates/gmap.jspx 2008-01-23 01:41:41 UTC (rev 5550)
+++ branches/3.1.x/ui/gmap/src/main/templates/gmap.jspx 2008-01-23 02:05:09 UTC (rev 5551)
@@ -38,7 +38,7 @@
function __initGMap() { __initGmapdiv("#{map}","#{clientId}", "#{warningMessage}");
__applyGmapparam("#{map}",#{lat}, #{lng},#{zoom},#{mapType},#{enableDragging},#{enableInfoWindow},#{enableDoubleClickZoom},#{enableContinuousZoom},#{isGMapType},#{isGScale},#{isGLarge});
- var userfunc = new Function('event', '#{oninit}'); userfunc();};__addLoadEvent(__initGMap);__addUnLoadEvent(GUnload);
+ var userfunc = function(event) { #{oninit} }; userfunc();};__addLoadEvent(__initGMap);__addUnLoadEvent(GUnload);
//]]>
</script>
</div>
16 years, 11 months
JBoss Rich Faces SVN: r5550 - trunk/ui/virtualEarth/src/main/templates.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-01-22 20:41:41 -0500 (Tue, 22 Jan 2008)
New Revision: 5550
Modified:
trunk/ui/virtualEarth/src/main/templates/virtualEarth.jspx
Log:
http://jira.jboss.com/jira/browse/RF-1977
Modified: trunk/ui/virtualEarth/src/main/templates/virtualEarth.jspx
===================================================================
--- trunk/ui/virtualEarth/src/main/templates/virtualEarth.jspx 2008-01-23 01:32:07 UTC (rev 5549)
+++ trunk/ui/virtualEarth/src/main/templates/virtualEarth.jspx 2008-01-23 01:41:41 UTC (rev 5550)
@@ -30,7 +30,7 @@
//<![CDATA[
function __initVE() { __initVirtualEarthdiv("#{map}","#{clientId}");
-var userfunc = new Function('event', '#{onLoadMap}');
+var userfunc = function (event) { #{onLoadMap} };
__applyVirtualEarthparam("#{map}",userfunc, #{lat}, #{lng},#{zoom}, #{mapStyle},#{dashboardSize});
}
__addLoadEvent(__initVE);
16 years, 11 months
JBoss Rich Faces SVN: r5549 - branches/3.1.x/ui/virtualEarth/src/main/templates.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-01-22 20:32:07 -0500 (Tue, 22 Jan 2008)
New Revision: 5549
Modified:
branches/3.1.x/ui/virtualEarth/src/main/templates/virtualEarth.jspx
Log:
http://jira.jboss.com/jira/browse/RF-1977
Modified: branches/3.1.x/ui/virtualEarth/src/main/templates/virtualEarth.jspx
===================================================================
--- branches/3.1.x/ui/virtualEarth/src/main/templates/virtualEarth.jspx 2008-01-23 01:31:21 UTC (rev 5548)
+++ branches/3.1.x/ui/virtualEarth/src/main/templates/virtualEarth.jspx 2008-01-23 01:32:07 UTC (rev 5549)
@@ -30,7 +30,7 @@
//<![CDATA[
function __initVE() { __initVirtualEarthdiv("#{map}","#{clientId}");
-var userfunc = new Function('event', '#{onLoadMap}');
+var userfunc = function (event) { #{onLoadMap} };
__applyVirtualEarthparam("#{map}",userfunc, #{lat}, #{lng},#{zoom}, #{mapStyle},#{dashboardSize});
}
__addLoadEvent(__initVE);
16 years, 11 months
JBoss Rich Faces SVN: r5548 - in trunk: extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/application and 6 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2008-01-22 20:31:21 -0500 (Tue, 22 Jan 2008)
New Revision: 5548
Modified:
trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/AjaxPortletBridge.java
trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/application/PortletStateHolder.java
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/PortalActionURL.java
trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/PortletExternalContextImpl.java
trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/ServletExternalContextImpl.java
trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/lifecycle/PortalPhaseListener.java
trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/Booking.java
trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/User.java
trunk/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/ajax4jsf/portlet/seam/PortalIdentity.java
trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/faces-config.xml
trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/pages.xml
trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/portlet.xml
trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/seamBookingPortlet-object.xml
trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/web.xml
trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/home.xhtml
Log:
Run SeamBooking demo in the portal
Modified: trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/AjaxPortletBridge.java
===================================================================
--- trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/AjaxPortletBridge.java 2008-01-23 01:30:55 UTC (rev 5547)
+++ trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/AjaxPortletBridge.java 2008-01-23 01:31:21 UTC (rev 5548)
@@ -5,6 +5,10 @@
import java.io.PrintWriter;
import java.security.Principal;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.List;
import java.util.Map;
import java.util.ResourceBundle;
@@ -18,6 +22,7 @@
import javax.portlet.PortletRequest;
import javax.portlet.PortletResponse;
import javax.portlet.PortletSession;
+import javax.portlet.PortletURL;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import javax.portlet.faces.Bridge;
@@ -27,7 +32,9 @@
import org.ajax4jsf.context.AjaxContext;
import org.ajax4jsf.portlet.application.PortletStateHolder;
import org.ajax4jsf.portlet.application.PortletViewState;
+import org.ajax4jsf.portlet.application.PortletStateHolder.WindowIDRetriver;
import org.ajax4jsf.portlet.context.AbstractExternalContext;
+import org.ajax4jsf.portlet.context.PortalActionURL;
import org.ajax4jsf.portlet.context.PortletExternalContextImpl;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -62,13 +69,13 @@
* @see javax.portlet.faces.Bridge#init(javax.portlet.PortletConfig)
*/
public void init(PortletConfig config) throws PortletException {
+ this.portletConfig = config;
+ PortletContext portletContext = config.getPortletContext();
try {
if (log.isDebugEnabled()) {
log.debug("Start portlet initialisation for "
+ config.getPortletName());
}
- this.portletConfig = config;
- PortletContext portletContext = config.getPortletContext();
synchronized (portletContext) {
init();
PortletStateHolder.init(portletContext);
@@ -76,7 +83,7 @@
} catch (FacesException e) {
throw new PortletException("Initialization error", e);
}
- exceptionHandler = createExceptionHandler(config);
+ exceptionHandler = createExceptionHandler(portletContext);
if (log.isDebugEnabled()) {
log.debug("Done portlet initialisation for "
+ config.getPortletName());
@@ -84,8 +91,8 @@
// getPortletContext().setAttribute(PORTLET_CONFIG, config);
}
- protected ExceptionHandler createExceptionHandler(PortletConfig config) {
- String exceptionHandlerClassName = config.getInitParameter(EXCEPTION_HANDLER_CLASS_PARAMETER);
+ protected ExceptionHandler createExceptionHandler(PortletContext portletContext) {
+ String exceptionHandlerClassName = portletContext.getInitParameter(EXCEPTION_HANDLER_CLASS_PARAMETER);
ExceptionHandler handler = null;
if(null != exceptionHandlerClassName){
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
@@ -119,12 +126,12 @@
// Boolean.valueOf(null != windowState.getViewId()));
try {
execute(facesContext);
+ // Save view state for a render phases.
facesContext.getApplication().getStateManager().saveSerializedView(
facesContext);
// save request scope variables and Faces Messages.
if (!facesContext.getResponseComplete()) {
windowState.saveRequest(facesContext);
-
} else {
String redirectViewId = (String) facesContext.getExternalContext().getRequestMap().get(AbstractExternalContext.REDIRECT_VIEW_ID);
if(null != redirectViewId){
@@ -173,30 +180,40 @@
}
String namespace = response.getNamespace();
windowState.restoreRequest(facesContext, true);
- if (null == facesContext.getViewRoot()) {
- execute(facesContext);
- // TODO - detect redirect case.
- }
- //
- AjaxContext ajaxContext = AjaxContext
- .getCurrentInstance(facesContext);
- Map commonAjaxParameters = ajaxContext.getCommonAjaxParameters();
- String actionURL = facesContext.getApplication().getViewHandler().getActionURL(facesContext, facesContext.getViewRoot().getViewId());
- commonAjaxParameters.put(AbstractExternalContext.ACTION__PARAMETER,
- facesContext.getExternalContext().encodeActionURL(actionURL));
- commonAjaxParameters.put(
- PortletStateHolder.STATE_ID_PARAMETER, windowState.getStateId());
- commonAjaxParameters.put(
- AbstractExternalContext.NAMESPACE_PARAMETER, namespace);
- render(facesContext);
+ renderResponse(facesContext, windowState);
// TODO - detect redirect case. Reset response, clear request variables as far as Seam state.
// Perform new render phase with a new ViewId.
String redirectViewId = (String) facesContext.getExternalContext().getRequestMap().get(AbstractExternalContext.REDIRECT_VIEW_ID);
if(null != redirectViewId){
+ windowState.reset();
windowState.setViewId(redirectViewId);
+ // Reset attributes to initial state
+ ArrayList initialAttributes = (ArrayList) request.getAttribute(AbstractExternalContext.EXCLUDED_PARAMETERS_ATTRIBUTE);
+ ArrayList currentAttributes = Collections.list(request.getAttributeNames());
+ currentAttributes.removeAll(initialAttributes);
+ for (Object newAttribute : currentAttributes) {
+ request.removeAttribute((String) newAttribute);
+ }
+ // Re-create FacesContext.
+ facesContext.release();
+ facesContext = getFacesContext(request, response);
+ renderResponse(facesContext, windowState);
}
+ // Set important Portal parameters to window state.
+ String actionURL = facesContext.getApplication().getViewHandler().getActionURL(facesContext, facesContext.getViewRoot().getViewId());
+ actionURL = facesContext.getExternalContext().encodeActionURL(actionURL);
+ windowState.setPortalActionURL(new PortalActionURL(actionURL));
+ PortletURL portletURL = response.createRenderURL();
+ portletURL.setParameter(PortletStateHolder.STATE_ID_PARAMETER, windowState.getStateId());
+ String renderUrl = portletURL.toString();
+ windowState.setPortalRenderURL(new PortalActionURL(renderUrl));
+ windowState.setNamespace(namespace);
// writer.println("</div>");
PortletSession portletSession = request.getPortletSession(true);
+ WindowIDRetriver idRetriver = (WindowIDRetriver) portletSession.getAttribute(PortletStateHolder.WINDOW_ID_RETRIVER);
+ if(null != idRetriver){
+ windowState.setWindowId(idRetriver.getWindowID());
+ }
Principal userPrincipal = request.getUserPrincipal();
// TODO - get user roles, defined in the portlet.xml ( ??? parse it ??? ), and store all values for a "isUserInRole(roleName)" calls
portletSession.setAttribute(AbstractExternalContext.PORTAL_USER_PRINCIPAL, userPrincipal, PortletSession.APPLICATION_SCOPE);
@@ -220,6 +237,26 @@
}
/**
+ * @param facesContext
+ * @param windowState
+ * @throws FacesException
+ */
+ private void renderResponse(FacesContext facesContext,
+ PortletViewState windowState) throws FacesException {
+ if (null == facesContext.getViewRoot()) {
+ execute(facesContext);
+ // TODO - detect redirect case.
+ }
+ //
+ AjaxContext ajaxContext = AjaxContext
+ .getCurrentInstance(facesContext);
+ Map commonAjaxParameters = ajaxContext.getCommonAjaxParameters();
+ commonAjaxParameters.put(
+ PortletStateHolder.STATE_ID_PARAMETER, windowState.getStateId());
+ render(facesContext);
+ }
+
+ /**
* @param request
* @param response
* @param actionPhase
@@ -234,7 +271,6 @@
request.setAttribute(Bridge.PORTLET_LIFECYCLE_PHASE, actionPhase);
request.setAttribute(AbstractExternalContext.PORTLET_CONFIG_ATTRIBUTE,
getPortletConfig());
- PortletSession session = request.getPortletSession();
}
/**
Modified: trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/application/PortletStateHolder.java
===================================================================
--- trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/application/PortletStateHolder.java 2008-01-23 01:30:55 UTC (rev 5547)
+++ trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/application/PortletStateHolder.java 2008-01-23 01:31:21 UTC (rev 5548)
@@ -4,8 +4,12 @@
package org.ajax4jsf.portlet.application;
import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
import java.util.Map;
import java.util.UUID;
+import java.util.Map.Entry;
import javax.faces.FacesException;
import javax.faces.context.ExternalContext;
@@ -43,7 +47,7 @@
*/
private static final long serialVersionUID = 3040262189850562853L;
- private static final String STATE_HOLDER = PortletStateHolder.class
+ public static final String STATE_HOLDER = PortletStateHolder.class
.getName();
private static final String DEFAULT = "default-";
@@ -146,7 +150,7 @@
String stateId = getStateId(context);
PortletViewState state;
synchronized (states) {
- state = (PortletViewState) states.get(stateId);
+ state = getWindowState(stateId);
if (null == state) {
state = new PortletViewState(stateId);
states.put(stateId, state);
@@ -155,11 +159,23 @@
return state;
}
+ /**
+ * @param stateId
+ * @return
+ */
+ public PortletViewState getWindowState(String stateId) {
+ PortletViewState state;
+ state = (PortletViewState) states.get(stateId);
+ return state;
+ }
+
private void removeSessionStates(String scoprId) {
synchronized (states) {
- for (String key : states.keySet()) {
+ // Iterate over copy of the keys, so LinkedHashSet do not support concurrent modifications.
+ for (Iterator<String> keysIterator = states.keySet().iterator();keysIterator.hasNext();) {
+ String key = keysIterator.next();
if (key.startsWith(scoprId)) {
- states.remove(key);
+ keysIterator.remove();
}
}
@@ -215,7 +231,7 @@
} else {
throw new FacesException();
}
- WindowIDRetriver idRetriver = (org.ajax4jsf.portlet.application.PortletStateHolder.WindowIDRetriver) portletSession
+ WindowIDRetriver idRetriver = (WindowIDRetriver) portletSession
.getAttribute(WINDOW_ID_RETRIVER);
if (null == idRetriver) {
idRetriver = new WindowIDRetriver(scopeId);
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 2008-01-23 01:30:55 UTC (rev 5547)
+++ trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/application/PortletViewState.java 2008-01-23 01:31:21 UTC (rev 5548)
@@ -22,6 +22,7 @@
import org.ajax4jsf.context.AjaxContext;
import org.ajax4jsf.portlet.context.AbstractExternalContext;
+import org.ajax4jsf.portlet.context.PortalActionURL;
/**
* @author asmirnov
@@ -73,15 +74,41 @@
private String viewId;
- private Map<String, String[]> _requestParameters;
+ private Map<String, String[]> requestParameters;
+
+ private String namespace;
+
+ private PortalActionURL portalActionURL;
+
+ private PortalActionURL portalRenderURL;
private final String stateId;
+
+ private String windowId;
+ /**
+ * @param stateId
+ */
public PortletViewState(String stateId) {
this.stateId = stateId;
}
/**
+ * @return the windowId
+ */
+ public String getWindowId() {
+ return windowId;
+ }
+
+ /**
+ * @param windowId the windowId to set
+ */
+ public void setWindowId(String windowId) {
+ this.windowId = windowId;
+ }
+
+
+ /**
* @return the stateId
*/
public String getStateId() {
@@ -258,7 +285,7 @@
beans.put(attributeName, entry.getValue());
}
}
- _requestParameters = new HashMap<String, String[]>(facesContext
+ requestParameters = new HashMap<String, String[]>(facesContext
.getExternalContext().getRequestParameterValuesMap());
// Seam hack - save conversation Id for a request parameter.
try {
@@ -266,7 +293,7 @@
.evaluateExpressionGet(facesContext, "#{conversation.id}",
Object.class);
if(null != conversationId){
- _requestParameters.put(AbstractExternalContext.CONVERSATION_ID_PARAMETER, new String[]{conversationId.toString()});
+ requestParameters.put(AbstractExternalContext.CONVERSATION_ID_PARAMETER, new String[]{conversationId.toString()});
}
} catch (Exception e) {
// Do nothing - no seam conversation found !
@@ -279,7 +306,9 @@
if (null != beans) {
requestMap.putAll(beans);
}
- requestMap.put(REQUEST_PARAMETERS_ATTRIBUTE, _requestParameters);
+ if (null != requestParameters) {
+ requestMap.put(REQUEST_PARAMETERS_ATTRIBUTE, requestParameters);
+ }
}
public void restoreRequest(FacesContext facesContext, boolean b) {
@@ -322,4 +351,58 @@
saveMessages(facesContext);
}
+ /**
+ * @return the namespace
+ */
+ public String getNamespace() {
+ return namespace;
+ }
+
+ /**
+ * @param namespace the namespace to set
+ */
+ public void setNamespace(String namespace) {
+ this.namespace = namespace;
+ }
+
+ /**
+ * @return the portalActionURL
+ */
+ public PortalActionURL getPortalActionURL() {
+ return portalActionURL;
+ }
+
+ /**
+ * @param portalActionURL the portalActionURL to set
+ */
+ public void setPortalActionURL(PortalActionURL actionURL) {
+ this.portalActionURL = actionURL;
+ }
+
+ /**
+ * @return the portalRenderURL
+ */
+ public PortalActionURL getPortalRenderURL() {
+ return portalRenderURL;
+ }
+
+ /**
+ * @param portalRenderURL the portalRenderURL to set
+ */
+ public void setPortalRenderURL(PortalActionURL portalURL) {
+ this.portalRenderURL = portalURL;
+ }
+
+ public void reset() {
+ this.requestParameters=null;
+ this.beans = null;
+ this.componentsState = null;
+ this.messages = null;
+ this.portalActionURL=null;
+ this.portalRenderURL=null;
+ this.treeStructure=null;
+ this.viewRoot=null;
+ this.viewId=null;
+ }
+
}
Modified: trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/PortalActionURL.java
===================================================================
--- trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/PortalActionURL.java 2008-01-23 01:30:55 UTC (rev 5547)
+++ trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/PortalActionURL.java 2008-01-23 01:31:21 UTC (rev 5548)
@@ -7,6 +7,7 @@
import java.net.URL;
import java.util.HashMap;
import java.util.Iterator;
+import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.regex.Matcher;
@@ -71,7 +72,7 @@
}
this.path = urlMatcher.group(5);
queryString = urlMatcher.group(7);
- parameters = new LinkedMap(30);
+ parameters = new LinkedHashMap<String, String>(30);
if (null != queryString) {
String[] queryParams = queryString.split("&");
for (int i = 0; i < queryParams.length; i++) {
@@ -87,6 +88,24 @@
}
/**
+ * Clone constructor
+ * @param src
+ */
+ public PortalActionURL(PortalActionURL src){
+ if(null == src){
+ throw new NullPointerException("Source URL is null");
+ }
+ this._length = src._length;
+ this.protocol = src.protocol;
+ this.host = src.host;
+ this.port = src.port;
+ this.path = src.path;
+ this.queryString = src.queryString;
+ this.parameters = new LinkedHashMap<String, String>(src.parameters);
+ this.authority = src.authority;
+ this.userInfo = src.userInfo;
+ }
+ /**
* @return the protocol
*/
public String getProtocol() {
Modified: trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/PortletExternalContextImpl.java
===================================================================
--- trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/PortletExternalContextImpl.java 2008-01-23 01:30:55 UTC (rev 5547)
+++ trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/PortletExternalContextImpl.java 2008-01-23 01:31:21 UTC (rev 5548)
@@ -60,7 +60,7 @@
if (null != webXml) {
_servletPath = webXml.getFacesServletPrefix();
}
- ArrayList excludedAttributes = Collections.list(request
+ List excludedAttributes = Collections.list(request
.getAttributeNames());
request.setAttribute(EXCLUDED_PARAMETERS_ATTRIBUTE, excludedAttributes);
}
Modified: trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/ServletExternalContextImpl.java
===================================================================
--- trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/ServletExternalContextImpl.java 2008-01-23 01:30:55 UTC (rev 5547)
+++ trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/context/ServletExternalContextImpl.java 2008-01-23 01:31:21 UTC (rev 5548)
@@ -32,6 +32,7 @@
import org.ajax4jsf.context.AjaxContext;
import org.ajax4jsf.portlet.AjaxPortletBridge;
import org.ajax4jsf.portlet.application.PortletStateHolder;
+import org.ajax4jsf.portlet.application.PortletViewState;
import org.ajax4jsf.portlet.application.PortletStateHolder.WindowIDRetriver;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -54,8 +55,26 @@
public ServletExternalContextImpl(ServletContext context,
HttpServletRequest request, HttpServletResponse response) {
super(context, request, response);
- ArrayList excludedAttributes = Collections.list(request.getAttributeNames());
+ ArrayList excludedAttributes = Collections.list(request
+ .getAttributeNames());
request.setAttribute(EXCLUDED_PARAMETERS_ATTRIBUTE, excludedAttributes);
+ PortletStateHolder portletStateHolder = (PortletStateHolder) context
+ .getAttribute(PortletStateHolder.STATE_HOLDER);
+ if (null != portletStateHolder) {
+ String stateId = request
+ .getParameter(PortletStateHolder.STATE_ID_PARAMETER);
+ if (null != stateId) {
+ PortletViewState windowState = portletStateHolder
+ .getWindowState(stateId);
+ namespace = windowState.getNamespace();
+ sessionPrefix = WindowIDRetriver.PORTLET_SCOPE_PREFIX
+ + windowState.getWindowId() + '?';
+ portalActionUrl = windowState.getPortalActionURL();
+ }
+ } else {
+ namespace="";
+ sessionPrefix="";
+ }
}
public void setResponseCharacterEncoding(String encoding) {
@@ -97,19 +116,6 @@
}
protected String getNamespace() {
- if (null == namespace) {
- Object requestParameter = getRequestParameter(NAMESPACE_PARAMETER);
- if (null != requestParameter) {
- namespace = (String) requestParameter;
- if (_log.isDebugEnabled()) {
- _log.debug("Namespace for a portlet instance is "
- + namespace);
- }
- } else {
- throw new FacesException(
- "AJAX call to portlet without namespace parameter");
- }
- }
return namespace;
}
@@ -228,36 +234,9 @@
private String sessionPrefix;
- private String getSessionPrefix() {
- if (sessionPrefix == null) {
- HttpSession session = getHttpRequest().getSession(false);
- String scopeId = getHttpRequest().getParameter(PortletStateHolder.STATE_ID_PARAMETER);
- if (null == scopeId || null == session) {
- throw new FacesException(
- "JSF request called without portlet state parameter");
- }
- Enumeration attributeNames = session.getAttributeNames();
- while (attributeNames.hasMoreElements() && null == sessionPrefix) {
- String name = (String) attributeNames.nextElement();
- if (PortletSessionUtil.decodeScope(name) == PortletSession.PORTLET_SCOPE
- && PortletSessionUtil.decodeAttributeName(name).equals(
- PortletStateHolder.WINDOW_ID_RETRIVER)) {
- PortletStateHolder.WindowIDRetriver attribute = (WindowIDRetriver) session.getAttribute(name);
- if (scopeId.startsWith(attribute.getScopeId())) {
- sessionPrefix = WindowIDRetriver.PORTLET_SCOPE_PREFIX+attribute.getWindowID()+'?';
- if (_log.isDebugEnabled()) {
- _log
- .debug("Prefix for a PORTLET_SCOPE session attributes: "
- + sessionPrefix);
- }
+ private PortalActionURL portalActionUrl;
- } }
- }
- if (null == sessionPrefix) {
- throw new FacesException(
- "Prefix for attributes in portlet session scope not found");
- }
- }
+ private String getSessionPrefix() {
return sessionPrefix;
}
@@ -312,20 +291,11 @@
@Override
protected String createActionUrl(Map<String, String> parameters) {
- String url = getHttpRequest().getParameter(ACTION__PARAMETER);
- if(null == url){
- throw new FacesException("No portal action url availible");
- }
- PortalActionURL portalUrl;
- try {
- portalUrl = new PortalActionURL(url);
- } catch (MalformedURLException e) {
- throw new FacesException("Malformed Portal Action URL "+url);
- }
+ PortalActionURL actionUrl = new PortalActionURL(portalActionUrl);
for (Entry<String, String> parameterEntry : parameters.entrySet()) {
- portalUrl.addParameter(parameterEntry.getKey(), parameterEntry.getValue());
+ actionUrl.addParameter(parameterEntry.getKey(), parameterEntry.getValue());
}
- return portalUrl.toString();
+ return actionUrl.toString();
}
/**
Modified: trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/lifecycle/PortalPhaseListener.java
===================================================================
--- trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/lifecycle/PortalPhaseListener.java 2008-01-23 01:30:55 UTC (rev 5547)
+++ trunk/extensions/portletbridge/portletbridge-impl/src/main/java/org/ajax4jsf/portlet/lifecycle/PortalPhaseListener.java 2008-01-23 01:31:21 UTC (rev 5548)
@@ -37,16 +37,16 @@
public void afterPhase(PhaseEvent event) {
PhaseId phaseId = event.getPhaseId();
FacesContext context = event.getFacesContext();
+ Object portletPhase = context.getExternalContext().getRequestMap()
+ .get(Bridge.PORTLET_LIFECYCLE_PHASE);
if (phaseId.equals(PhaseId.RESTORE_VIEW)) {
- Object portletPhase = context.getExternalContext().getRequestMap()
- .get(Bridge.PORTLET_LIFECYCLE_PHASE);
if (Bridge.PortletPhase.RenderPhase.equals(portletPhase)) {
context.renderResponse();
}
- } else if (phaseId.equals(PhaseId.INVOKE_APPLICATION)
+ } else if (null == portletPhase && (phaseId.equals(PhaseId.INVOKE_APPLICATION)
|| (!phaseId.equals(PhaseId.RENDER_RESPONSE) && context
- .getRenderResponse())) {
- // save request scope variables and Faces Messages.
+ .getRenderResponse()))) {
+ // save request scope variables and Faces Messages for a Servlet request.
PortletViewState windowState = PortletStateHolder.getInstance(
context).getWindowState(context);
windowState.saveRequest(context);
@@ -73,29 +73,20 @@
AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
Map commonAjaxParameters = ajaxContext.getCommonAjaxParameters();
- String portalActionUrl = requestParameters
- .get(AbstractExternalContext.ACTION__PARAMETER);
- if (null != portalActionUrl) {
- try {
- PortalActionURL pal = new PortalActionURL(portalActionUrl);
+ PortletStateHolder portletStateHolder = PortletStateHolder.getInstance(context);
+ String stateId = requestParameters.get(PortletStateHolder.STATE_ID_PARAMETER);
+ // Change viewId parameter in the portal action URL.
+ PortletViewState windowState = portletStateHolder
+ .getWindowState(stateId);
+ if (null != windowState) {
+ PortalActionURL pal = windowState.getPortalActionURL();
+ if (null != pal) {
pal.addParameter(AbstractExternalContext.VIEW_ID_PARAMETER,
context.getViewRoot().getViewId());
- commonAjaxParameters.put(
- AbstractExternalContext.ACTION__PARAMETER, pal
- .toString());
-
- } catch (MalformedURLException e) {
- // TODO: log exception ?
}
}
- commonAjaxParameters.put(
- AbstractExternalContext.NAMESPACE_PARAMETER,
- requestParameters
- .get(AbstractExternalContext.NAMESPACE_PARAMETER));
-
commonAjaxParameters.put(PortletStateHolder.STATE_ID_PARAMETER,
- requestParameters
- .get(PortletStateHolder.STATE_ID_PARAMETER));
+ stateId);
}
}
Modified: trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/Booking.java
===================================================================
--- trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/Booking.java 2008-01-23 01:30:55 UTC (rev 5547)
+++ trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/Booking.java 2008-01-23 01:31:21 UTC (rev 5548)
@@ -87,7 +87,7 @@
this.hotel = hotel;
}
-// @ManyToOne @NotNull
+ @ManyToOne @NotNull
public User getUser()
{
return user;
Modified: trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/User.java
===================================================================
--- trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/User.java 2008-01-23 01:30:55 UTC (rev 5547)
+++ trunk/samples/seamPortletEar/seamBooking/src/main/java/org/jboss/seam/example/booking/User.java 2008-01-23 01:31:21 UTC (rev 5548)
@@ -4,10 +4,7 @@
import static org.jboss.seam.ScopeType.SESSION;
import java.io.Serializable;
-import java.security.Principal;
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
@@ -18,8 +15,10 @@
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
+@Entity
@Name("user")
@Scope(SESSION)
+@Table(name="Customer")
public class User implements Serializable
{
private String username;
@@ -35,23 +34,19 @@
public User() {}
+ @NotNull
+ @Length(max=100)
public String getName()
{
- if (name == null) {
- ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
- Principal userPrincipal = externalContext.getUserPrincipal();
- if(null != userPrincipal){
- name = userPrincipal.getName();
- username = userPrincipal.toString();
- }
- }
- return name;
+ return name;
}
public void setName(String name)
{
this.name = name;
}
+ @NotNull
+ @Length(min=5, max=15)
public String getPassword()
{
return password;
@@ -61,6 +56,9 @@
this.password = password;
}
+ @Id
+ @Length(min=4, max=15)
+ @Pattern(regex="^\\w*$", message="not a valid username")
public String getUsername()
{
return username;
Modified: trunk/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/ajax4jsf/portlet/seam/PortalIdentity.java
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/ajax4jsf/portlet/seam/PortalIdentity.java 2008-01-23 01:30:55 UTC (rev 5547)
+++ trunk/samples/seamPortletEar/seamBookingPortlet/src/main/java/org/ajax4jsf/portlet/seam/PortalIdentity.java 2008-01-23 01:31:21 UTC (rev 5548)
@@ -23,11 +23,11 @@
* @author asmirnov
*
*/
-@Name("org.jboss.seam.security.identity")
-@Scope(SESSION)
-@BypassInterceptors
-@Install(precedence = APPLICATION, classDependencies = "javax.portlet.Portlet")
-@Startup
+//@Name("org.jboss.seam.security.identity")
+//@Scope(SESSION)
+//@BypassInterceptors
+//@Install(precedence = APPLICATION, classDependencies = "javax.portlet.Portlet")
+//@Startup
public class PortalIdentity extends Identity {
public PortalIdentity() {
Modified: trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/faces-config.xml 2008-01-23 01:30:55 UTC (rev 5547)
+++ trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/faces-config.xml 2008-01-23 01:31:21 UTC (rev 5548)
@@ -8,12 +8,6 @@
<view-handler>
org.ajax4jsf.portlet.application.PortletViewHandler
</view-handler>
- <state-manager>
- org.ajax4jsf.portlet.application.PortalStateManager
- </state-manager>
- <!--
- <view-handler>com.sun.facelets.FaceletPortletViewHandler</view-handler>
- -->
</application>
<factory>
<faces-context-factory>
Modified: trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/pages.xml
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/pages.xml 2008-01-23 01:30:55 UTC (rev 5547)
+++ trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/pages.xml 2008-01-23 01:31:21 UTC (rev 5548)
@@ -2,10 +2,12 @@
<pages xmlns="http://jboss.com/products/seam/pages"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.0.xsd"
-
- login-view-id="/home.xhtml"><!--
+ no-conversation-view-id="/main.xhtml"
+ login-view-id="/home.xhtml">
+ <!--
no-conversation-view-id="/main.xhtml"
- --><page view-id="/register.xhtml">
+ -->
+ <page view-id="/register.xhtml">
<action if="#{validation.failed}"
execute="#{register.invalid}"/>
Modified: trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/portlet.xml
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/portlet.xml 2008-01-23 01:30:55 UTC (rev 5547)
+++ trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/portlet.xml 2008-01-23 01:31:21 UTC (rev 5548)
@@ -11,12 +11,10 @@
<name>javax.portlet.faces.defaultViewId.view</name>
<value>/home.xhtml</value>
</init-param>
-<!--
<init-param>
<name>javax.portlet.faces.preserveActionParams</name>
<value>true</value>
</init-param>
--->
<expiration-cache>-0</expiration-cache>
<portlet-info>
<title>Seam Booking Example Portlet</title>
Modified: trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/seamBookingPortlet-object.xml
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/seamBookingPortlet-object.xml 2008-01-23 01:30:55 UTC (rev 5547)
+++ trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/seamBookingPortlet-object.xml 2008-01-23 01:31:21 UTC (rev 5548)
@@ -8,32 +8,11 @@
<component-ref>seamBookingPortletApp.seamBookingPortlet</component-ref>
</instance>
</deployment>
- <!--
<deployment>
<parent-ref>default</parent-ref>
<if-exists>overwrite</if-exists>
<page>
<page-name>seamBookingPortlet</page-name>
- <window>
- <window-name>ajaxportletWindow</window-name>
- <instance-ref>SeamBookingPortletInstance</instance-ref>
- <default>true</default>
- <region>center</region>
- <height>0</height>
- </window>
- <window>
- <window-name>ajaxportletSecondWindow</window-name>
- <instance-ref>SeamBookingPortletSecondInstance</instance-ref>
- <default>true</default>
- <region>center</region>
- <height>0</height>
- </window>
- </page>
- </deployment>
- -->
- <deployment>
- <if-exists>overwrite</if-exists>
- <parent-ref>default.default</parent-ref>
<window>
<window-name>seamBookingPortletWindow</window-name>
<instance-ref>SeamBookingPortletInstance</instance-ref>
@@ -41,7 +20,9 @@
<region>center</region>
<height>0</height>
</window>
- </deployment><!--
+ </page>
+ </deployment>
+<!--
<deployment>
<parent-ref>default</parent-ref>
<if-exists>overwrite</if-exists>
Modified: trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/web.xml 2008-01-23 01:30:55 UTC (rev 5547)
+++ trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/web.xml 2008-01-23 01:31:21 UTC (rev 5548)
@@ -11,6 +11,12 @@
org.ajax4jsf.portlet.application.FaceletPortletViewHandler
</param-value>
</context-param>
+ <context-param>
+ <param-name>org.ajax4jsf.portlet.ExceptionHandler</param-name>
+ <param-value>
+ org.ajax4jsf.portlet.SeamExceptionHandlerImpl
+ </param-value>
+ </context-param>
<!-- Seam -->
<listener>
Modified: trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/home.xhtml
===================================================================
--- trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/home.xhtml 2008-01-23 01:30:55 UTC (rev 5547)
+++ trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/home.xhtml 2008-01-23 01:31:21 UTC (rev 5548)
@@ -9,7 +9,6 @@
</div>
<div id="container">
<div id="sidebar">
- <ui:remove>
<h:form id="login">
<fieldset>
<div>
@@ -26,8 +25,6 @@
<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">
16 years, 11 months
JBoss Rich Faces SVN: r5547 - branches/3.1.x/test-applications/jsp/src/main/java/virtualEarth.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-01-22 20:30:55 -0500 (Tue, 22 Jan 2008)
New Revision: 5547
Modified:
branches/3.1.x/test-applications/jsp/src/main/java/virtualEarth/VirtualEarth.java
Log:
Invalid version specification for VirtualEarth fixed
Modified: branches/3.1.x/test-applications/jsp/src/main/java/virtualEarth/VirtualEarth.java
===================================================================
--- branches/3.1.x/test-applications/jsp/src/main/java/virtualEarth/VirtualEarth.java 2008-01-22 20:45:05 UTC (rev 5546)
+++ branches/3.1.x/test-applications/jsp/src/main/java/virtualEarth/VirtualEarth.java 2008-01-23 01:30:55 UTC (rev 5547)
@@ -2,7 +2,7 @@
public class VirtualEarth {
private String zoom;
- private String version;
+ private String version = "6";
public String getVersion() {
return version;
16 years, 11 months
JBoss Rich Faces SVN: r5546 - in trunk: ui/modal-panel/src/main/java/org/richfaces/renderkit and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2008-01-22 15:45:05 -0500 (Tue, 22 Jan 2008)
New Revision: 5546
Modified:
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
trunk/ui/modal-panel/src/main/java/org/richfaces/renderkit/ModalPanelRendererBase.java
trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/css/modalPanel.xcss
trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
trunk/ui/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx
Log:
http://jira.jboss.com/jira/browse/RF-1947
http://jira.jboss.com/jira/browse/RF-1654
http://jira.jboss.com/jira/browse/RF-1652
Modified: trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
===================================================================
--- trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2008-01-22 19:00:14 UTC (rev 5545)
+++ trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2008-01-22 20:45:05 UTC (rev 5546)
@@ -5,14 +5,6 @@
Richfaces.getComputedStyle = function(eltId, propertyName) {
var elt = $(eltId);
- // Fix situation when width or height are set in percentage.
- if ('width' == propertyName) {
- return (elt.clientWidth || elt.offsetWidth) + "px";
- }
- if ('height' == propertyName) {
- return (elt.clientHeight || elt.offsetHeight) + "px";
- }
-
if (elt.currentStyle) {
return elt.currentStyle[propertyName];
}
Modified: trunk/ui/modal-panel/src/main/java/org/richfaces/renderkit/ModalPanelRendererBase.java
===================================================================
--- trunk/ui/modal-panel/src/main/java/org/richfaces/renderkit/ModalPanelRendererBase.java 2008-01-22 19:00:14 UTC (rev 5545)
+++ trunk/ui/modal-panel/src/main/java/org/richfaces/renderkit/ModalPanelRendererBase.java 2008-01-22 20:45:05 UTC (rev 5546)
@@ -166,12 +166,6 @@
result.append("overflow: hidden; ");
- String style = (String)panel.getAttributes().get("style");
- if (null != style && !"".equals(style)) {
- result.append(style).
- append(" ");
-
- }
int minHeight = panel.getMinHeight();
int minWidth = panel.getMinWidth();
if (minWidth > -1) {
Modified: trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/css/modalPanel.xcss
===================================================================
--- trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/css/modalPanel.xcss 2008-01-22 19:00:14 UTC (rev 5545)
+++ trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/css/modalPanel.xcss 2008-01-22 20:45:05 UTC (rev 5546)
@@ -52,6 +52,11 @@
left: -32000px;
}
+ .rich-mp-content {
+ height: 100%;
+ width: 100%;
+ }
+
</f:verbatim>
<u:selector name=".dr-mpnl-spacer, .dr-mpnl-resizer">
@@ -62,11 +67,13 @@
<f:verbatim>
<![CDATA[
-.dr-mpnl-pnl{
+.dr-mpnl-pnl {
border-width: 1px;
border-style: solid;
padding : 1px;
background-color: inherit;
+ height: 100%;
+ width: 100%;
}
.dr-mpnl-pnl-h{
Modified: trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
===================================================================
--- trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2008-01-22 19:00:14 UTC (rev 5545)
+++ trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2008-01-22 20:45:05 UTC (rev 5546)
@@ -479,8 +479,6 @@
eContentDiv.style.overflow = "";
options.width = -1;
options.height = -1;
- eContentDiv.style.width="100%";
- eContentDiv.style.height="100%";
} else {
if (options.width && options.width == -1)
@@ -489,12 +487,13 @@
options.height = 200;
}
+ var eContentTable = $(this.contentTable);
if (options.width && options.width != -1) {
if (this.minWidth > options.width) {
options.width = this.minWidth;
}
- eContentDiv.style.width = options.width + (/px/.test(options.width) ? '' : 'px');
+ eContentTable.style.width = options.width + (/px/.test(options.width) ? '' : 'px');
}
if (options.height && options.height != -1) {
@@ -502,7 +501,7 @@
options.height = this.minHeight;
}
- eContentDiv.style.height = options.height + (/px/.test(options.height) ? '' : 'px');
+ eContentTable.style.height = options.height + (/px/.test(options.height) ? '' : 'px');
}
eCdiv.mpSet = true;
@@ -559,7 +558,7 @@
element.style.visibility = "hidden";
Element.show(element);
- this.correctShadowSizeEx(eContentDiv);
+ this.correctShadowSizeEx();
if (options.left) {
var _left;
@@ -706,9 +705,9 @@
var vetoeChange = false;
var newSize;
- var eContentDiv = $(this.contentDiv);
+ var eContentTable = $(this.contentTable);
- newSize = Richfaces.getComputedStyleSize(eContentDiv, "width");
+ newSize = Richfaces.getComputedStyleSize(eContentTable, "width");
var oldSize = newSize;
newSize += diff.deltaWidth || 0;
@@ -744,7 +743,7 @@
cssHash.left = newPos + 'px';
}
- newSize = Richfaces.getComputedStyleSize(eContentDiv, "height");
+ newSize = Richfaces.getComputedStyleSize(eContentTable, "height");
var oldSize = newSize;
newSize += diff.deltaHeight || 0;
@@ -788,8 +787,8 @@
Element.setStyle(eCdiv, cssHash);
- Element.setStyle(eContentDiv, cssHashWH);
- this.correctShadowSizeEx(eContentDiv);
+ Element.setStyle(eContentTable, cssHashWH);
+ this.correctShadowSizeEx();
Object.extend(this.userOptions, cssHash);
Object.extend(this.userOptions, cssHashWH);
@@ -847,14 +846,13 @@
},
correctShadowSize: function(event) {
- var eContentDiv = $(this.contentDiv);
- this.correctShadowSizeEx($(this.contentDiv));
+ this.correctShadowSizeEx();
},
- correctShadowSizeEx: function(eContentDiv) {
+ correctShadowSizeEx: function() {
var eShadowDiv = $(this.shadowDiv);
var eContentTable = $(this.contentTable);
- if (!eContentDiv || !eShadowDiv || !eContentTable) {
+ if (!eShadowDiv || !eContentTable) {
return;
}
var eIframe = $(this.iframe);
@@ -866,14 +864,11 @@
dx = eShadowDiv.offsetWidth-eShadowDiv.clientWidth;
dy = eShadowDiv.offsetHeight-eShadowDiv.clientHeight;
}
- var w = eContentDiv.parentNode.offsetWidth;
- var h = eContentDiv.parentNode.offsetHeight;
+ var w = eContentTable.offsetWidth;
+ var h = eContentTable.offsetHeight;
eShadowDiv.style.width = (w-dx)+"px";
eShadowDiv.style.height = (h-dy)+"px";
- eContentTable.style.width = w + "px";
- eContentTable.style.height = h + "px";
-
if (eIframe) {
eIframe.style.width = w+"px";
eIframe.style.height = h+"px";
Modified: trunk/ui/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx
===================================================================
--- trunk/ui/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx 2008-01-22 19:00:14 UTC (rev 5545)
+++ trunk/ui/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx 2008-01-22 20:45:05 UTC (rev 5546)
@@ -80,7 +80,12 @@
<div id="#{clientId}ShadowDiv" class="dr-mpnl-shadow rich-mpnl-shadow"
style="#{component.shadowStyle}" >
</div>
- <table id="#{clientId}ContentTable" cellpadding="0" cellspacing="0" border="0" style="position: absolute; z-index: 2;"><tbody><tr><td class="dr-mpnl-pnl">
+ <table id="#{clientId}ContentTable" cellpadding="0" cellspacing="0" border="0"
+ style="position: absolute; z-index: 2; width: #{component.minWidth}px; height: #{component.minHeight}px; #{component.attributes['style']};">
+ <tbody>
+ <tr>
+ <td class="dr-mpnl-pnl">
+
<div id="#{clientId}ContentDiv" style="#{this:getContentStyle(context, component)}" class="rich-mp-content">
<a href="#" class="dr-mpnl-pnl-a" id="#{clientId}FirstHref" >_</a>
16 years, 11 months