Feature Requests item #1496116, was opened at 2006-05-27 21:06
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=684978&aid=1496116&group_id=119783

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: core
Group: None
Status: Open
Priority: 8
Submitted By: Eelco Hillenius (eelco12)
Assigned to: Nobody/Anonymous (nobody)
Summary: Better control over caching of resources

Initial Comment:
 If you look at the wizard component in trunk... I
(unfortunately) had to fix the fact that in 1.2. a
wizard step extends from a panel. We can't do this in
2.0 as construction can't be done until we have a
parent. What I didn't want to loose however, was the
fact that markup would be loaded for a step just like
panels (using the concrete step class).

In WizardStep I hid the actual panel (class Content),
and let that class delegate the loading of the markup:

                public IResourceStream newMarkupResourceStream(final
Class containerClass)
                {
                        return
WizardStep.this.newMarkupResourceStream(containerClass);
                }

and in WizardStep:

        protected IResourceStream
newMarkupResourceStream(final Class containerClass)
        {
                return newMarkupResourceStream(getClass(),
containerClass);
        }

and

        private final IResourceStream
newMarkupResourceStream(final Class stepClass,
                        final Class containerClass)
        {
                if (!stepClass.equals(WizardStep.class))
                {
                        String name = Strings.afterLast(stepClass.getName(),
'.') + ".html";
                        // try to load template with name of implementing
step class;
                        final URL url = stepClass.getResource(name);
                        if (url != null)
                        {
                                return new UrlResourceStream(url);
                        }
                        else
                        {
                                return
newMarkupResourceStream(stepClass.getSuperclass(),
containerClass);
                        }
                }

                // not resource was not found
                return null;
        }

However, this doesn't work properly as the markup is
cached on the name of the class (Content), while I
really need something more dynamic than that.

What I'd like is a mechanism such that either the
markup cache could be accessed directly (though that
probably would still often result in messy code) or
that users would have more control over the caching
indirectly.

For example... instead of having 

public IResourceStream newMarkupResourceStream(final
Class containerClass)

we could have

public ResourceStreamLookupResult
newMarkupResourceStream(final Class containerClass)

and 

public final class ResourceStreamLookupResult {
  private IResourceStream;
  private String cacheKey;
  private boolean watchChanges;
}

which would then be interpreted properly by MarkupCache
which is the caller of newMarkupResourceStream.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=684978&aid=1496116&group_id=119783


-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
Wicket-develop mailing list
Wicket-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to