info.magnolia.module.templatingkit.templates
Class RedirectTemplateModel

java.lang.Object
  extended by info.magnolia.rendering.model.RenderingModelImpl<RD>
      extended by info.magnolia.module.templatingkit.templates.AbstractSTKTemplateModel<RD>
          extended by info.magnolia.module.templatingkit.templates.pages.STKPageModel<STKPage>
              extended by info.magnolia.module.templatingkit.templates.RedirectTemplateModel
All Implemented Interfaces:
STKRenderingModel<STKPage>, info.magnolia.rendering.model.RenderingModel<STKPage>

public class RedirectTemplateModel
extends STKPageModel<STKPage>

Model of the Redirect Template. 3 Redirect mode are available (depending of the 'path' value)

If the redirect is define (not empty path) the rendering is skipped avoiding the writing of the response (not allowed for response.redirect instruction).


Field Summary
protected static boolean HIDE_IN_NAV_DEFAULT_VALUE
           
protected static String HIDE_IN_NAV_PROPERTY_NAME
           
protected static String PATH_PROPERTY_NAME
           
 
Fields inherited from class info.magnolia.module.templatingkit.templates.pages.STKPageModel
damFunctions, LINK_PROP_NAME, LINK_TITLE_PROP_NAME
 
Fields inherited from class info.magnolia.module.templatingkit.templates.AbstractSTKTemplateModel
DEFAULT_SITEROOT_TEMPLATE_CATEGORY, stkFunctions, templatingFunctions
 
Fields inherited from class info.magnolia.rendering.model.RenderingModelImpl
content, contentMap, definition, parentModel
 
Fields inherited from interface info.magnolia.rendering.model.RenderingModel
SKIP_RENDERING
 
Constructor Summary
RedirectTemplateModel(javax.jcr.Node content, STKPage definition, info.magnolia.rendering.model.RenderingModel<?> parent, STKTemplatingFunctions stkFunctions, info.magnolia.templating.functions.TemplatingFunctions templatingFunctions, info.magnolia.dam.asset.functions.DamTemplatingFunctions damFunctions)
           
 
Method Summary
 String execute()
           
 String getRedirectPathToFirstChild()
           
protected  String getRedirectPathToInternalContent(String path)
           
protected  boolean hasPathDefined()
           
 boolean isInternalPath(String url)
           
protected  void setDefaultHideInNavValueIfNotExisting()
           
 
Methods inherited from class info.magnolia.module.templatingkit.templates.pages.STKPageModel
getBadgeWithoutTags, getBodyClass, getCategories, getCategoryLink, getContentNavigation, getImageModel, getLogoImageLink, getNavigation, getPrintLogoImageLink, resolveSectionPage
 
Methods inherited from class info.magnolia.module.templatingkit.templates.AbstractSTKTemplateModel
getSite, getSiteRoot
 
Methods inherited from class info.magnolia.rendering.model.RenderingModelImpl
getContent, getDef, getDefinition, getNode, getParent, getRoot
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface info.magnolia.rendering.model.RenderingModel
getContent, getDefinition, getNode, getParent, getRoot
 

Field Detail

PATH_PROPERTY_NAME

protected static final String PATH_PROPERTY_NAME
See Also:
Constant Field Values

HIDE_IN_NAV_PROPERTY_NAME

protected static final String HIDE_IN_NAV_PROPERTY_NAME
See Also:
Constant Field Values

HIDE_IN_NAV_DEFAULT_VALUE

protected static final boolean HIDE_IN_NAV_DEFAULT_VALUE
See Also:
Constant Field Values
Constructor Detail

RedirectTemplateModel

@Inject
public RedirectTemplateModel(javax.jcr.Node content,
                                    STKPage definition,
                                    info.magnolia.rendering.model.RenderingModel<?> parent,
                                    STKTemplatingFunctions stkFunctions,
                                    info.magnolia.templating.functions.TemplatingFunctions templatingFunctions,
                                    info.magnolia.dam.asset.functions.DamTemplatingFunctions damFunctions)
Method Detail

execute

public String execute()
Specified by:
execute in interface info.magnolia.rendering.model.RenderingModel<STKPage>
Overrides:
execute in class info.magnolia.rendering.model.RenderingModelImpl<STKPage>

setDefaultHideInNavValueIfNotExisting

protected void setDefaultHideInNavValueIfNotExisting()

getRedirectPathToInternalContent

protected String getRedirectPathToInternalContent(String path)
                                           throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

getRedirectPathToFirstChild

public String getRedirectPathToFirstChild()
                                   throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

hasPathDefined

protected boolean hasPathDefined()
                          throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

isInternalPath

public boolean isInternalPath(String url)


Copyright © 2008-2014 Magnolia International Ltd.. All Rights Reserved.