1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.crypto.store.wiki.internal; |
21 |
|
|
22 |
|
import javax.inject.Named; |
23 |
|
import javax.inject.Singleton; |
24 |
|
|
25 |
|
import org.xwiki.component.annotation.Component; |
26 |
|
|
27 |
|
import com.xpn.xwiki.doc.XWikiDocument; |
28 |
|
import com.xpn.xwiki.internal.mandatory.AbstractMandatoryDocumentInitializer; |
29 |
|
import com.xpn.xwiki.objects.classes.BaseClass; |
30 |
|
import com.xpn.xwiki.objects.classes.TextAreaClass; |
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
|
35 |
|
@version |
36 |
|
@since |
37 |
|
|
38 |
|
@Component |
39 |
|
@Named("Crypto.SignatureClass") |
40 |
|
@Singleton |
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 2 |
Complexity Density: 0.33 |
|
41 |
|
public class SignatureClassDocumentInitializer extends AbstractMandatoryDocumentInitializer |
42 |
|
{ |
43 |
|
|
44 |
|
|
45 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
46 |
0 |
public SignatureClassDocumentInitializer()... |
47 |
|
{ |
48 |
0 |
super(DefaultSignatureStore.SIGNATURECLASS); |
49 |
|
} |
50 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
|
51 |
0 |
@Override... |
52 |
|
public boolean updateDocument(XWikiDocument document) |
53 |
|
{ |
54 |
0 |
BaseClass bclass = document.getXClass(); |
55 |
|
|
56 |
0 |
boolean needsUpdate = bclass.addTextField(DefaultSignatureStore.SIGNATURECLASS_PROP_REFERENCE, "Reference", 64); |
57 |
|
|
58 |
0 |
needsUpdate |= bclass.addTextAreaField(DefaultSignatureStore.SIGNATURECLASS_PROP_SIGNATURE, "Signature", |
59 |
|
64, 10, TextAreaClass.EditorType.PURE_TEXT, TextAreaClass.ContentType.PURE_TEXT); |
60 |
|
|
61 |
0 |
needsUpdate |= setClassDocumentFields(document, "Signature Class"); |
62 |
|
|
63 |
0 |
return needsUpdate; |
64 |
|
} |
65 |
|
} |