Skip to content

Method: findVirtualSiteNodes()

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