You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Adam Henderson <ad...@azudio.co.uk> on 2005/09/08 14:10:08 UTC

Tapestry 4 Adding a new EngineService

Hi,
I'm attempting to add a new Engine Service to Tapestry 4,  
cannibalised from ChartService to do something vaguely similar, but  
I'm getting:

The value obtained using locator 'engine- 
service:dynimage' (<OuterProxy for engine service 'dynimage'>) is not  
compatible with the existing property (of type  
com.azudio.project1.DynImageService).

What does this mean exactly?

In my hivemodule.xml

     <service-point id="DynImageService"  
interface="com.azudio.project1.DynImageService">
         <invoke-factory>
             <construct class="com.azudio.project1.DynImageService">
                 <set-service property="builder" service- 
id="tapestry.request.AbsoluteURLBuilder" />
                 <set-service property="request" service- 
id="tapestry.globals.HttpServletRequest" />
                 <set-service property="response" service- 
id="tapestry.globals.HttpServletResponse" />
                 <set-object property="servletPath" value="app- 
property:org.apache.tapestry.servlet-path" />
                 <set-object property="linkFactory"  
value="infrastructure:linkFactory" />
             </construct>
         </invoke-factory>
     </service-point>

     <contribution configuration- 
id="tapestry.services.ApplicationServices">
         <service name="dynimage" object="service:DynImageService" />
     </contribution>

I've got a component DynImage that has the DynImageService injected  
into it:

     public abstract class DynImage extends BaseComponent {

         // Component Params
         public abstract IAsset getAsset();
         public abstract int getSize();

         // Component property
         public abstract String getUrl();
         public abstract void setUrl(String url);

         @InjectObject ("engine-service:dynimage")
         public abstract DynImageService getDynImageService();

         String assetUrl = getAsset().buildURL(cycle);

         ILink link = getDynImageService().getLink(cycle,false,new  
Object[]{assetUrl,getSize()});

         setString(link.getURL());

     }


Any ideas? is this enough info?
Thanks,

Adam

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Tapestry 4 Adding a new EngineService

Posted by Adam Henderson Azudio <az...@hotmail.com>.
Paul,

Nope, my hivemodule.xml looks ok, no spaces after the hyphen, its  
just where gmane has put in line breaks.

Adam.


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


RE: Tapestry 4 Adding a new EngineService

Posted by "seloha ." <se...@hotmail.com>.
I am not sure of the solution to your problem but a quick observation is 
that every "-" has a space after it e.g. "service- id" this does not seem 
right.

Hope this helps

Paul

Adam Henderson <ad...@azudio.co.uk> wrote:

Hi,
I'm attempting to add a new Engine Service to Tapestry 4,  cannibalised from 
ChartService to do something vaguely similar, but  I'm getting:

The value obtained using locator 'engine- service:dynimage' (<OuterProxy for 
engine service 'dynimage'>) is not  compatible with the existing property 
(of type  com.azudio.project1.DynImageService).

What does this mean exactly?

In my hivemodule.xml

    <service-point id="DynImageService"  
interface="com.azudio.project1.DynImageService">
        <invoke-factory>
            <construct class="com.azudio.project1.DynImageService">
                <set-service property="builder" service- 
id="tapestry.request.AbsoluteURLBuilder" />
                <set-service property="request" service- 
id="tapestry.globals.HttpServletRequest" />
                <set-service property="response" service- 
id="tapestry.globals.HttpServletResponse" />
                <set-object property="servletPath" value="app- 
property:org.apache.tapestry.servlet-path" />
                <set-object property="linkFactory"  
value="infrastructure:linkFactory" />
            </construct>
        </invoke-factory>
    </service-point>

    <contribution configuration- id="tapestry.services.ApplicationServices">
        <service name="dynimage" object="service:DynImageService" />
    </contribution>

I've got a component DynImage that has the DynImageService injected  into 
it:

    public abstract class DynImage extends BaseComponent {

        // Component Params
        public abstract IAsset getAsset();
        public abstract int getSize();

        // Component property
        public abstract String getUrl();
        public abstract void setUrl(String url);

        @InjectObject ("engine-service:dynimage")
        public abstract DynImageService getDynImageService();

        String assetUrl = getAsset().buildURL(cycle);

        ILink link = getDynImageService().getLink(cycle,false,new  
Object[]{assetUrl,getSize()});

        setString(link.getURL());

    }


Any ideas? is this enough info?
Thanks,

Adam

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org