Package: ViewController
ViewController
name | instruction | branch | complexity | line | method | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
findVirtualSiteNodes() |
|
|
|
|
|
||||||||||||||||||||
initialize() |
|
|
|
|
|
||||||||||||||||||||
prepareRendering(RenderContext) |
|
|
|
|
|
||||||||||||||||||||
renderView(RenderContext) |
|
|
|
|
|
Coverage
1: /*
2: * #%L
3: * *********************************************************************************************************************
4: *
5: * NorthernWind - lightweight CMS
6: * http://northernwind.tidalwave.it - git clone https://bitbucket.org/tidalwave/northernwind-src.git
7: * %%
8: * Copyright (C) 2011 - 2023 Tidalwave s.a.s. (http://tidalwave.it)
9: * %%
10: * *********************************************************************************************************************
11: *
12: * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
13: * the License. You may obtain a copy of the License at
14: *
15: * http://www.apache.org/licenses/LICENSE-2.0
16: *
17: * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
18: * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
19: * specific language governing permissions and limitations under the License.
20: *
21: * *********************************************************************************************************************
22: *
23: *
24: * *********************************************************************************************************************
25: * #L%
26: */
27: package it.tidalwave.northernwind.frontend.ui;
28:
29: import javax.annotation.Nonnull;
30: import it.tidalwave.util.Finder;
31: import it.tidalwave.northernwind.core.model.SiteNode;
32: import it.tidalwave.northernwind.frontend.ui.spi.VirtualSiteNode;
33:
34: /***********************************************************************************************************************
35: *
36: * The common ancestor of all controllers of views.
37: *
38: * @stereotype Presentation Controller
39: *
40: * @author Fabrizio Giudici
41: *
42: **********************************************************************************************************************/
43: @SuppressWarnings("squid:S00112")
44: public interface ViewController
45: {
46: /*******************************************************************************************************************
47: *
48: * Initializes the component. If the class has a superclass, remember to call {@code super.initialize()}.
49: * This method must execute quickly, as it is called whenever a new instance is created - consider that some
50: * components, such as the one rendering a site map, are likely to instantiate lots of controllers.
51: *
52: * @throws Exception in case of problems
53: *
54: ******************************************************************************************************************/
55: public default void initialize()
56: throws Exception
57: {
58: }
59:
60: /*******************************************************************************************************************
61: *
62: * Prepares the component for rendering, for instance by checking preconditions or by setting dynamic properties.
63: * If the class has a superclass, remember to call {@code super.prepareRendering(context)}.
64: *
65: * It should also do formal validation and eventually fail fast.
66: *
67: * @param context the context for rendering
68: * @throws Exception in case of problems
69: *
70: ******************************************************************************************************************/
71: public default void prepareRendering (@Nonnull final RenderContext context)
72: throws Exception
73: {
74: }
75:
76: /*******************************************************************************************************************
77: *
78: * Renders the component to a view.
79: *
80: * @param context the context for rendering
81: * @throws Exception in case of problems - it will cause a fatal error (such as HTTP status 500)
82: *
83: ******************************************************************************************************************/
84: public default void renderView (@Nonnull final RenderContext context)
85: throws Exception
86: {
87: }
88:
89: /*******************************************************************************************************************
90: *
91: * Controllers which manage composite site nodes must override this method and return a collection of
92: * {@link SiteNode}s, one for each composite content. For instance, the controller of a gallery should return the
93: * relative paths of all the media pages in the gallery; the controller of a blog should return the relative paths
94: * of all the posts.
95: *
96: * See {@link VirtualSiteNode} for a convenient implementation of {@code SiteNode} to return.
97: *
98: * @see VirtualSiteNode
99: * @return the virtual nodes
100: *
101: ******************************************************************************************************************/
102: @Nonnull
103: public default Finder<SiteNode> findVirtualSiteNodes()
104: {
105: return Finder.empty();
106: }
107: }