1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kew.api.document;
17
18 import org.kuali.rice.core.api.CoreConstants;
19 import org.kuali.rice.core.api.mo.AbstractDataTransferObject;
20 import org.w3c.dom.Element;
21
22 import javax.xml.bind.annotation.XmlAccessType;
23 import javax.xml.bind.annotation.XmlAccessorType;
24 import javax.xml.bind.annotation.XmlAnyElement;
25 import javax.xml.bind.annotation.XmlElement;
26 import javax.xml.bind.annotation.XmlRootElement;
27 import javax.xml.bind.annotation.XmlType;
28 import java.util.Collection;
29
30
31 @XmlRootElement(name = DocumentProcessingOptions.Constants.ROOT_ELEMENT_NAME)
32 @XmlAccessorType(XmlAccessType.NONE)
33 @XmlType(name = DocumentProcessingOptions.Constants.TYPE_NAME, propOrder = {
34 DocumentProcessingOptions.Elements.RUN_POST_PROCESSOR,
35 DocumentProcessingOptions.Elements.INDEX_SEARCH_ATTRIBUTES,
36 DocumentProcessingOptions.Elements.SEND_NOTIFICATIONS,
37 DocumentProcessingOptions.Elements.DEACTIVATE_ACKNOWLEDGEMENTS,
38 DocumentProcessingOptions.Elements.DEACTIVATE_FYIS,
39 CoreConstants.CommonElements.FUTURE_ELEMENTS
40 })
41 public final class DocumentProcessingOptions extends AbstractDataTransferObject {
42
43 @XmlElement(name = Elements.RUN_POST_PROCESSOR, required = true)
44 private final boolean runPostProcessor;
45
46 @XmlElement(name = Elements.INDEX_SEARCH_ATTRIBUTES, required = true)
47 private final boolean indexSearchAttributes;
48
49 @XmlElement(name = Elements.SEND_NOTIFICATIONS, required = true)
50 private final boolean sendNotifications;
51
52
53 @XmlElement(name = Elements.DEACTIVATE_ACKNOWLEDGEMENTS, required = false)
54 private final Boolean deactivateAcknowledgements;
55
56 @XmlElement(name = Elements.DEACTIVATE_FYIS, required = false)
57 private final Boolean deactivateFYIs;
58
59 @SuppressWarnings("unused")
60 @XmlAnyElement
61 private final Collection<Element> _futureElements = null;
62
63
64 private DocumentProcessingOptions() {
65 this(true, true, true, false, false);
66 }
67
68 private DocumentProcessingOptions(boolean runPostProcessor, boolean indexSearchAttributes, boolean sendNotifications) {
69 this(runPostProcessor, indexSearchAttributes, sendNotifications, false, false);
70 }
71
72 private DocumentProcessingOptions(boolean runPostProcessor, boolean indexSearchAttributes, boolean sendNotifications, boolean deactivateAcknowledgements, boolean deactivateFYIs) {
73 this.runPostProcessor = runPostProcessor;
74 this.indexSearchAttributes = indexSearchAttributes;
75 this.sendNotifications = sendNotifications;
76 this.deactivateAcknowledgements = deactivateAcknowledgements;
77 this.deactivateFYIs = deactivateFYIs;
78 }
79
80 public static DocumentProcessingOptions create(boolean runPostProcessor, boolean indexSearchAttributes) {
81 return create(runPostProcessor, indexSearchAttributes, true);
82 }
83
84 public static DocumentProcessingOptions create(boolean runPostProcessor, boolean indexSearchAttributes, boolean sendNotifications) {
85 return new DocumentProcessingOptions(runPostProcessor, indexSearchAttributes, sendNotifications);
86 }
87
88 public static DocumentProcessingOptions create(boolean runPostProcessor, boolean indexSearchAttributes, boolean sendNotifications, boolean deactivateAcknowledgements, boolean deactivateFYIs) {
89 return new DocumentProcessingOptions(runPostProcessor, indexSearchAttributes, sendNotifications, deactivateAcknowledgements, deactivateFYIs);
90 }
91
92 public static DocumentProcessingOptions createDefault() {
93 return new DocumentProcessingOptions();
94 }
95
96 public boolean isRunPostProcessor() {
97 return runPostProcessor;
98 }
99
100 public boolean isIndexSearchAttributes() {
101 return indexSearchAttributes;
102 }
103
104 public boolean isSendNotifications() {
105 return sendNotifications;
106 }
107
108
109 public boolean isDeactivateAcknowledgements() {
110 return deactivateAcknowledgements;
111 }
112
113 public boolean isDeactivateFYIs() {
114 return deactivateFYIs;
115 }
116
117
118
119
120 static class Constants {
121 final static String ROOT_ELEMENT_NAME = "documentProcessingOptions";
122 final static String TYPE_NAME = "DocumentProcessingOptionsType";
123 }
124
125
126
127
128 static class Elements {
129 final static String RUN_POST_PROCESSOR = "runPostProcessor";
130 final static String INDEX_SEARCH_ATTRIBUTES = "indexSearchAttributes";
131 final static String SEND_NOTIFICATIONS = "sendNotifications";
132
133 final static String DEACTIVATE_ACKNOWLEDGEMENTS = "deactivateAcknowledgements";
134 final static String DEACTIVATE_FYIS = "deactivateFYIs";
135 }
136
137 }