Seam SVN: r8190 - trunk/src/wicket/org/jboss/seam/wicket.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-05-14 09:54:54 -0400 (Wed, 14 May 2008)
New Revision: 8190
Removed:
trunk/src/wicket/org/jboss/seam/wicket/SeamLink.java
Log:
Not needed after JBSEAM-2782
Deleted: trunk/src/wicket/org/jboss/seam/wicket/SeamLink.java
===================================================================
--- trunk/src/wicket/org/jboss/seam/wicket/SeamLink.java 2008-05-14 13:52:15 UTC (rev 8189)
+++ trunk/src/wicket/org/jboss/seam/wicket/SeamLink.java 2008-05-14 13:54:54 UTC (rev 8190)
@@ -1,47 +0,0 @@
-package org.jboss.seam.wicket;
-
-import org.apache.wicket.markup.html.link.ILinkListener;
-import org.apache.wicket.markup.html.link.Link;
-import org.apache.wicket.model.IModel;
-import org.apache.wicket.util.value.ValueMap;
-import org.jboss.seam.core.Conversation;
-import org.jboss.seam.core.Manager;
-
-/**
- * A SeamLink is like a Wicket Link, but will propagate the conversation
- *
- * This will probably be replaced in the future
- *
- * @author pmuir
- *
- */
-public abstract class SeamLink extends Link
-{
-
- public SeamLink(String id)
- {
- super(id);
- }
-
- public SeamLink(String id, IModel model)
- {
- super(id, model);
- }
-
- @Override
- protected CharSequence getURL()
- {
- return getRequestCycle().urlFor(this, ILinkListener.INTERFACE, getParameterMap());
- }
-
- private ValueMap getParameterMap()
- {
- ValueMap valueMap = new ValueMap();
- if (Conversation.instance().isLongRunning())
- {
- valueMap.add(Manager.instance().getConversationIdParameter(), Conversation.instance().getId());
- }
- return valueMap;
- }
-
-}
16 years, 6 months
Seam SVN: r8189 - trunk/examples/wicket/src/web/org/jboss/seam/example/wicket.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-05-14 09:52:15 -0400 (Wed, 14 May 2008)
New Revision: 8189
Modified:
trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Confirm.java
trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Hotel.java
Log:
Can now just use Link
Modified: trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Confirm.java
===================================================================
--- trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Confirm.java 2008-05-14 13:52:07 UTC (rev 8188)
+++ trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Confirm.java 2008-05-14 13:52:15 UTC (rev 8189)
@@ -8,12 +8,12 @@
import org.apache.wicket.PageParameters;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.link.Link;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.security.Restrict;
import org.jboss.seam.core.Conversation;
import org.jboss.seam.example.wicket.action.Booking;
import org.jboss.seam.example.wicket.action.HotelBooking;
-import org.jboss.seam.wicket.SeamLink;
@Restrict
public class Confirm extends WebPage
@@ -34,7 +34,7 @@
body.add(new OutputBorder("checkinDateBorder", "Check in", new Label("checkinDate", new SimpleDateFormat().format(booking.getCheckinDate()))));
body.add(new OutputBorder("checkoutDateBorder", "Check out", new Label("checkoutDate", new SimpleDateFormat().format(booking.getCheckoutDate()))));
body.add(new OutputBorder("creditCardNumberBorder", "Credit Card #", new Label("creditCardNumber", booking.getCreditCard())));
- body.add(new SeamLink("revise")
+ body.add(new Link("revise")
{
@Override
public void onClick()
@@ -42,7 +42,7 @@
setResponsePage(Book.class);
}
});
- body.add(new SeamLink("confirm")
+ body.add(new Link("confirm")
{
@Override
public void onClick()
@@ -51,7 +51,7 @@
setResponsePage(Main.class);
}
});
- body.add(new SeamLink("cancel")
+ body.add(new Link("cancel")
{
@Override
public void onClick()
Modified: trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Hotel.java
===================================================================
--- trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Hotel.java 2008-05-14 13:52:07 UTC (rev 8188)
+++ trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Hotel.java 2008-05-14 13:52:15 UTC (rev 8189)
@@ -3,10 +3,10 @@
import org.apache.wicket.PageParameters;
import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.link.Link;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.security.Restrict;
import org.jboss.seam.example.wicket.action.HotelBooking;
-import org.jboss.seam.wicket.SeamLink;
@Restrict
public class Hotel extends WebPage
@@ -21,7 +21,7 @@
{
super(parameters);
Template body = new Template("body");
- body.add(new SeamLink("bookHotel")
+ body.add(new Link("bookHotel")
{
@Override
public void onClick()
@@ -30,7 +30,7 @@
setResponsePage(Book.class);
}
});
- body.add(new SeamLink("cancel")
+ body.add(new Link("cancel")
{
@Override
public void onClick()
16 years, 6 months
Seam SVN: r8188 - trunk/examples/wicket/src/web/org/jboss/seam/example/wicket.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-05-14 09:52:07 -0400 (Wed, 14 May 2008)
New Revision: 8188
Modified:
trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Book.java
Log:
remove unused import
Modified: trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Book.java
===================================================================
--- trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Book.java 2008-05-14 13:49:52 UTC (rev 8187)
+++ trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Book.java 2008-05-14 13:52:07 UTC (rev 8188)
@@ -32,7 +32,6 @@
import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.markup.html.panel.ComponentFeedbackPanel;
import org.apache.wicket.model.PropertyModel;
-import org.apache.wicket.validation.ValidationError;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.security.Restrict;
import org.jboss.seam.example.wicket.action.Booking;
16 years, 6 months
Seam SVN: r8187 - trunk/src/wicket/org/jboss/seam/wicket.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-05-14 09:49:52 -0400 (Wed, 14 May 2008)
New Revision: 8187
Modified:
trunk/src/wicket/org/jboss/seam/wicket/SeamWebApplication.java
Log:
JBSEAM-2782
Modified: trunk/src/wicket/org/jboss/seam/wicket/SeamWebApplication.java
===================================================================
--- trunk/src/wicket/org/jboss/seam/wicket/SeamWebApplication.java 2008-05-14 10:31:12 UTC (rev 8186)
+++ trunk/src/wicket/org/jboss/seam/wicket/SeamWebApplication.java 2008-05-14 13:49:52 UTC (rev 8187)
@@ -4,7 +4,10 @@
import org.apache.wicket.RequestCycle;
import org.apache.wicket.Response;
import org.apache.wicket.Session;
+import org.apache.wicket.behavior.IBehaviorListener;
import org.apache.wicket.markup.html.form.IFormSubmitListener;
+import org.apache.wicket.markup.html.form.IOnChangeListener;
+import org.apache.wicket.markup.html.link.ILinkListener;
import org.apache.wicket.protocol.http.WebApplication;
import org.apache.wicket.protocol.http.WebRequestCycleProcessor;
import org.apache.wicket.protocol.http.WebSession;
@@ -28,7 +31,7 @@
*/
public abstract class SeamWebApplication extends WebApplication
{
-
+
/**
* Custom session with invalidation override. We can't just let Wicket
* invalidate the session as Seam might have to do some cleaning up to do.
@@ -36,22 +39,22 @@
@Override
public Session newSession(Request request, Response response)
{
- return new WebSession(request)
- {
-
- @Override
- public void invalidate()
- {
- org.jboss.seam.web.Session.getInstance().invalidate();
- }
-
- @Override
- public void invalidateNow()
- {
- // sorry, can't support this with Seam
- org.jboss.seam.web.Session.getInstance().invalidate();
- }
- };
+ return new WebSession(request)
+ {
+
+ @Override
+ public void invalidate()
+ {
+ org.jboss.seam.web.Session.getInstance().invalidate();
+ }
+
+ @Override
+ public void invalidateNow()
+ {
+ // sorry, can't support this with Seam
+ org.jboss.seam.web.Session.getInstance().invalidate();
+ }
+ };
}
@Override
@@ -70,22 +73,22 @@
@Override
protected CharSequence encode(RequestCycle requestCycle, final IListenerInterfaceRequestTarget requestTarget)
{
- if (IFormSubmitListener.INTERFACE.getName().equals(requestTarget.getRequestListenerInterface().getName()))
+ String name = requestTarget.getRequestListenerInterface().getName();
+ CharSequence url = super.encode(requestCycle, requestTarget);
+ if ( Manager.instance().isReallyLongRunningConversation() && (
+ IFormSubmitListener.INTERFACE.getName().equals(name) ||
+ ILinkListener.INTERFACE.getName().equals(name) ||
+ IBehaviorListener.INTERFACE.getName().equals(name) ||
+ IOnChangeListener.INTERFACE.getName().equals(name) ))
{
// TODO Do this nicely
- StringBuilder stringBuilder = new StringBuilder(super.encode(requestCycle, requestTarget));
- if (Manager.instance().isReallyLongRunningConversation())
- {
- stringBuilder.append("&" + Manager.instance().getConversationIdParameter() + "=" + Conversation.instance().getId());
- }
- return stringBuilder.subSequence(0, stringBuilder.length());
+ StringBuilder stringBuilder = new StringBuilder(url);
+ stringBuilder.append("&" + Manager.instance().getConversationIdParameter() + "=" + Conversation.instance().getId());
+ url = stringBuilder.subSequence(0, stringBuilder.length());
}
- else
- {
- return super.encode(requestCycle, requestTarget);
- }
+ return url;
}
-
+
@Override
protected CharSequence encode(RequestCycle requestCycle, IBookmarkablePageRequestTarget requestTarget)
{
@@ -98,25 +101,25 @@
stringBuilder.append("&" + Manager.instance().getConversationIdParameter() + "=" + Conversation.instance().getId());
}
return stringBuilder.subSequence(0, stringBuilder.length());
-
+
}
return super.encode(requestCycle, requestTarget);
}
-
+
};
}
};
- }
+ }
@Override
protected void init()
{
- super.init();
- inititializeSeamSecurity();
- initializeSeamInjection();
- initializeSeamStatusMessages();
+ super.init();
+ inititializeSeamSecurity();
+ initializeSeamInjection();
+ initializeSeamStatusMessages();
}
-
+
/**
* Add Seam Security to the wicket app.
*
@@ -128,8 +131,8 @@
{
getSecuritySettings().setAuthorizationStrategy(new SeamAuthorizationStrategy(getLoginPage()));
}
-
-
+
+
/**
* Add Seam injection support to your app. Required for proper functioning
*/
@@ -137,7 +140,7 @@
{
addComponentInstantiationListener(new SeamInjectionListener());
}
-
+
/**
* Add Seam status message transport support to youur app.
*/
@@ -145,7 +148,7 @@
{
addComponentOnBeforeRenderListener(new SeamStatusMessagesListener());
}
-
+
protected abstract Class getLoginPage();
}
16 years, 6 months
Seam SVN: r8185 - trunk/src/wicket/org/jboss/seam/wicket/ioc.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-05-13 18:22:11 -0400 (Tue, 13 May 2008)
New Revision: 8185
Modified:
trunk/src/wicket/org/jboss/seam/wicket/ioc/InjectionInterceptor.java
trunk/src/wicket/org/jboss/seam/wicket/ioc/Injector.java
Log:
Move injection stuff around
Modified: trunk/src/wicket/org/jboss/seam/wicket/ioc/InjectionInterceptor.java
===================================================================
--- trunk/src/wicket/org/jboss/seam/wicket/ioc/InjectionInterceptor.java 2008-05-13 22:21:53 UTC (rev 8184)
+++ trunk/src/wicket/org/jboss/seam/wicket/ioc/InjectionInterceptor.java 2008-05-13 22:22:11 UTC (rev 8185)
@@ -1,45 +1,29 @@
package org.jboss.seam.wicket.ioc;
-import static org.jboss.seam.ScopeType.STATELESS;
-import static org.jboss.seam.ScopeType.UNSPECIFIED;
-
import java.io.Serializable;
import java.lang.reflect.Method;
-import org.jboss.seam.Component;
-import org.jboss.seam.Namespace;
+import javassist.util.proxy.MethodHandler;
+
import org.jboss.seam.annotations.In;
-import org.jboss.seam.core.Expressions;
-import org.jboss.seam.core.Init;
-import org.jboss.seam.log.LogProvider;
-import org.jboss.seam.log.Logging;
import org.jboss.seam.util.Reflections;
-import javassist.util.proxy.MethodHandler;
-
-// TODO Replace with a client side Seam interceptor
-public class InjectionInterceptor implements MethodHandler, Serializable
+public abstract class InjectionInterceptor implements MethodHandler, Serializable
{
-
private String name;
private In annotation;
- private String metaModelName;
- private transient MetaModel metaModel;
public InjectionInterceptor(BijectedAttribute<In> in)
{
this.name = in.getName();
this.annotation = in.getAnnotation();
- this.metaModelName = in.getMetaModel().getMetaModelName();
}
-
- private static LogProvider log = Logging.getLogProvider(InjectionInterceptor.class);
public Object invoke(final Object proxy, final Method method, final Method proceed, final Object[] params) throws Throwable
{
if (!org.jboss.seam.web.Session.instance().isInvalid())
{
- return Reflections.invoke(method, getValueToInject(proxy), params);
+ return Reflections.invoke(method, getValueToInject(name, annotation, proxy), params);
}
else
{
@@ -47,74 +31,6 @@
}
}
- private Object getValueToInject(Object bean)
- {
- if ( name.startsWith("#") )
- {
- if ( log.isDebugEnabled() )
- {
- log.trace("trying to inject with EL expression: " + name);
- }
- return Expressions.instance().createValueExpression(name).getValue();
- }
- else if ( annotation.scope()==UNSPECIFIED )
- {
- if ( log.isDebugEnabled() )
- {
- log.trace("trying to inject with hierarchical context search: " + name);
- }
- return getInstanceInAllNamespaces(name, annotation.create());
- }
- else
- {
- if ( annotation.create() )
- {
- throw new IllegalArgumentException(
- "cannot combine create=true with explicit scope on @In: " +
- getMetaModel().getAttributeMessage(name)
- );
- }
- if ( annotation.scope()==STATELESS )
- {
- throw new IllegalArgumentException(
- "cannot specify explicit scope=STATELESS on @In: " +
- getMetaModel().getAttributeMessage(name)
- );
- }
-
-
- log.trace("trying to inject from specified context: " + name);
-
- if ( annotation.scope().isContextActive() )
- {
- return annotation.scope().getContext().get(name);
- }
- }
- return null;
- }
+ protected abstract Object getValueToInject(String name, In annotation, Object value);
- private Object getInstanceInAllNamespaces(String name, boolean create)
- {
- Object result;
- result = Component.getInstance(name, create);
- if (result==null)
- {
- for ( Namespace namespace: Init.instance().getGlobalImports() )
- {
- result = namespace.getComponentInstance(name, create);
- if (result!=null) break;
- }
- }
- return result;
- }
-
- private MetaModel getMetaModel()
- {
- if (metaModel == null)
- {
- metaModel = MetaModel.forName(metaModelName);
- }
- return metaModel;
- }
-
}
Modified: trunk/src/wicket/org/jboss/seam/wicket/ioc/Injector.java
===================================================================
--- trunk/src/wicket/org/jboss/seam/wicket/ioc/Injector.java 2008-05-13 22:21:53 UTC (rev 8184)
+++ trunk/src/wicket/org/jboss/seam/wicket/ioc/Injector.java 2008-05-13 22:22:11 UTC (rev 8185)
@@ -1,5 +1,7 @@
package org.jboss.seam.wicket.ioc;
+import static org.jboss.seam.ScopeType.STATELESS;
+import static org.jboss.seam.ScopeType.UNSPECIFIED;
import static org.jboss.seam.wicket.ioc.MetaModelUtils.createProxyFactory;
import static org.jboss.seam.wicket.ioc.MetaModelUtils.toName;
@@ -12,7 +14,13 @@
import javassist.util.proxy.ProxyObject;
+import org.jboss.seam.Component;
+import org.jboss.seam.Namespace;
import org.jboss.seam.annotations.In;
+import org.jboss.seam.core.Expressions;
+import org.jboss.seam.core.Init;
+import org.jboss.seam.log.LogProvider;
+import org.jboss.seam.log.Logging;
/**
* Controls injection for a MetaModel
@@ -26,7 +34,9 @@
private List<BijectedAttribute<In>> inAttributes = new ArrayList<BijectedAttribute<In>>();
- private MetaModel metaModel;
+ private final MetaModel metaModel;
+
+ private static LogProvider log = Logging.getLogProvider(Injector.class);
public Injector(MetaModel metaModel)
{
@@ -57,16 +67,21 @@
{
for ( BijectedAttribute<In> in : inAttributes )
{
- // Currently need a proxy here as Wicket has no native support for interceptors
- // TODO Replace this with a Seam ClientSide interceptor. Needs JBSEAM-699
- in.set( instance, wrap( instance, in ) );
+ in.set( instance, wrap( in, metaModel.getMetaModelName() ) );
}
}
- private static Object wrap(Object bean, BijectedAttribute<In> in) throws Exception
+ private static Object wrap(final BijectedAttribute<In> in, final String metaModelName) throws Exception
{
ProxyObject proxy = getProxyFactory(in.getType()).newInstance();
- proxy.setHandler(new InjectionInterceptor(in));
+ proxy.setHandler(new InjectionInterceptor(in)
+ {
+ @Override
+ protected Object getValueToInject(String name, In annotation, Object value)
+ {
+ return getValue(name, annotation, metaModelName, value);
+ }
+ });
return proxy;
}
@@ -84,4 +99,70 @@
}
}
+ private static Object getValue(String name, In annotation, String metaModelName, Object bean)
+ {
+ if ( name.startsWith("#") )
+ {
+ if ( log.isDebugEnabled() )
+ {
+ log.trace("trying to inject with EL expression: " + name);
+ }
+ return Expressions.instance().createValueExpression(name).getValue();
+ }
+ else if ( annotation.scope()==UNSPECIFIED )
+ {
+ if ( log.isDebugEnabled() )
+ {
+ log.trace("trying to inject with hierarchical context search: " + name);
+ }
+ return getInstanceInAllNamespaces(name, annotation.create());
+ }
+ else
+ {
+ if ( annotation.create() )
+ {
+ throw new IllegalArgumentException(
+ "cannot combine create=true with explicit scope on @In: " +
+ getMetaModel(metaModelName).getAttributeMessage(name)
+ );
+ }
+ if ( annotation.scope()==STATELESS )
+ {
+ throw new IllegalArgumentException(
+ "cannot specify explicit scope=STATELESS on @In: " +
+ getMetaModel(metaModelName).getAttributeMessage(name)
+ );
+ }
+
+
+ log.trace("trying to inject from specified context: " + name);
+
+ if ( annotation.scope().isContextActive() )
+ {
+ return annotation.scope().getContext().get(name);
+ }
+ }
+ return null;
+ }
+
+ private static Object getInstanceInAllNamespaces(String name, boolean create)
+ {
+ Object result;
+ result = Component.getInstance(name, create);
+ if (result==null)
+ {
+ for ( Namespace namespace: Init.instance().getGlobalImports() )
+ {
+ result = namespace.getComponentInstance(name, create);
+ if (result!=null) break;
+ }
+ }
+ return result;
+ }
+
+ private static MetaModel getMetaModel(String metaModelName)
+ {
+ return MetaModel.forName(metaModelName);
+ }
+
}
16 years, 6 months
Seam SVN: r8184 - trunk/examples/wicket/src/web/org/jboss/seam/example/wicket.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-05-13 18:21:53 -0400 (Tue, 13 May 2008)
New Revision: 8184
Modified:
trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Main.java
Log:
OOps
Modified: trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Main.java
===================================================================
--- trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Main.java 2008-05-13 21:09:49 UTC (rev 8183)
+++ trunk/examples/wicket/src/web/org/jboss/seam/example/wicket/Main.java 2008-05-13 22:21:53 UTC (rev 8184)
@@ -74,7 +74,7 @@
body.add(hotelSearchForm);
messages = new ComponentFeedbackPanel("messages", this).setOutputMarkupId(true);
- add(messages);
+ body.add(messages);
/*
* Hotel Search results
16 years, 6 months
Seam SVN: r8183 - trunk/src/main/org/jboss/seam.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-05-13 17:09:49 -0400 (Tue, 13 May 2008)
New Revision: 8183
Modified:
trunk/src/main/org/jboss/seam/Component.java
Log:
javadoc
Modified: trunk/src/main/org/jboss/seam/Component.java
===================================================================
--- trunk/src/main/org/jboss/seam/Component.java 2008-05-13 19:05:58 UTC (rev 8182)
+++ trunk/src/main/org/jboss/seam/Component.java 2008-05-13 21:09:49 UTC (rev 8183)
@@ -1458,7 +1458,7 @@
}
/**
- * Wrap a CGLIB interceptor around an instance of the component
+ * Wrap a Javassist interceptor around an instance of the component
*/
public Object wrap(Object bean, MethodHandler interceptor) throws Exception
{
16 years, 6 months
Seam SVN: r8182 - branches/Seam_2_0/build.
by seam-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2008-05-13 15:05:58 -0400 (Tue, 13 May 2008)
New Revision: 8182
Modified:
branches/Seam_2_0/build/default.build.properties
Log:
Revert qualifier back to "-SNAPSHOT" for Seam_2_0 branch development targeting 2.0.3.GA
Modified: branches/Seam_2_0/build/default.build.properties
===================================================================
--- branches/Seam_2_0/build/default.build.properties 2008-05-13 19:00:39 UTC (rev 8181)
+++ branches/Seam_2_0/build/default.build.properties 2008-05-13 19:05:58 UTC (rev 8182)
@@ -7,8 +7,8 @@
# ------------
major.version 2
minor.version .0
-patchlevel .2
-qualifier .GA
+patchlevel .3
+qualifier -SNAPSHOT
#
# Other program locations
# -----------------------
16 years, 6 months
Seam SVN: r8181 - tags.
by seam-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2008-05-13 15:00:39 -0400 (Tue, 13 May 2008)
New Revision: 8181
Added:
tags/JBoss_Seam_2_0_2_GA/
Log:
create JBoss_Seam_2_0_2_GA tag
Copied: tags/JBoss_Seam_2_0_2_GA (from rev 8180, branches/Seam_2_0)
16 years, 6 months