@CompileStatic class ScaffoldingViewResolver extends GroovyPageViewResolver implements ModelBuilder, ResourceLoaderAware
| Modifiers | Name | Description |
|---|---|---|
protected boolean |
enableNamespaceViewDefaults |
|
protected boolean |
enableReload |
|
protected java.util.Map<java.lang.String, View> |
generatedViewCache |
|
protected java.util.Set<java.lang.String> |
reportedPages |
The pages already reported as having no compiled page, so each is reported once. |
protected java.util.Map<java.lang.Class, java.lang.Object> |
scaffoldValueCache |
| Fields inherited from class | Fields |
|---|---|
class GroovyPageViewResolver |
GSP_SUFFIX, JSP_SUFFIX, groovyPageLocator, templateEngine |
| Type | Name and description |
|---|---|
ResourceLoader |
resourceLoader |
java.lang.Class |
templateOverridePluginDescriptor |
| Constructor and description |
|---|
ScaffoldingViewResolver() |
ScaffoldingViewResolver(java.lang.Class templateOverridePluginDescriptor)This constructor allows a plugin to override the default templates provided by the Scaffolding plugin. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
protected java.lang.String |
buildCacheKey(java.lang.String viewName) |
|
void |
clearCache() |
|
protected boolean |
inNativeImage()Whether this runs in a native image, which cannot expand a template into a page at runtime. |
|
protected boolean |
isDevelopmentMode()Whether the application is being developed. |
|
protected View |
loadView(java.lang.String viewName, java.util.Locale locale) |
|
protected boolean |
precompiledPagesInUse()Whether pages compiled by the build are used, which is whether the page locator uses them. |
|
protected boolean |
readsTemplatesFromProject()Whether templates are read from the project's src/main/templates, so that an edit to
one shows without a rebuild. |
|
void |
setEnableNamespaceViewDefaults(boolean enableNamespaceViewDefaults) |
|
void |
setEnableReload(boolean enableReload) |
|
protected View |
tryGenerateScaffoldedView(java.lang.String viewName, GrailsControllerClass controllerClass)Attempts to generate a scaffolded view for the given controller from the template it uses for a view it has none of: its namespace's, when it has a namespace and there is one, otherwise the general one. |
|
protected View |
tryGenerateScaffoldedView(java.lang.String viewName, GrailsControllerClass controllerClass, Closure<java.util.List<java.lang.String>> templatePaths)Attempts to generate a scaffolded view for the given controller |
| Methods inherited from class | Name |
|---|---|
class GroovyPageViewResolver |
call, clearCache, createFallbackView, createGrailsView, createGroovyPageView, createJstlView, getCacheTimeout, isAllowGrailsViewCaching, loadView, resolveCurrentControllerKeyPrefixes, setAllowGrailsViewCaching, setCacheTimeout, setGroovyPageLocator, setResolveJspView, setTemplateEngine |
The pages already reported as having no compiled page, so each is reported once.
This constructor allows a plugin to override the default templates provided by the Scaffolding plugin. The plugin that contains the template override should be configured to load AFTER the scaffolding plugin. An example implementation follows:
def loadAfter = ['scaffolding']
...
@Override
Closure doWithSpring() { { ->
jspViewResolver(ScaffoldingViewResolver, this.class) { bean ->
bean.lazyInit = true
bean.parent = "abstractViewResolver"
}}
Whether this runs in a native image, which cannot expand a template into a page at runtime.
Whether the application is being developed. Overridable because that is derived from the working directory when the class is loaded, and so cannot be varied any other way.
Whether pages compiled by the build are used, which is whether the page locator uses them.
Whether templates are read from the project's src/main/templates, so that an edit to
one shows without a rebuild. That is so during development, unless the application runs from
ahead-of-time artifacts: there the pages compiled at build time are used whatever the
surroundings suggest, and a page is found by the template it was compiled from, which is the
packaged one.
Attempts to generate a scaffolded view for the given controller from the template it uses for a view it has none of: its namespace's, when it has a namespace and there is one, otherwise the general one.
viewName - The view namecontrollerClass - The controller classAttempts to generate a scaffolded view for the given controller
viewName - The view namecontrollerClass - The controller classtemplatePaths - Closure giving, for a short view name, the template paths to try in order