1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 package info.magnolia.rest.delivery.jcr.v2;
35
36 import info.magnolia.jcr.util.NodeTypes.Content;
37 import info.magnolia.jcr.util.NodeTypes.ContentNode;
38 import info.magnolia.rest.reference.ReferenceDefinition;
39 import info.magnolia.rest.registry.ConfiguredEndpointDefinition;
40
41 import java.util.ArrayList;
42 import java.util.Collections;
43 import java.util.List;
44
45
46
47
48 public class ConfiguredJcrDeliveryEndpointDefinition extends ConfiguredEndpointDefinition implements JcrDeliveryEndpointDefinition {
49
50 private String workspace;
51 private String rootPath;
52 private boolean strict = false;
53 private List<String> nodeTypes = Collections.singletonList(Content.NAME);
54 private List<String> childNodeTypes = Collections.singletonList(ContentNode.NAME);
55 private List<String> systemProperties = new ArrayList<>();
56 private int depth = 0;
57 private int referenceDepth = 1;
58 private boolean referenceRepeat = false;
59 private long limit = 10;
60 private boolean includeSystemProperties = false;
61 private boolean bypassWorkspaceAcls = false;
62 private List<ReferenceDefinition> references = new ArrayList<>();
63 private boolean personalized = false;
64
65 public ConfiguredJcrDeliveryEndpointDefinition() {
66 setImplementationClass(JcrDeliveryEndpoint.class);
67 }
68
69 @Override
70 public String getWorkspace() {
71 return workspace;
72 }
73
74 public void setWorkspace(String workspace) {
75 this.workspace = workspace;
76 }
77
78 @Override
79 public String getRootPath() {
80 return rootPath;
81 }
82
83 public void setRootPath(String rootPath) {
84 this.rootPath = rootPath;
85 }
86
87 @Override
88 public boolean isStrict() {
89 return strict;
90 }
91
92 public void setStrict(boolean strict) {
93 this.strict = strict;
94 }
95
96 @Override
97 public List<String> getNodeTypes() {
98 return nodeTypes;
99 }
100
101 public void setNodeTypes(List<String> nodeTypes) {
102 this.nodeTypes = nodeTypes;
103 }
104
105 @Override
106 public List<String> getChildNodeTypes() {
107 return childNodeTypes;
108 }
109
110 public void setChildNodeTypes(List<String> childNodeTypes) {
111 this.childNodeTypes = childNodeTypes;
112 }
113
114 @Override
115 public int getDepth() {
116 return depth;
117 }
118
119 public void setDepth(int depth) {
120 this.depth = depth;
121 }
122
123 @Override
124 public int getReferenceDepth() {
125 return referenceDepth;
126 }
127
128 public void setReferenceDepth(int referenceDepth) {
129 if (referenceDepth >= 0) {
130 this.referenceDepth = referenceDepth;
131 }
132 }
133
134 @Override
135 public boolean isReferenceRepeat() {
136 return referenceRepeat;
137 }
138
139 public void setReferenceRepeat(boolean referenceRepeat) {
140 this.referenceRepeat = referenceRepeat;
141 }
142
143 @Override
144 public long getLimit() {
145 return limit;
146 }
147
148 public void setLimit(long limit) {
149 this.limit = limit;
150 }
151
152 @Override
153 public boolean isIncludeSystemProperties() {
154 return includeSystemProperties;
155 }
156
157 public void setIncludeSystemProperties(boolean includeSystemProperties) {
158 this.includeSystemProperties = includeSystemProperties;
159 }
160
161 @Override
162 public boolean isBypassWorkspaceAcls() {
163 return bypassWorkspaceAcls;
164 }
165
166 public void setBypassWorkspaceAcls(boolean bypassWorkspaceAcls) {
167 this.bypassWorkspaceAcls = bypassWorkspaceAcls;
168 }
169
170 @Override
171 public List<ReferenceDefinition> getReferences() {
172 return references;
173 }
174
175 public void setReferences(List<ReferenceDefinition> references) {
176 this.references = references;
177 }
178
179 @Override
180 public List<String> getSystemProperties() {
181 return systemProperties;
182 }
183
184 public void setSystemProperties(List<String> systemProperties) {
185 this.systemProperties = systemProperties;
186 }
187
188 @Override
189 public boolean isPersonalized() {
190 return personalized;
191 }
192
193 public void setPersonalized(final boolean personalized) {
194 this.personalized = personalized;
195 }
196 }