BatchInput.java
2.79 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.adobe.aemfd.docmanager.Document
* org.apache.sling.api.resource.Resource
*/
package com.adobe.aemds.guide.batch.api;
import com.adobe.aemfd.docmanager.Document;
import java.util.HashMap;
import java.util.List;
import org.apache.sling.api.resource.Resource;
public class BatchInput
extends HashMap<String, Object> {
private static final long serialVersionUID = -3422334046132064737L;
public static final String templateId = "templateId";
public static final String adaptiveDocument = "adaptiveDocument";
public static final String dataXML = "dataXML";
public static final String dataXMLs = "dataXMLs";
public BatchInput(String templateId, Document dataXML) {
this.setTemplateId(templateId);
this.setDataXML(dataXML);
}
public BatchInput(String templateId, List<Document> dataXMLs) {
this.setTemplateId(templateId);
this.setDataXMLs(dataXMLs);
}
public BatchInput(Resource adaptiveDocument, Document dataXML) {
this.setResource(adaptiveDocument);
this.setDataXML(dataXML);
}
public BatchInput(Resource adaptiveDocument, List<Document> dataXMLs) {
this.setResource(adaptiveDocument);
this.setDataXMLs(dataXMLs);
}
public String getTemplateId() {
return (String)this.get("templateId");
}
public void setTemplateId(String templateId) {
if (this.getResource() != null) {
throw new IllegalStateException("Input may be supplied either as a template or as a resource, but not both");
}
this.put("templateId", templateId);
}
public Resource getResource() {
return (Resource)this.get("adaptiveDocument");
}
public void setResource(Resource adaptiveDocument) {
if (this.getTemplateId() != null) {
throw new IllegalStateException("Input may be supplied either as a template or as a resource, but not both");
}
this.put("adaptiveDocument", adaptiveDocument);
}
public Document getDataXML() {
return (Document)this.get("dataXML");
}
public void setDataXML(Document dataXML) {
if (this.getDataXMLs() != null) {
throw new IllegalStateException("Data may be supplied either as a single monolithic XML or multiple individual XMLs, but not both");
}
this.put("dataXML", dataXML);
}
public List<Document> getDataXMLs() {
return (List)this.get("dataXMLs");
}
public void setDataXMLs(List<Document> dataXMLs) {
if (this.getDataXML() != null) {
throw new IllegalStateException("Data may be supplied either as a single monolithic XML or multiple individual XMLs, but not both");
}
this.put("dataXMLs", dataXMLs);
}
}