Skip to content

Package: SiteNode

SiteNode

nameinstructionbranchcomplexitylinemethod
static {...}
M: 0 C: 11
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%

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.core.model;
28:
29: import javax.annotation.Nonnull;
30: import it.tidalwave.util.Key;
31: import it.tidalwave.role.SimpleComposite;
32: import it.tidalwave.northernwind.frontend.ui.Layout;
33:
34: /***********************************************************************************************************************
35: *
36: * A node of the site, mapped to a given URL.
37: *
38: * @stereotype Model
39: *
40: * @author Fabrizio Giudici
41: *
42: **********************************************************************************************************************/
43: public interface SiteNode extends Resource, SimpleComposite<SiteNode>
44: {
45: @SuppressWarnings("squid:S1700")
46: public static final Class<SiteNode> _SiteNode_ = SiteNode.class;
47:
48: /** The label used for creating navigation links to this {@code SiteNode}. */
49: public static final Key<String> P_NAVIGATION_LABEL = Key.of("navigationLabel", String.class);
50:
51: /** If sets to true, this property makes the {@code SiteNode} capable to match not only its {@code /relativeUri},
52: * but also {@code /relativeUri/something/else}; it is meant for nodes that accept REST path-style params. */
53: public static final Key<Boolean> P_MANAGES_PATH_PARAMS = Key.of("managesPathParams", Boolean.class);
54:
55: /*******************************************************************************************************************
56: *
57: * Returns the {@link Site} to which this {@code SiteNode} belongs to.
58: * TODO: push up to Resource
59: *
60: * @return the {@code Site}
61: *
62: ******************************************************************************************************************/
63: @Nonnull
64: public Site getSite();
65:
66: /*******************************************************************************************************************
67: *
68: * Returns the {@link Layout} of this {@code SiteNode}.
69: *
70: * @return the {@code Layout}
71: *
72: ******************************************************************************************************************/
73: @Nonnull
74: public Layout getLayout();
75:
76: /*******************************************************************************************************************
77: *
78: * Returns the relative URI of this {@code SiteNode}, which is the one exposed to the web. By default the relative
79: * URI is the same as the relative path of the associated file, but each {@code SiteNode} can override it by setting
80: * {@link #P_EXPOSED_URI}.
81: *
82: * @return the relative URI
83: *
84: ******************************************************************************************************************/
85: @Nonnull
86: public ResourcePath getRelativeUri();
87: }