public abstract class TemplatePage<T extends Template<?>,C extends Content>
extends org.apache.wicket.markup.html.WebPage
onInitialize() method.| Modifier and Type | Field and Description |
|---|---|
protected C |
contentDesc |
protected T |
template |
protected TemplateService |
templateService |
| Constructor and Description |
|---|
TemplatePage() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
allowOnPage(FacetMeta fm)
A Filter to check if a
FacetMeta should be added on Page or not |
protected void |
checkPageMatchesTemplate() |
protected C |
fetchContentForPage()
Get fresh
Content for the page based on its ContentContext |
protected abstract <T extends FacetMeta> |
getComponentForFacet(C contentDesc,
T facet)
Called by and added to page my iterateAndAddContentFacetsToPage().
Note: Addition contextual info about Locale & ContentContext can be derived by the
Component.getLocale() & getPageContext() methods. |
protected org.apache.wicket.MarkupContainer |
getContainerForFacet(org.apache.wicket.MarkupContainer container,
FacetMeta facet)
One can add components in a hierarchy using a
FacetMeta.getAttribute(String) with attribute FacetMeta.ATTRIB_NAMESPACE with a.b.c convention or a List a > b > c. |
protected C |
getContent()
Get current content being rendered by this page
|
protected C |
getContentDescriber(Status status)
This method does not guarantee the Entity from the DataStore neither does it guarantee a valid mapping; it simply guarantees an Identity Object
that can Identify the
ContentDescriber by name and Status. |
protected org.apache.wicket.MarkupContainer |
getFacetContainer()
By default the container for all the facets is the template page at row level.
|
protected C |
getNewContentInstance(String contentNameId) |
protected ContentContext |
getPageContext()
Get
ContentContext for current page |
protected Locale |
getPageLocale() |
Template<?> |
getTemplate()
Get the associated
Template with this component. |
protected Class<? extends TemplatePage> |
getTemplatePageClass() |
protected void |
iterateAndAddContentFacetsToPage(org.apache.wicket.MarkupContainer container,
C contentDesc,
Collection<? extends FacetMeta> facets)
Iterates over the collection of ? extends
ContentFacetMetas and adds them using {@link #getComponentForFacet(ContentFacet)} to the {@link TemplatePage}. |
void |
onInitialize() |
configureResponse, getMarkupType, getUrlCompressor, getWebRequestCycle, homePageLink, onAfterRender, onNewBrowserWindow, setHeadersafterCallComponent, beforeCallComponent, componentChanged, componentRendered, detachModels, dirty, endComponentRender, expireOldestVersion, getAjaxVersionNumber, getAutoIndex, getAutoIndex2, getCurrentVersionNumber, getId, getNumericId, getPageClass, getPageId, getPageMap, getPageMapEntry, getPageMapName, getPageParameters, getPageReference, getSizeInBytes, getStatelessHint, getVersion, getVersions, hierarchyAsString, ignoreVersionMerge, internalOnModelChanged, isBookmarkable, isErrorPage, isPageStateless, moveToPageMap, newVersionManager, onBeforeRender, onDetach, onPageAttached, onRedirect, onRender, prepareForRender, removePersistedFormData, renderPage, rollbackPage, setNumericId, setStatelessHint, startComponentRender, toString, writeReplaceadd, addOrReplace, autoAdd, autoAdd, contains, findMarkupStream, get, get, getAssociatedMarkupStream, getMarkupStream, hasAssociatedMarkup, internalAdd, isTransparentResolver, iterator, iterator, newMarkupResourceStream, onComponentTagBody, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderComponentTagBody, renderNext, replace, setDefaultModel, setMarkupStream, size, swap, toString, visitChildren, visitChildrenadd, addStateChange, afterRender, beforeRender, callOnBeforeRenderIfNotVisible, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, configure, continueToOriginalDestination, debug, detach, detachBehaviors, detachModel, determineVisibility, error, exceptionMessage, fatal, findPage, findParent, findParentWithAssociatedMarkup, getApplication, getBehaviors, getBehaviors, getBehaviorsRawList, getClassRelativePath, getComponentBorder, getConverter, getConverter, getDefaultModel, getDefaultModelObject, getDefaultModelObjectAsString, getDefaultModelObjectAsString, getEscapeModelStrings, getFeedbackMessage, getFlag, getFlag, getInnermostModel, getInnermostModel, getLocale, getLocalizer, getMarkupAttributes, getMarkupId, getMarkupId, getMarkupIdImpl, getMetaData, getModelComparator, getOutputMarkupId, getOutputMarkupPlaceholderTag, getPage, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getResponse, getSession, getString, getString, getString, getStyle, getVariation, hasBeenRendered, hasErrorMessage, hasFeedbackMessage, info, initModel, internalAttach, internalDetach, internalOnAttach, internalOnDetach, isActionAuthorized, isAncestorOf, isAttached, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isRenderAllowed, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, locateMarkupStream, markAttached, markRendering, modelChanged, modelChanging, onAttach, onBeginRequest, onComponentTag, onConfigure, onEndRequest, onModelChanged, onModelChanging, onRemove, prepareForRender, redirectToInterceptPage, remove, remove, render, render, renderComponent, renderComponent, renderComponentTag, rendered, renderHead, renderPlaceholderTag, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, setAuto, setComponentBorder, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setFlag, setIgnoreAttributeModifier, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setRedirect, setRenderBodyOnly, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisibilityAllowed, setVisible, urlFor, urlFor, urlFor, urlFor, urlFor, urlFor, visitParents, warn, wrap@SpringBean(name="defaultContentTemplateService") protected TemplateService templateService
protected boolean allowOnPage(FacetMeta fm)
FacetMeta should be added on Page or notprotected Class<? extends TemplatePage> getTemplatePageClass()
protected final void checkPageMatchesTemplate()
public Template<?> getTemplate()
Template with this component.Templateprotected C fetchContentForPage()
Content for the page based on its ContentContextcontentDesc,
getPageContext()public void onInitialize()
onInitialize in class org.apache.wicket.Componentprotected Locale getPageLocale()
protected ContentContext getPageContext()
ContentContext for current pageprotected C getContentDescriber(Status status)
ContentDescriber by name and Status.status - as Statusprotected org.apache.wicket.MarkupContainer getContainerForFacet(org.apache.wicket.MarkupContainer container,
FacetMeta facet)
FacetMeta.getAttribute(String) with attribute FacetMeta.ATTRIB_NAMESPACE with a.b.c convention or a List a > b > c. There "a" is the child of the container, and "c" would be its immediate parent
in the container hierarchy.container - as MarkupContainer, the main container for the dynamic elements for this pagefacet - as FacetMetaprotected void iterateAndAddContentFacetsToPage(org.apache.wicket.MarkupContainer container,
C contentDesc,
Collection<? extends FacetMeta> facets)
ContentFacetMetas and adds them using {@link #getComponentForFacet(ContentFacet)} to the {@link TemplatePage}.
container - @nullable true (if not null then it adds facets to specified container, else it adds to the page directly)contentDesc - as ContentDescriber @nullable truefacets - as Collection of ? extends ContentFacetprotected abstract <T extends FacetMeta> org.apache.wicket.Component getComponentForFacet(C contentDesc, T facet)
Locale & ContentContext can be derived by the
Component.getLocale() & getPageContext() methods.contentDesc - as ContentDescriberfacet - as T extends ContentFacet.#iterateAndAddContentFacetsToPage(ContentDescriber, Collection)protected org.apache.wicket.MarkupContainer getFacetContainer()
Template Facets are added to this.MarkupContainerprotected C getContent()
Copyright © 2018. All rights reserved.