1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.filter.instance.output; |
21 |
|
|
22 |
|
import org.xwiki.model.reference.DocumentReference; |
23 |
|
import org.xwiki.model.reference.EntityReference; |
24 |
|
import org.xwiki.properties.annotation.PropertyDescription; |
25 |
|
import org.xwiki.properties.annotation.PropertyName; |
26 |
|
import org.xwiki.rendering.syntax.Syntax; |
27 |
|
|
28 |
|
|
29 |
|
@version |
30 |
|
@since |
31 |
|
|
|
|
| 85.7% |
Uncovered Elements: 5 (35) |
Complexity: 17 |
Complexity Density: 0.94 |
|
32 |
|
public class DocumentInstanceOutputProperties extends InstanceOutputProperties |
33 |
|
{ |
34 |
|
|
35 |
|
@see |
36 |
|
|
37 |
|
private EntityReference defaultReference; |
38 |
|
|
39 |
|
|
40 |
|
@see |
41 |
|
|
42 |
|
private String saveComment = "Import"; |
43 |
|
|
44 |
|
|
45 |
|
@see |
46 |
|
|
47 |
|
private Syntax defaultSyntax; |
48 |
|
|
49 |
|
|
50 |
|
@see |
51 |
|
|
52 |
|
private boolean previousDeleted = true; |
53 |
|
|
54 |
|
|
55 |
|
@see |
56 |
|
|
57 |
|
private boolean versionPreserved = true; |
58 |
|
|
59 |
|
|
60 |
|
@see |
61 |
|
|
62 |
|
private DocumentReference author; |
63 |
|
|
64 |
|
|
65 |
|
@see |
66 |
|
|
67 |
|
private boolean authorSet; |
68 |
|
|
69 |
|
|
70 |
|
@see |
71 |
|
|
72 |
|
private boolean authorPreserved = true; |
73 |
|
|
74 |
|
|
75 |
|
@see |
76 |
|
|
77 |
|
private boolean stoppedWhenSaveFail = true; |
78 |
|
|
79 |
|
|
80 |
|
@return |
81 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
82 |
9116 |
@PropertyName("Default reference")... |
83 |
|
@PropertyDescription("The base reference to use to resolve reference from events") |
84 |
|
public EntityReference getDefaultReference() |
85 |
|
{ |
86 |
9116 |
return this.defaultReference; |
87 |
|
} |
88 |
|
|
89 |
|
|
90 |
|
@param |
91 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
92 |
496 |
public void setDefaultReference(EntityReference defaultReference)... |
93 |
|
{ |
94 |
496 |
this.defaultReference = defaultReference; |
95 |
|
} |
96 |
|
|
97 |
|
|
98 |
|
@return |
99 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
100 |
14 |
@PropertyName("Save comment")... |
101 |
|
@PropertyDescription("The comment to set when saving a document") |
102 |
|
public String getSaveComment() |
103 |
|
{ |
104 |
14 |
return this.saveComment; |
105 |
|
} |
106 |
|
|
107 |
|
|
108 |
|
@param |
109 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
110 |
4 |
public void setSaveComment(String saveComment)... |
111 |
|
{ |
112 |
4 |
this.saveComment = saveComment; |
113 |
|
} |
114 |
|
|
115 |
|
|
116 |
|
@return |
117 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
118 |
47 |
@PropertyName("Default syntax")... |
119 |
|
@PropertyDescription("The default syntax if not is provided in events") |
120 |
|
public Syntax getDefaultSyntax() |
121 |
|
{ |
122 |
47 |
return this.defaultSyntax; |
123 |
|
} |
124 |
|
|
125 |
|
|
126 |
|
@param |
127 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
128 |
0 |
public void setDefaultSyntax(Syntax defaultSyntax)... |
129 |
|
{ |
130 |
0 |
this.defaultSyntax = defaultSyntax; |
131 |
|
} |
132 |
|
|
133 |
|
|
134 |
|
@return |
135 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
136 |
12 |
@PropertyName("Delete existing document")... |
137 |
|
@PropertyDescription("Indicate if existing document should be deleted before importing the new one") |
138 |
|
public boolean isPreviousDeleted() |
139 |
|
{ |
140 |
12 |
return this.previousDeleted; |
141 |
|
} |
142 |
|
|
143 |
|
|
144 |
|
@param |
145 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
146 |
4 |
public void setPreviousDeleted(boolean previousDeleted)... |
147 |
|
{ |
148 |
4 |
this.previousDeleted = previousDeleted; |
149 |
|
} |
150 |
|
|
151 |
|
|
152 |
|
@return |
153 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
154 |
2971 |
@PropertyName("Preserve version")... |
155 |
|
@PropertyDescription("Indicate if the versions comming from the events should be kept") |
156 |
|
public boolean isVersionPreserved() |
157 |
|
{ |
158 |
2971 |
return this.versionPreserved; |
159 |
|
} |
160 |
|
|
161 |
|
|
162 |
|
@param |
163 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
164 |
2530 |
public void setVersionPreserved(boolean versionPreserved)... |
165 |
|
{ |
166 |
2530 |
this.versionPreserved = versionPreserved; |
167 |
|
} |
168 |
|
|
169 |
|
|
170 |
|
@return |
171 |
|
@since |
172 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
173 |
12 |
@PropertyName("Save author")... |
174 |
|
@PropertyDescription("The author to use when saving documents") |
175 |
|
public DocumentReference getAuthor() |
176 |
|
{ |
177 |
12 |
return this.author; |
178 |
|
} |
179 |
|
|
180 |
|
|
181 |
|
@param |
182 |
|
@since |
183 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
184 |
0 |
public void setAuthor(DocumentReference author)... |
185 |
|
{ |
186 |
0 |
this.author = author; |
187 |
0 |
this.authorSet = true; |
188 |
|
} |
189 |
|
|
190 |
|
|
191 |
|
@return |
192 |
|
@since |
193 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
194 |
88 |
public boolean isAuthorSet()... |
195 |
|
{ |
196 |
88 |
return this.authorSet; |
197 |
|
} |
198 |
|
|
199 |
|
|
200 |
|
@return |
201 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
202 |
80 |
@PropertyName("Preserve author")... |
203 |
|
@PropertyDescription("Indicate if the authors comming from the events should be kept." |
204 |
|
+ " If false the current user is used.") |
205 |
|
public boolean isAuthorPreserved() |
206 |
|
{ |
207 |
80 |
return !isAuthorSet() && this.authorPreserved; |
208 |
|
} |
209 |
|
|
210 |
|
|
211 |
|
@param |
212 |
|
@link |
213 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
214 |
5 |
public void setAuthorPreserved(boolean authorPreserved)... |
215 |
|
{ |
216 |
5 |
this.authorPreserved = authorPreserved; |
217 |
|
} |
218 |
|
|
219 |
|
|
220 |
|
@return |
221 |
|
@since |
222 |
|
@since |
223 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
224 |
12 |
@PropertyName("Stop when document save fail")... |
225 |
|
@PropertyDescription("Indicate if an exception should be thrown if a document save fail") |
226 |
|
public boolean isStoppedWhenSaveFail() |
227 |
|
{ |
228 |
12 |
return this.stoppedWhenSaveFail; |
229 |
|
} |
230 |
|
|
231 |
|
|
232 |
|
@param |
233 |
|
@since |
234 |
|
@since |
235 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
236 |
4 |
public void setStoppedWhenSaveFail(boolean stoppedWhenSaveFail)... |
237 |
|
{ |
238 |
4 |
this.stoppedWhenSaveFail = stoppedWhenSaveFail; |
239 |
|
} |
240 |
|
} |