org.apache.wicket.examples.customresourceloading
Class PageWithCustomLoading

java.lang.Object
  extended by org.apache.wicket.Component
      extended by org.apache.wicket.MarkupContainer
          extended by org.apache.wicket.Page
              extended by org.apache.wicket.markup.html.WebPage
                  extended by org.apache.wicket.examples.WicketExamplePage
                      extended by org.apache.wicket.examples.customresourceloading.PageWithCustomLoading
All Implemented Interfaces:
java.io.Serializable, java.lang.Iterable<Component>, IEventSink, IEventSource, IClusterable, IConverterLocator, IRedirectListener, IRequestListener, IHeaderContributor, IMarkupCacheKeyProvider, IMarkupResourceStreamProvider, IManageablePage, IRequestableComponent, IRequestablePage, IHierarchical<Component>

public class PageWithCustomLoading
extends WicketExamplePage
implements IMarkupResourceStreamProvider, IMarkupCacheKeyProvider

The markup for this page is loaded by the Page component itself.

Author:
Eelco Hillenius
See Also:
IMarkupResourceStreamProvider, IMarkupCacheKeyProvider, Serialized Form

Field Summary
 
Fields inherited from class org.apache.wicket.Component
ENABLE, FLAG_INITIALIZED, FLAG_REMOVING_FROM_HIERARCHY, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED8, PARENT_PATH, PATH_SEPARATOR, RENDER
 
Fields inherited from interface org.apache.wicket.IRedirectListener
INTERFACE
 
Constructor Summary
PageWithCustomLoading()
          Constructor
 
Method Summary
 java.lang.String getCacheKey(MarkupContainer container, java.lang.Class<?> containerClass)
          Prevent the markup from ever be cached.
 IResourceStream getMarkupResourceStream(MarkupContainer container, java.lang.Class<?> containerClass)
          This implementation loads from a custom name/ location.
 
Methods inherited from class org.apache.wicket.examples.WicketExamplePage
explain
 
Methods inherited from class org.apache.wicket.markup.html.WebPage
configureResponse, dirty, getMarkupType, homePageLink, onAfterRender, onRender, renderXmlDecl, setHeaders
 
Methods inherited from class org.apache.wicket.Page
componentChanged, componentRendered, detachModels, dirty, endComponentRender, getAutoIndex, getId, getPageClass, getPageId, getPageParameters, getPageReference, getRenderCount, getSizeInBytes, getStatelessHint, hierarchyAsString, internalOnModelChanged, internalPrepareForRender, isBookmarkable, isErrorPage, isPageStateless, onBeforeRender, onDetach, onRedirect, renderPage, setFreezePageId, setNumericId, setStatelessHint, setWasCreatedBookmarkable, startComponentRender, toString, wasCreatedBookmarkable, wasRendered
 
Methods inherited from class org.apache.wicket.MarkupContainer
add, addOrReplace, autoAdd, contains, get, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkup, hasAssociatedMarkup, internalAdd, internalInitialize, iterator, iterator, onAfterRenderChildren, onComponentTagBody, onMarkupAttached, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, setDefaultModel, size, swap, toString, visitChildren, visitChildren, visitChildren, visitChildren
 
Methods inherited from class org.apache.wicket.Component
add, addStateChange, afterRender, beforeRender, canCallListenerInterface, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, configure, continueToOriginalDestination, debug, detach, detachModel, determineVisibility, error, exceptionMessage, fatal, findMarkupStream, findPage, findParent, findParentWithAssociatedMarkup, getAjaxRegionMarkupId, getApplication, getBehaviorById, getBehaviorId, getBehaviors, getBehaviors, getClassRelativePath, getConverter, getDefaultModel, getDefaultModelObject, getDefaultModelObjectAsString, getDefaultModelObjectAsString, getEscapeModelStrings, getFeedbackMessage, getFeedbackMessages, getFlag, getInnermostModel, getInnermostModel, getLocale, getLocalizer, getMarkup, getMarkupAttributes, getMarkupId, getMarkupId, getMarkupIdFromMarkup, getMarkupIdImpl, getMarkupSourcingStrategy, getMetaData, getModelComparator, getOutputMarkupId, getOutputMarkupPlaceholderTag, getPage, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getRequestFlag, getResponse, getSession, getString, getString, getString, getStyle, getVariation, hasBeenRendered, hasErrorMessage, hasFeedbackMessage, info, initModel, internalRenderComponent, isActionAuthorized, isAuto, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isRenderAllowed, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, locateMarkupStream, markRendering, modelChanged, modelChanging, newMarkupSourcingStrategy, onComponentTag, onConfigure, onEvent, onInitialize, onModelChanged, onModelChanging, onRemove, prepareForRender, redirectToInterceptPage, remove, remove, render, renderComponentTag, rendered, renderHead, renderHead, renderHead, renderPlaceholderTag, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, send, setAuto, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setIgnoreAttributeModifier, setMarkup, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setParent, setRenderBodyOnly, setRequestFlag, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisibilityAllowed, setVisible, success, urlFor, urlFor, urlFor, urlFor, urlFor, visitParents, warn, wrap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.wicket.request.component.IRequestableComponent
canCallListenerInterface, detach, get, getBehaviorById, getBehaviorId, getPage, getPageRelativePath
 
Methods inherited from interface org.apache.wicket.page.IManageablePage
detach
 

Constructor Detail

PageWithCustomLoading

public PageWithCustomLoading()
Constructor

Method Detail

getMarkupResourceStream

public IResourceStream getMarkupResourceStream(MarkupContainer container,
                                               java.lang.Class<?> containerClass)
This implementation loads from a custom name/ location. While not advisable as the default way of loading resources, overriding this method can provide a component specific break out so that you e.g. can load a template from a database without any other component or the application having to know about it.

Specified by:
getMarkupResourceStream in interface IMarkupResourceStreamProvider
Parameters:
container - The MarkupContainer which requests to load the Markup resource stream
containerClass - The container the markup should be associated with
Returns:
A IResourceStream if the resource was found

getCacheKey

public java.lang.String getCacheKey(MarkupContainer container,
                                    java.lang.Class<?> containerClass)
Prevent the markup from ever be cached. This is optionally - components that don't implement IMarkupCacheKeyProvider will just have their markup cached - but is useful when markup varies. If you don't need such dynamic loading, it is advisible to not implement IMarkupCacheKeyProvider.

Specified by:
getCacheKey in interface IMarkupCacheKeyProvider
Parameters:
container - The MarkupContainer object requesting the markup cache key
containerClass - The container the markup should be associated with
Returns:
A IResourceStream if the resource was found
See Also:
IMarkupCacheKeyProvider.getCacheKey(org.apache.wicket.MarkupContainer, java.lang.Class)


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.