Re: overloading src attribute of @Image component

2007-02-14 Thread Ken nashua
Still blue in the face... This is the markup that comes from @Asset("") which works... but this does not present a solution. This is the markup from manual api calls to create an asset this fails always Best regards Ken in nashua

Re: overloading src attribute of @Image component

2007-02-14 Thread Ken nashua
Alright that was good and worked. thanks Andy... @InjectObject("service:tapestry.asset.ClasspathAssetFactory") public abstract AssetFactory getClasspathAssetFactory(); AssetFactory fact = getClasspathAssetFactory(); IAsset asset = fact.createAbsoluteAsset(map.get(co

Re: overloading src attribute of @Image component

2007-02-14 Thread andyhot
is 100% if it's a context asset If it's a classpath asset, you'll need http://tapestry.apache.org/tapestry4.1/tapestry-framework/hivedoc/service/tapestry.asset.ClasspathAssetFactory.html Makes sense now ??? Ken nashua wrote: Still blue in the face... This is the markup that comes from @Asset

Re: overloading src attribute of @Image component

2007-02-14 Thread Ken nashua
Still blue in the face... None of this works for 4.0... IAsset asset = new ContextAsset( getWebRequest().getContextPath(), new ContextResource(getServletContext(), file), getLocation(), cycle); asset = new ExternalAsset(

Re: overloading src attribute of @Image component

2007-02-14 Thread Ken nashua
Still blue in the face... Any takers ? Resource resource = new WebContextResource(getWebContext(), map.get(contentType).toString()); resource = new ContextResource(getServletContext(), map.get(contentType).toString()); if ( map.containsKey(contentType)) { Asse

Re: overloading src attribute of @Image component

2007-02-14 Thread Ken nashua
What is it about @Asset("/asset/icdoc.gif") that seems to succeed versus my last code does not? Best regards Ken in nashua _ Don’t miss your chance to WIN 10 hours of private jet travel from Microsoft Office Live http://clk.atdmt.

Re: overloading src attribute of @Image component

2007-02-14 Thread Ken nashua
Well nothing seems to work for 4.0. It looks like the contextPath is never acquired and it also complains about missing contextresource. Resource resource = new WebContextResource(getWebContext(), map.get(contentType).toString()); //resource = new ContextResource(getServletContext

Re: overloading src attribute of @Image component

2007-02-14 Thread andyhot
http://tapestry.apache.org/tapestry4.1/apidocs/org/apache/tapestry/asset/ContextAssetFactory.html http://tapestry.apache.org/tapestry4.1/tapestry-framework/hivedoc/service/tapestry.asset.ContextAssetFactory.html inject that service and .. use it Ken nashua wrote: Well my last solution has no rea

Re: overloading src attribute of @Image component

2007-02-14 Thread Ken nashua
This seems to workout nicely... @Asset("/asset/icdoc.gif") public abstract IAsset getWordDocAsset(); writer.attribute("src", getWordDocAsset().buildURL()); Best regards Ken in nashua _ Check out all that glitters with the MS

Re: overloading src attribute of @Image component

2007-02-14 Thread Ken nashua
Well my last solution has no real parsing teeth. How do i guess by content type which asset method to call. What I would prefer to do is get a handle to the assetfactory... (can someone provide a legit example?) And then acquire/create the asset by referencing my HashMap that tracks gif file

overloading src attribute of @Image component

2007-02-14 Thread Ken nashua
Pioneers/teammates... Can someone direct me as to proper code here. All I want to do is instrument/override the src attribute of the @Image component. INPUTS - psuedo @Override protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle) { map.put("application/m