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.CertificateClass") |
40 |
|
@Singleton |
|
|
| 0% |
Uncovered Elements: 11 (11) |
Complexity: 2 |
Complexity Density: 0.22 |
|
41 |
|
public class CertificateClassDocumentInitializer extends AbstractMandatoryDocumentInitializer |
42 |
|
{ |
43 |
|
|
44 |
|
|
45 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
46 |
0 |
public CertificateClassDocumentInitializer()... |
47 |
|
{ |
48 |
0 |
super(X509CertificateWikiStore.CERTIFICATECLASS); |
49 |
|
} |
50 |
|
|
|
|
| 0% |
Uncovered Elements: 8 (8) |
Complexity: 1 |
Complexity Density: 0.12 |
|
51 |
0 |
@Override... |
52 |
|
public boolean updateDocument(XWikiDocument document) |
53 |
|
{ |
54 |
0 |
BaseClass bclass = document.getXClass(); |
55 |
|
|
56 |
0 |
boolean needsUpdate = bclass.addTextField(X509CertificateWikiStore.CERTIFICATECLASS_PROP_SUBJECT, "Subject", |
57 |
|
64); |
58 |
0 |
needsUpdate |= bclass.addTextField(X509CertificateWikiStore.CERTIFICATECLASS_PROP_KEYID, "Key Identifier", 64); |
59 |
0 |
needsUpdate |= bclass.addTextField(X509CertificateWikiStore.CERTIFICATECLASS_PROP_ISSUER, "Issuer", 64); |
60 |
0 |
needsUpdate |= bclass.addTextField(X509CertificateWikiStore.CERTIFICATECLASS_PROP_SERIAL, "Serial", 64); |
61 |
|
|
62 |
0 |
needsUpdate |= bclass.addTextAreaField(X509CertificateWikiStore.CERTIFICATECLASS_PROP_CERTIFICATE, |
63 |
|
"Certificate", 64, 10, TextAreaClass.EditorType.PURE_TEXT, TextAreaClass.ContentType.PURE_TEXT); |
64 |
|
|
65 |
0 |
needsUpdate |= setClassDocumentFields(document, "Certificate Class"); |
66 |
|
|
67 |
0 |
return needsUpdate; |
68 |
|
} |
69 |
|
} |