No problem. Glad to help. Don't feel bad. I'm a HiveMind committer and I seem to learn something new when I start playing around with it in my projects! :-)
> It works great now! Thanks for your help. I'm still not that fluent in > hivemind. I learn something every time I need to use it. > > -----Original Message----- > From: James Carman [mailto:[EMAIL PROTECTED] > Sent: quarta-feira, 22 de março de 2006 17:45 > To: 'Tapestry users' > Subject: RE: Hivemind object in squeeze adaptor > > You're not using BuilderFactory to instantiate your squeeze adaptor. You > should define a service point for your squeeze adaptor and use that as > your > "object" for your contribution... > > <service-point id="EntityBeanSqueezeAdaptor" > interface="org.apache.tapestry.util.io.SqueezeAdaptor"> > <invoke-factory> > <construct > class="com.camerum.tapestry.squeeze.EntityBeanSqueezeAdaptor"> > </invoke-factory> > </service-point> > > <contribution configuration-id="tapestry.data.SqueezeAdaptors"> > <adaptor object="service:EntityBeanSqueezeAdaptor "/> > </contribution> > > -----Original Message----- > From: Denis Souza [mailto:[EMAIL PROTECTED] > Sent: Wednesday, March 22, 2006 3:40 PM > To: 'Tapestry users' > Subject: RE: Hivemind object in squeeze adaptor > > Here it is... > > In my hivemodule.xml: > > <contribution configuration-id="tapestry.data.SqueezeAdaptors"> > <adaptor > object="instance:com.camerum.tapestry.squeeze.EntityBeanSqueezeAdaptor"/> > </contribution> > > My squeeze adaptor class (I left out most of the body of the squeeze and > unsqueeze methods so it wouldn't take so much space). > > public class EntityBeanSqueezeAdaptor implements SqueezeAdaptor { > > public String getPrefix() { > return String.valueOf('*'); > } > > public Class getDataClass() { > return EntityBeanAbstract.class; > } > > public String squeeze(DataSqueezer squeezer, Object object) { > ... > return getPrefix() + id; > } > > public Object unsqueeze(DataSqueezer squeezer, String id) { > ... > return object; > } > > private ApplicationStateManager stateManager; > > public void setStateManager(ApplicationStateManager stateManager) { > this.stateManager = stateManager; > } > > ... that's about it. Inside the squeeze and unsqueeze methods the state > manager is always null. I also tried using "setApplicationStateManager" as > the setter method, but with the same results. > > > -----Original Message----- > From: James Carman [mailto:[EMAIL PROTECTED] > Sent: quarta-feira, 22 de março de 2006 17:24 > To: 'Tapestry users' > Subject: RE: Hivemind object in squeeze adaptor > > If HiveMind sees a "writable" property of a type for which it has exactly > one matching service point, it will set that property. I know this works, > because I do it in one of my own services. Can you post some code and > your > applicable hivemodule.xml file contents? > > -----Original Message----- > From: Denis Souza [mailto:[EMAIL PROTECTED] > Sent: Wednesday, March 22, 2006 3:21 PM > To: 'Tapestry users' > Subject: RE: Hivemind object in squeeze adaptor > > ... still not happening. The state manager remains null. > > Anyway I don't really understand how it could work. What's the logic with > this "autowire"? How does hivemind know to fill it in? > > -----Original Message----- > From: James Carman [mailto:[EMAIL PROTECTED] > Sent: quarta-feira, 22 de março de 2006 17:06 > To: 'Tapestry users' > Subject: RE: Hivemind object in squeeze adaptor > > Drop the set-object altogether. HiveMind will "autowire" it. > > -----Original Message----- > From: Denis Souza [mailto:[EMAIL PROTECTED] > Sent: Wednesday, March 22, 2006 3:04 PM > To: 'Tapestry users' > Subject: RE: Hivemind object in squeeze adaptor > > I did, it just won't allow me to use a "set-object" inside an adaptor tag: > > "Element adaptor/set-object is not allowed here." > > But since this is not allowed, I don't know how it can be done. > > -----Original Message----- > From: James Carman [mailto:[EMAIL PROTECTED] > Sent: quarta-feira, 22 de março de 2006 16:53 > To: 'Tapestry users' > Subject: RE: Hivemind object in squeeze adaptor > > Try adding a "setter" to your implementation class... > > public class MySqueezeAdaptor > { > private ApplicationStateManager stateManager; > > public void setStateManager( ApplicationStateManager stateManager ) > { > this.stateManager = stateManager; > } > } > > -----Original Message----- > From: Denis Souza [mailto:[EMAIL PROTECTED] > Sent: Wednesday, March 22, 2006 2:47 PM > To: 'Tapestry users' > Subject: Hivemind object in squeeze adaptor > > Hi, > > > > I'm implementing a squeeze adaptor for my app and I was wondering how I > could inject other hivemind objects or services into it. > > > > I would have guessed something like this: > > > > <contribution configuration-id="tapestry.data.SqueezeAdaptors"> > > <adaptor object="instance:MySqueezeAdaptor"> > > <set-object property="applicationStateManager" > value="infrastructure:applicationStateManager"/> > > </adaptor> > > </contribution> > > > > .but of course, it doesn't work. Can anyone help? > > > > Thanks, > > Denis > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > James Carman, President Carman Consulting, Inc. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
