Author: alexsmirnov
Date: 2007-11-20 20:16:33 -0500 (Tue, 20 Nov 2007)
New Revision: 4125
Added:
trunk/extensions/portlet/src/test/resources/META-INF/
trunk/extensions/portlet/src/test/resources/META-INF/services/
trunk/extensions/portlet/src/test/resources/META-INF/services/javax.faces.context.FacesContextFactory
Modified:
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/ContextMap.java
trunk/extensions/portlet/src/test/java/javax/portlet/faces/GenericPortletTest.java
trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/pages.xml
Log:
Continue to implement JSR-301 bridge. Finish requrements from PLT 6.
Create Seam portlet example, based on the Seam booking store.
Modified:
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/ContextMap.java
===================================================================
---
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/ContextMap.java 2007-11-21
00:20:57 UTC (rev 4124)
+++
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/ContextMap.java 2007-11-21
01:16:33 UTC (rev 4125)
@@ -44,139 +44,142 @@
*
*/
abstract class ContextMap extends AbstractMap {
- private transient volatile Set keySet;
+ private transient volatile Set keySet;
- /*
- *
- * (non-Javadoc)
- *
- *
- *
- * @see java.util.Map#entrySet()
- *
- */
- public Set entrySet() {
- Set entries = new HashSet();
- for (Enumeration e = getEnumeration(); e.hasMoreElements();) {
- String paramName = (String) e.nextElement();
- if (isValidParameter(paramName)) {
- entries.add(new Entry(paramName, get(paramName)));
- }
+ /*
+ *
+ * (non-Javadoc)
+ *
+ *
+ *
+ * @see java.util.Map#entrySet()
+ *
+ */
+ public Set entrySet() {
+ Set entries = new HashSet();
+ for (Enumeration e = getEnumeration(); e.hasMoreElements();) {
+ String paramName = (String) e.nextElement();
+ if (isValidParameter(paramName)) {
+ entries.add(new Entry(paramName, get(paramName)));
+ }
+ }
+ return entries;
}
- return entries;
- }
- protected boolean isValidParameter(String paramName) {
- return true;
- }
+ protected boolean isValidParameter(String paramName) {
+ return true;
+ }
- public Set keySet() {
- if (this.keySet == null) {
- this.keySet = new AbstractSet() {
- public Iterator iterator() {
- return new EnumerationIterator(getEnumeration());
- }
+ public Set keySet() {
+ if (this.keySet == null) {
+ this.keySet = new AbstractSet() {
+ public Iterator iterator() {
+ return new EnumerationIterator(getEnumeration());
+ }
- public int size() {
- Enumeration enumeration = getEnumeration();
- int size = 0;
- while (enumeration.hasMoreElements()) {
- size++;
- }
- ;
- return size;
+ public int size() {
+ Enumeration enumeration = getEnumeration();
+ int size = 0;
+ while (enumeration.hasMoreElements()) {
+ enumeration.nextElement();
+ size++;
+ }
+ ;
+ return size;
+ }
+ };
}
- };
+ return this.keySet;
}
- return this.keySet;
- }
- public Collection values() {
- return super.values();
- }
+ public Collection values() {
+ return super.values();
+ }
- /**
- *
- *
- *
- * Template metod - all maps in ExternalFacesContext creates Set from
- *
- * parameters <code>Enumeration</code>
- *
- *
- *
- * @return enumeration for current map.
- *
- */
- protected abstract Enumeration getEnumeration();
+ /**
+ *
+ *
+ *
+ * Template metod - all maps in ExternalFacesContext creates Set from
+ *
+ * parameters <code>Enumeration</code>
+ *
+ *
+ *
+ * @return enumeration for current map.
+ *
+ */
+ protected abstract Enumeration getEnumeration();
- // Unsupported by all Maps.
- public void clear() {
- throw new UnsupportedOperationException();
- }
+ // Unsupported by all Maps.
+ public void clear() {
+ throw new UnsupportedOperationException();
+ }
-// public void putAll(Map t) {
-// for (Iterator entries = t.entrySet().iterator(); entries.hasNext();) {
-// Map.Entry entry = (Entry) entries.next();
-// put(entry.getKey(),entry.getValue());
-// }
-// }
+ // public void putAll(Map t) {
+ // for (Iterator entries = t.entrySet().iterator(); entries.hasNext();) {
+ // Map.Entry entry = (Entry) entries.next();
+ // put(entry.getKey(),entry.getValue());
+ // }
+ // }
- // Supported by maps if overridden
- public Object remove(Object key) {
- throw new UnsupportedOperationException();
- }
+ // Supported by maps if overridden
+ public Object remove(Object key) {
+ throw new UnsupportedOperationException();
+ }
- static class Entry implements Map.Entry {
- // immutable Entry
- private final Object key;
+ static class Entry implements Map.Entry {
+ // immutable Entry
+ private final Object key;
- private final Object value;
+ private final Object value;
- Entry(Object key, Object value) {
- this.key = key;
- this.value = value;
- }
+ Entry(Object key, Object value) {
+ this.key = key;
+ this.value = value;
+ }
- public Object getKey() {
- return this.key;
- }
+ public Object getKey() {
+ return this.key;
+ }
- public Object getValue() {
- return this.value;
- }
+ public Object getValue() {
+ return this.value;
+ }
- // No support of setting the value
- public Object setValue(Object value) {
- throw new UnsupportedOperationException();
- }
+ // No support of setting the value
+ public Object setValue(Object value) {
+ throw new UnsupportedOperationException();
+ }
- public int hashCode() {
- return ((this.key == null ? 0 : this.key.hashCode()) ^ (this.value == null ? 0
- : this.value.hashCode()));
+ public int hashCode() {
+ return ((this.key == null ? 0 : this.key.hashCode()) ^ (this.value == null ? 0
+ : this.value.hashCode()));
+ }
+
+ public boolean equals(Object obj) {
+ if ((obj == null) || !(obj instanceof Map.Entry)) {
+ return false;
+ }
+ Map.Entry input = (Map.Entry) obj;
+ Object inputKey = input.getKey();
+ Object inputValue = input.getValue();
+ if ((inputKey == this.key)
+ || ((inputKey != null) && inputKey.equals(this.key))) {
+ if ((inputValue == this.value)
+ || ((inputValue != null) && inputValue
+ .equals(this.value))) {
+ return true;
+ }
+ }
+ return false;
+ }
}
public boolean equals(Object obj) {
- if ((obj == null) || !(obj instanceof Map.Entry)) {
- return false;
- }
- Map.Entry input = (Map.Entry) obj;
- Object inputKey = input.getKey();
- Object inputValue = input.getValue();
- if ((inputKey == this.key) || ((inputKey != null) &&
inputKey.equals(this.key))) {
- if ((inputValue == this.value)
- || ((inputValue != null) && inputValue.equals(this.value))) {
- return true;
+ if ((obj == null) || !(obj instanceof ContextMap)) {
+ return false;
}
- }
- return false;
+ return super.equals(obj);
}
- }
-
- public boolean equals(Object obj) {
- if ((obj == null) || !(obj instanceof ContextMap)) {
- return false;
- }
- return super.equals(obj);
- }
}
\ No newline at end of file
Modified:
trunk/extensions/portlet/src/test/java/javax/portlet/faces/GenericPortletTest.java
===================================================================
---
trunk/extensions/portlet/src/test/java/javax/portlet/faces/GenericPortletTest.java 2007-11-21
00:20:57 UTC (rev 4124)
+++
trunk/extensions/portlet/src/test/java/javax/portlet/faces/GenericPortletTest.java 2007-11-21
01:16:33 UTC (rev 4125)
@@ -115,7 +115,7 @@
portletConfig.setPortletName("foo");
GenericFacesPortlet portlet = new GenericFacesPortlet();
portlet.init(portletConfig);
- assertEquals(AjaxFacesPortlet.class.getName(), portlet
+ assertEquals(AjaxPortletBridge.class.getName(), portlet
.getBrigeClassName());
assertEquals(Boolean.TRUE, portletContext
.getAttribute("javax.portlet.faces.foo.preserveActionParams"));
Added:
trunk/extensions/portlet/src/test/resources/META-INF/services/javax.faces.context.FacesContextFactory
===================================================================
---
trunk/extensions/portlet/src/test/resources/META-INF/services/javax.faces.context.FacesContextFactory
(rev 0)
+++
trunk/extensions/portlet/src/test/resources/META-INF/services/javax.faces.context.FacesContextFactory 2007-11-21
01:16:33 UTC (rev 4125)
@@ -0,0 +1 @@
+org.apache.shale.test.mock.MockFacesContextFactory
Modified:
trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/pages.xml
===================================================================
---
trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/pages.xml 2007-11-21
00:20:57 UTC (rev 4124)
+++
trunk/samples/seamPortletEar/seamBookingPortlet/src/main/webapp/WEB-INF/pages.xml 2007-11-21
01:16:33 UTC (rev 4125)
@@ -13,7 +13,7 @@
<navigation>
<rule if="#{register.registered}">
- <redirect view-id="/home.xhtml"/>
+ <render view-id="/home.xhtml"/>
</rule>
</navigation>
@@ -23,7 +23,7 @@
<navigation>
<rule if="#{identity.loggedIn}">
- <redirect view-id="/main.xhtml"/>
+ <render view-id="/main.xhtml"/>
</rule>
</navigation>
@@ -34,7 +34,7 @@
<navigation>
<rule if="#{changePassword.changed}">
- <redirect view-id="/main.xhtml"/>
+ <render view-id="/main.xhtml"/>
</rule>
</navigation>
@@ -44,11 +44,11 @@
login-required="true">
<navigation from-action="#{hotelBooking.selectHotel(hot)}">
- <redirect view-id="/hotel.xhtml"/>
+ <render view-id="/hotel.xhtml"/>
</navigation>
<navigation from-action="#{bookingList.cancel}">
- <redirect/>
+ <render/>
</navigation>
</page>
@@ -60,7 +60,7 @@
<description>View hotel: #{hotel.name}</description>
<navigation from-action="#{hotelBooking.bookHotel}">
- <redirect view-id="/book.xhtml"/>
+ <render view-id="/book.xhtml"/>
</navigation>
</page>
@@ -73,7 +73,7 @@
<navigation from-action="#{hotelBooking.setBookingDetails}">
<rule if="#{hotelBooking.bookingValid}">
- <redirect view-id="/confirm.xhtml"/>
+ <render view-id="/confirm.xhtml"/>
</rule>
</navigation>
@@ -86,7 +86,7 @@
<description>Confirm booking: #{booking.description}</description>
<navigation from-action="#{hotelBooking.confirm}">
- <redirect view-id="/main.xhtml"/>
+ <render view-id="/main.xhtml"/>
</navigation>
</page>
@@ -94,11 +94,11 @@
<page view-id="*">
<navigation from-action="#{identity.logout}">
- <redirect view-id="/home.xhtml"/>
+ <render view-id="/home.xhtml"/>
</navigation>
<navigation from-action="#{hotelBooking.cancel}">
- <redirect view-id="/main.xhtml"/>
+ <render view-id="/main.xhtml"/>
</navigation>
</page>
Show replies by date