It's a HiveMind object provider.

http://tapestry.apache.org/tapestry4/tapestry/hivedocs/service/tapestry.serv
ices.EngineServiceObjectProvider.html



-----Original Message-----
From: Hajaansh [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 01, 2006 7:21 AM
To: Tapestry users
Subject: Re: DirectArea component in Tapestry 4

Perfect.

Where did you find that the name for the engine service was
engine-service:direct ?



On 9/1/06, Brian Long <[EMAIL PROTECTED]> wrote:
>
> Hajaansh,
>
> had the same problem myself when moving from 3 to 4, so here are the
> updated
> AreaLink.jwc and AreaLink.java that I use. The main difference in the use
> of
> property injection for the engine service.
>
> AreaLink.jwc
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE component-specification PUBLIC
>   "-//Apache Software Foundation//Tapestry Specification 4.0//EN"
>   "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd";>
>
> <component-specification
> class="com.yourProject.web.page.AreaLink"
> allow-body="no"
> allow-informal-parameters="yes">
>
> <!--<inject property="directService" object="engine-service:direct"/>-->
>
> <description>
> Creates a non-contextual link.  Non-persistent state can be stored within
> the link
> using the context.
> </description>
>
> <parameter name="listener" required="yes" />
>
> <parameter name="parameters" >
>     <description>
>     An object, or list of objects, encoded into the URL
>     as service parameters.
>     </description>
> </parameter>
>
> <reserved-parameter name="href"/>
>
> </component-specification>
>
> AreaLink.java
>
> package com.annadaletech.yourProject.web.jwc;
>
> import org.apache.tapestry.AbstractComponent;
> import org.apache.tapestry.IActionListener;
> import org.apache.tapestry.IDirect;
> import org.apache.tapestry.IMarkupWriter;
> import org.apache.tapestry.IRequestCycle;
> import org.apache.tapestry.Tapestry;
> import org.apache.tapestry.annotations.InjectObject;
> import org.apache.tapestry.engine.DirectServiceParameter;
> import org.apache.tapestry.engine.IEngineService;
> import org.apache.tapestry.engine.ILink;
> import org.apache.tapestry.link.DirectLink;
>
> public abstract class AreaLink extends AbstractComponent implements
> IDirect
> {
>
>     public abstract Object getParameters();
>     public abstract IActionListener getListener();
>
>     @InjectObject("engine-service:direct")
>     public abstract IEngineService getDirectService();
>
>     public void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
>     {
>       if (cycle.isRewinding())
>        return;
>
>       Object[] parameters = DirectLink.constructServiceParameters
> (getParameters());
>
>       //IEngineService service = getDirectService();
>       DirectServiceParameter dsParam = new
> DirectServiceParameter(this,parameters);
>       ILink link = getDirectService().getLink(false,dsParam);
>
>       writer.beginEmpty("area");
>       writer.attribute("href",link.getURL());
>
>       renderInformalParameters(writer,cycle);
>     }
>
>     public void trigger(IRequestCycle cycle)
>     {
>         IActionListener listener = getListener();
>
>         if (listener == null)
>          throw Tapestry.createRequiredParameterException(this,
> "listener");
>
>         listener.actionTriggered(this, cycle);
>     }
>
>     public boolean isStateful()
>     {
>      return false;
>     }
>
> }
>
> hivemodule.xml
>
> <contribution configuration-id="tapestry.url.ServiceEncoders">
>    <direct-service-encoder id="direct" stateless-extension="direct"
>                                      stateful-extension="sdirect"/>
> </contribution>
>
> yourProject.application
>
> <component-type type="AreaLink" specification-path="jwc/AreaLink.jwc" />
>
> I hope this helps . . .
>
> /Brian.
>
> On 9/1/06, Hajaansh <[EMAIL PROTECTED]> wrote:
> > I was wondering how to make a DirectArea component (getting callbacks on
> > Image Maps) for Tapestry 4 as the implementation for Tapestry 3 does not
> > work in Tapestry 4.
> >
> > And clues? I was looking at using the ILinkRenderer but to be honest I
> am
> > just getting in a muddle.
> >
> > Cheers,
> >
> > Hajaash
> >
> >
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to