That did it.
The only problem I have is that I have to downcast the result of
getRelativeResource to a ClasspathResource in order to use it in the
constructor for PrivateAsset.
I hate to downcast from interfaces, but it's a cleaner solution than
my previous one.
Thanks,
-Mike
On 3/24/06, Geoff
If you have a page in the same package you could (this is ugly)
Ipage page = cycle.getPage("foo");
page.getSpecification().getSpecificationLocation().getRelativeResource()
yada yada
of course you could inject a component in the same package and do the same.
In fact, if you used an absolute
Yep. I'm using the DefaultClassResolver in the current implementation
(see the OP).
The images folder is relative to the location of the component. If
the component is in /com/components/MyComponent, then the images are
all in /com/components/images.
It seems that the ideal solution would be a
what about new DefaultClassResolver() ?
Also, what exactly is the relative path to your images? Your
component/images ?
On 3/24/06, Geoff Longman <[EMAIL PROTECTED]> wrote:
>
> Bad me. I'm still on T3.
>
> Geoff
>
> On 3/24/06, Mike Snare <[EMAIL PROTECTED]> wrote:
> > IResourceResolver has be
We're all painfully aware of that, Spindle Guy...
Sorry, couldn't resist!
On 3/24/06, Geoff Longman <[EMAIL PROTECTED]> wrote:
> Bad me. I'm still on T3.
>
> Geoff
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional comma
Bad me. I'm still on T3.
Geoff
On 3/24/06, Mike Snare <[EMAIL PROTECTED]> wrote:
> IResourceResolver has been moved to HiveMind as the ClassResolver and
> the IEngine::getClassResolver method has been deprecated with a
> statement saying that the better way to get the resolver is to inject
> it a
IResourceResolver has been moved to HiveMind as the ClassResolver and
the IEngine::getClassResolver method has been deprecated with a
statement saying that the better way to get the resolver is to inject
it as a service (though I can't find a service-point in hivemind or
tapestry that exposes it).
Just create a new PrivateAsset and return it
public IAssert getAssert(int percentComplete) {
IResourceResolver = getPage().getEngine().getResourceResolver();
ClasspathResourceLocation imageFolder
= new ClasspathResourceLocation(resolver, "path to images");
return new
PrivateAsset(ima
Sorry. I wasn't clear.
There are 101 of these assets used by my component (one progress bar
image for each of the possible progress percents between 0 and 100,
inclusive).
I'd really rather not have to clutter the jwc file with 101 asset
element statements. I have a method in the component that
Yeah it is. You can use the xml spec method, or the asset
annotation. They resolve relatively to your component/page/whatever.
On 3/24/06, Mike Snare <[EMAIL PROTECTED]> wrote:
>
> Is there a service/utility that can be used by a page/component to
> retrieve an asset by relative path?
>
> I've go
Is there a service/utility that can be used by a page/component to
retrieve an asset by relative path?
I've got it working using the following code:
private IAsset getPrivateAsset(String relativePath) {
String path = "/path/to/my/class/" + relativePath;
// resolver is a DefaultClassResolver
11 matches
Mail list logo