LiveStatusImpl.java
4.59 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.day.cq.wcm.msm.api.LiveStatus
* org.apache.commons.lang.StringUtils
* org.apache.sling.commons.json.JSONException
* org.apache.sling.commons.json.io.JSONWriter
*/
package com.day.cq.wcm.msm.impl;
import com.day.cq.wcm.msm.api.LiveStatus;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang.StringUtils;
import org.apache.sling.commons.json.JSONException;
import org.apache.sling.commons.json.io.JSONWriter;
public class LiveStatusImpl
implements LiveStatus {
private boolean isCancelled;
private boolean isCancelledForChildren;
private boolean isMasterExisting;
private boolean isSlaveExisting;
private boolean isPage;
private String rolledOutBy;
private String cancelPath;
private Date rolledOutOn;
private List<String> canceledProperties = new ArrayList<String>();
private Map<String, Boolean> advancedStatus = new HashMap<String, Boolean>();
private static final String PARAM_IS_CANCELLED_ON = "msm:isCancelledOn";
public boolean isSourceExisting() {
return this.isMasterExisting;
}
public boolean isTargetExisting() {
return this.isSlaveExisting;
}
public void setMasterExisting(boolean masterExisting) {
this.isMasterExisting = masterExisting;
}
public void setSlaveExisting(boolean slaveExisting) {
this.isSlaveExisting = slaveExisting;
}
public boolean isCancelled() {
return this.isCancelled;
}
public void setCancelled(boolean cancelled) {
this.isCancelled = cancelled;
}
public boolean isCancelledForChildren() {
return this.isCancelledForChildren;
}
public void setCancelledForChildren(boolean cancelledForChildren) {
this.isCancelledForChildren = cancelledForChildren;
}
public void setCancelledPath(String path) {
this.cancelPath = path;
}
public String getCancelledPath() {
return this.cancelPath;
}
public boolean isEditable() {
if (this.isPage()) {
return !this.isCancelled();
}
return !this.isCancelled() || StringUtils.isEmpty((String)this.getCancelledPath());
}
public Map<String, Boolean> getAdvancedStatus() {
return Collections.unmodifiableMap(this.advancedStatus);
}
public Boolean getAdvancedStatus(String statusName) {
return this.advancedStatus.get(statusName);
}
public void setAdvancedStatus(String statusName, boolean value) {
this.advancedStatus.put(statusName, value);
}
public void setPage(boolean page) {
this.isPage = page;
}
public boolean isPage() {
return this.isPage;
}
public List<String> getCanceledProperties() {
return Collections.unmodifiableList(this.canceledProperties);
}
void setCancelledProperties(List<String> canceledProps) {
this.canceledProperties = canceledProps;
}
public String getLastRolledOutBy() {
return this.rolledOutBy;
}
void setRolledOutBy(String rolledOutBy) {
this.rolledOutBy = rolledOutBy;
}
public Date getLastRolledOut() {
return this.rolledOutOn;
}
public void setRolledOutOn(Date rolledOutOn) {
this.rolledOutOn = rolledOutOn;
}
public void write(JSONWriter out) throws JSONException {
out.object();
out.key("msm:isCancelled").value(this.isCancelled);
out.key("msm:isCancelledForChildren").value(this.isCancelledForChildren);
out.key("msm:isCancelledOn").value((Object)(this.getCancelledPath() == null ? "" : this.getCancelledPath()));
out.key("msm:isEditable").value(this.isEditable());
out.key("msm:isTargetExisting").value(this.isSlaveExisting);
out.key("msm:isSourceExisting").value(this.isMasterExisting);
out.key("msm:isPage").value(this.isPage);
out.key("cq:lastRolledout").value((Object)(this.rolledOutOn == null ? "" : Long.valueOf(this.rolledOutOn.getTime())));
out.key("cq:lastRolledoutBy").value((Object)(this.rolledOutBy == null ? "" : this.rolledOutBy));
Set<String> keys = this.advancedStatus.keySet();
for (String st : keys) {
out.key(st).value((Object)this.advancedStatus.get(st));
}
out.key("msm:cancelledProperties").array();
for (String cp : this.getCanceledProperties()) {
out.value((Object)cp);
}
out.endArray();
out.endObject();
}
}