Skip to content

Commit 51a9c90

Browse files
committed
code fixes
1 parent 5b5c34f commit 51a9c90

27 files changed

+136
-148
lines changed

logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/grid/FolderListGridField.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public String format(Object value, ListGridRecord rec, int rowNum, int colNum) {
3838
String val = value + "";
3939
String color = rec.getAttributeAsString(colorFieldName);
4040
val = DocUtil.getFolderIcon(
41-
rec.getAttributeAsBoolean("opened") != null && rec.getAttributeAsBoolean("opened"),
41+
Boolean.TRUE.equals(rec.getAttributeAsBoolean("opened")),
4242
rec.getAttributeAsInt("type"), val, color);
4343

4444
return val;

logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/grid/RunningListGridField.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,8 @@ public RunningListGridField() {
2323

2424
private String formatStatusIconCell(ListGridRecord rec) {
2525
String color = rec.getAttributeAsString(colorFieldName);
26-
Boolean running = rec.getAttributeAsBoolean(RUNNING);
27-
if (running == null)
28-
return "";
29-
3026
String content = "<div style='display: flex; text-align: center; justify-content: center;'>";
31-
if (Boolean.TRUE.equals(running)) {
27+
if (Boolean.TRUE.equals(rec.getAttributeAsBoolean(RUNNING))) {
3228
content += AwesomeFactory.getIconButtonHTML("cog", null, RUNNING, color, "spin", null);
3329
} else {
3430
content += AwesomeFactory.getIconButtonHTML("cog", null, "idle", color, null);

logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/grid/StatusIconsListGridField.java

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,8 @@ private String formatStatusIconCell(ListGridRecord rec) {
5959
content = putImmutableStatusIcon(rec, color, content);
6060

6161
// Put the password protection icon
62-
if (rec.getAttribute("password") != null) {
63-
Boolean password = rec.getAttributeAsBoolean("password");
64-
if (password != null && password.booleanValue())
65-
content += AwesomeFactory.getIconButtonHTML("key", null, "passwordprotected", color, null);
66-
}
62+
if (Boolean.TRUE.equals(rec.getAttributeAsBoolean("password")))
63+
content += AwesomeFactory.getIconButtonHTML("key", null, "passwordprotected", color, null);
6764

6865
// Put the signed icon
6966
content = putSignedStatusIcon(rec, color, content);
@@ -97,11 +94,8 @@ private String putImmutableStatusIcon(ListGridRecord rec, String color, String c
9794
}
9895

9996
private String putBookmarkStatusIcon(ListGridRecord rec, String color, String content) {
100-
if (rec.getAttribute(BOOKMARKED) != null) {
101-
Boolean bookmarked = rec.getAttributeAsBoolean(BOOKMARKED);
102-
if (bookmarked != null && bookmarked)
103-
content += AwesomeFactory.getIconButtonHTML("bookmark", null, BOOKMARKED, color, null);
104-
}
97+
if (Boolean.TRUE.equals(rec.getAttributeAsBoolean(BOOKMARKED)))
98+
content += AwesomeFactory.getIconButtonHTML("bookmark", null, BOOKMARKED, color, null);
10599
return content;
106100
}
107101

logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/grid/formatters/UserCellFormatter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class UserCellFormatter implements CellFormatter {
1616
public String format(Object value, ListGridRecord rec, int rowNum, int colNum) {
1717
if (value == null)
1818
return null;
19-
if (rec.getAttributeAsBoolean("guest") != null && rec.getAttributeAsBoolean("guest")) {
19+
if (rec.getAttributeAsBoolean("guest") != null && Boolean.TRUE.equals(rec.getAttributeAsBoolean("guest"))) {
2020
if (Boolean.TRUE.equals(rec.getAttributeAsBoolean("eenabled")))
2121
return "<span style='color: #888888;'>" + value + CLOSE_SPAN;
2222
else

logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/util/ItemFactory.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ public static SelectItem newComparatorSelector(String inExt) {
797797
if (label == null || "".equals(label))
798798
return null;
799799

800-
if (r.getAttribute(EENABLED) != null && !r.getAttributeAsBoolean(EENABLED))
800+
if (Boolean.FALSE.equals(r.getAttributeAsBoolean(EENABLED)))
801801
label = SPAN_STYLE_COLOR_RED + label + CLOSE_SPAN;
802802
return label;
803803
});
@@ -808,7 +808,7 @@ public static SelectItem newComparatorSelector(String inExt) {
808808
if (label == null || "".equals(label))
809809
return null;
810810

811-
if (rec.getAttribute(EENABLED) != null && !rec.getAttributeAsBoolean(EENABLED))
811+
if (Boolean.FALSE.equals(rec.getAttributeAsBoolean(EENABLED)))
812812
label = SPAN_STYLE_COLOR_RED + label + CLOSE_SPAN;
813813
return label;
814814
});
@@ -836,7 +836,7 @@ public static SelectItem newFormatConverterSelector(String inExt, String outExt)
836836
if (label == null || "".equals(label))
837837
return null;
838838

839-
if (r.getAttribute(EENABLED) != null && !r.getAttributeAsBoolean(EENABLED))
839+
if (Boolean.FALSE.equals(r.getAttributeAsBoolean(EENABLED)))
840840
label = SPAN_STYLE_COLOR_RED + label + CLOSE_SPAN;
841841
return label;
842842
});
@@ -847,7 +847,7 @@ public static SelectItem newFormatConverterSelector(String inExt, String outExt)
847847
if (label == null || "".equals(label))
848848
return null;
849849

850-
if (rec.getAttribute(EENABLED) != null && !rec.getAttributeAsBoolean(EENABLED))
850+
if (Boolean.FALSE.equals(rec.getAttributeAsBoolean(EENABLED)))
851851
label = SPAN_STYLE_COLOR_RED + label + CLOSE_SPAN;
852852
return label;
853853
});

logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/calendar/CalendarEventDialog.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ private void saveAttendees() {
857857
attendee.setId(rec.getAttributeAsLong("id"));
858858
attendee.setEmail(rec.getAttributeAsString(EMAIL));
859859
attendee.setName(rec.getAttributeAsString("name"));
860-
attendee.setEnabled(rec.getAttributeAsBoolean(NOTIFY));
860+
attendee.setEnabled(Boolean.TRUE.equals(rec.getAttributeAsBoolean(NOTIFY)));
861861
userAttendees.add(attendee);
862862
}
863863
}

logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/document/DocumentSecurityPanel.java

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -414,26 +414,26 @@ public List<GUIAccessControlEntry> getACL() {
414414
ace.setName(rec.getAttributeAsString(ENTITY));
415415
ace.setEntityId(Long.parseLong(rec.getAttribute(ENTITY_ID)));
416416

417-
ace.setRead(rec.getAttributeAsBoolean("read"));
418-
ace.setPreview(rec.getAttributeAsBoolean(PREVIEW));
419-
ace.setPrint(rec.getAttributeAsBoolean(PRINT));
420-
ace.setWrite(rec.getAttributeAsBoolean(WRITE));
421-
ace.setCustomid(rec.getAttributeAsBoolean(CUSTOMID));
422-
ace.setDelete(rec.getAttributeAsBoolean(DELETE));
423-
ace.setWorkflow(rec.getAttributeAsBoolean(WORKFLOW));
424-
ace.setSign(rec.getAttributeAsBoolean("sign"));
425-
ace.setImmutable(rec.getAttributeAsBoolean(IMMUTABLE));
426-
ace.setRename(rec.getAttributeAsBoolean(RENAME));
427-
ace.setSecurity(rec.getAttributeAsBoolean(SECURITY));
428-
ace.setArchive(rec.getAttributeAsBoolean(ARCHIVE));
429-
ace.setDownload(rec.getAttributeAsBoolean(DOWNLOAD));
430-
ace.setCalendar(rec.getAttributeAsBoolean(CALENDAR));
431-
ace.setSubscription(rec.getAttributeAsBoolean(SUBSCRIPTION));
432-
ace.setPassword(rec.getAttributeAsBoolean(PASSWORD));
433-
ace.setMove(rec.getAttributeAsBoolean("move"));
434-
ace.setEmail(rec.getAttributeAsBoolean(EMAIL));
435-
ace.setAutomation(rec.getAttributeAsBoolean(AUTOMATION));
436-
ace.setReadingreq(rec.getAttributeAsBoolean(READINGREQ));
417+
ace.setRead(Boolean.TRUE.equals(rec.getAttributeAsBoolean("read")));
418+
ace.setPreview(Boolean.TRUE.equals(rec.getAttributeAsBoolean(PREVIEW)));
419+
ace.setPrint(Boolean.TRUE.equals(rec.getAttributeAsBoolean(PRINT)));
420+
ace.setWrite(Boolean.TRUE.equals(rec.getAttributeAsBoolean(WRITE)));
421+
ace.setCustomid(Boolean.TRUE.equals(rec.getAttributeAsBoolean(CUSTOMID)));
422+
ace.setDelete(Boolean.TRUE.equals(rec.getAttributeAsBoolean(DELETE)));
423+
ace.setWorkflow(Boolean.TRUE.equals(rec.getAttributeAsBoolean(WORKFLOW)));
424+
ace.setSign(Boolean.TRUE.equals(rec.getAttributeAsBoolean("sign")));
425+
ace.setImmutable(Boolean.TRUE.equals(rec.getAttributeAsBoolean(IMMUTABLE)));
426+
ace.setRename(Boolean.TRUE.equals(rec.getAttributeAsBoolean(RENAME)));
427+
ace.setSecurity(Boolean.TRUE.equals(rec.getAttributeAsBoolean(SECURITY)));
428+
ace.setArchive(Boolean.TRUE.equals(rec.getAttributeAsBoolean(ARCHIVE)));
429+
ace.setDownload(Boolean.TRUE.equals(rec.getAttributeAsBoolean(DOWNLOAD)));
430+
ace.setCalendar(Boolean.TRUE.equals(rec.getAttributeAsBoolean(CALENDAR)));
431+
ace.setSubscription(Boolean.TRUE.equals(rec.getAttributeAsBoolean(SUBSCRIPTION)));
432+
ace.setPassword(Boolean.TRUE.equals(rec.getAttributeAsBoolean(PASSWORD)));
433+
ace.setMove(Boolean.TRUE.equals(rec.getAttributeAsBoolean("move")));
434+
ace.setEmail(Boolean.TRUE.equals(rec.getAttributeAsBoolean(EMAIL)));
435+
ace.setAutomation(Boolean.TRUE.equals(rec.getAttributeAsBoolean(AUTOMATION)));
436+
ace.setReadingreq(Boolean.TRUE.equals(rec.getAttributeAsBoolean(READINGREQ)));
437437

438438
acl.add(ace);
439439
}

logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/document/grid/DocumentGridUtil.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,17 +160,15 @@ private static void setFlags(Record rec, GUIDocument document) {
160160
if (rec.getAttributeAsInt(IMMUTABLE) != null)
161161
document.setImmutable(rec.getAttributeAsInt(IMMUTABLE));
162162

163-
if (rec.getAttributeAsInt(PASSWORD) != null)
164-
document.setPasswordProtected(rec.getAttributeAsBoolean(PASSWORD));
163+
document.setPasswordProtected(Boolean.TRUE.equals(rec.getAttributeAsBoolean(PASSWORD)));
165164

166165
if (rec.getAttributeAsInt(SIGNED) != null)
167166
document.setSigned(rec.getAttributeAsInt(SIGNED));
168167

169168
if (rec.getAttributeAsInt(STAMPED) != null)
170169
document.setStamped(rec.getAttributeAsInt(STAMPED));
171170

172-
if (rec.getAttributeAsInt(BOOKMARKED) != null)
173-
document.setBookmarked(rec.getAttributeAsBoolean(BOOKMARKED));
171+
document.setBookmarked(Boolean.TRUE.equals(rec.getAttributeAsBoolean(BOOKMARKED)));
174172
}
175173

176174
private static void setDates(Record rec, GUIDocument document) {

logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/document/grid/DocumentsTileGrid.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ private void addFilename() {
9595

9696
// The status row
9797
if (Boolean.TRUE.equals(rec.getAttributeAsBoolean("bookmarked")))
98-
html += "<td>" + DocUtil.getBookmarkedIcon(rec.getAttributeAsBoolean("bookmarked")) + CLOSE_TD;
98+
html += "<td>" + DocUtil.getBookmarkedIcon(Boolean.TRUE.equals(rec.getAttributeAsBoolean("bookmarked"))) + CLOSE_TD;
9999
html += "<td>" + AwesomeFactory.getIndexedIcon(rec.getAttributeAsInt("indexed")) + CLOSE_TD;
100100

101101
// The locked icon
@@ -109,7 +109,7 @@ private void addFilename() {
109109
}
110110
}
111111

112-
html += "<td>" + DocUtil.getPasswordProtectedIcon(rec.getAttributeAsBoolean("password")) + CLOSE_TD;
112+
html += "<td>" + DocUtil.getPasswordProtectedIcon(Boolean.TRUE.equals(rec.getAttributeAsBoolean("password"))) + CLOSE_TD;
113113
html += "<td>" + DocUtil.getImmutableIcon(rec.getAttributeAsInt("immutable")) + CLOSE_TD;
114114
html += "<td>" + DocUtil.getSignedIcon(rec.getAttributeAsInt("signed")) + CLOSE_TD;
115115
html += "<td>" + DocUtil.getStampedIcon(rec.getAttributeAsInt("stamped")) + CLOSE_TD;

logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/folder/FolderSecurityPanel.java

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -525,30 +525,30 @@ public List<GUIAccessControlEntry> getACL() {
525525
GUIAccessControlEntry ace = new GUIAccessControlEntry();
526526
ace.setName(rec.getAttributeAsString(ENTITY));
527527
ace.setEntityId(Long.parseLong(rec.getAttribute(ENTITY_ID)));
528-
ace.setRead(rec.getAttributeAsBoolean("read"));
529-
ace.setPreview(rec.getAttributeAsBoolean(PREVIEW));
530-
ace.setPrint(rec.getAttributeAsBoolean(PRINT));
531-
ace.setWrite(rec.getAttributeAsBoolean(WRITE));
532-
ace.setCustomid(rec.getAttributeAsBoolean(CUSTOMID));
533-
ace.setDelete(rec.getAttributeAsBoolean(DELETE));
534-
ace.setAdd(rec.getAttributeAsBoolean("add"));
535-
ace.setWorkflow(rec.getAttributeAsBoolean(WORKFLOW));
536-
ace.setSign(rec.getAttributeAsBoolean("sign"));
537-
ace.setImport(rec.getAttributeAsBoolean(IMPORT));
538-
ace.setExport(rec.getAttributeAsBoolean(EXPORT));
539-
ace.setImmutable(rec.getAttributeAsBoolean(IMMUTABLE));
540-
ace.setRename(rec.getAttributeAsBoolean(RENAME));
541-
ace.setSecurity(rec.getAttributeAsBoolean(SECURITY));
542-
ace.setArchive(rec.getAttributeAsBoolean(ARCHIVE));
543-
ace.setDownload(rec.getAttributeAsBoolean(DOWNLOAD));
544-
ace.setCalendar(rec.getAttributeAsBoolean(CALENDAR));
545-
ace.setSubscription(rec.getAttributeAsBoolean(SUBSCRIPTION));
546-
ace.setPassword(rec.getAttributeAsBoolean(PASSWORD));
547-
ace.setMove(rec.getAttributeAsBoolean("move"));
548-
ace.setEmail(rec.getAttributeAsBoolean(EMAIL));
549-
ace.setAutomation(rec.getAttributeAsBoolean(AUTOMATION));
550-
ace.setStore(rec.getAttributeAsBoolean(STORE));
551-
ace.setReadingreq(rec.getAttributeAsBoolean(READINGREQ));
528+
ace.setRead(Boolean.TRUE.equals(rec.getAttributeAsBoolean("read")));
529+
ace.setPreview(Boolean.TRUE.equals(rec.getAttributeAsBoolean(PREVIEW)));
530+
ace.setPrint(Boolean.TRUE.equals(rec.getAttributeAsBoolean(PRINT)));
531+
ace.setWrite(Boolean.TRUE.equals(rec.getAttributeAsBoolean(WRITE)));
532+
ace.setCustomid(Boolean.TRUE.equals(rec.getAttributeAsBoolean(CUSTOMID)));
533+
ace.setDelete(Boolean.TRUE.equals(rec.getAttributeAsBoolean(DELETE)));
534+
ace.setAdd(Boolean.TRUE.equals(rec.getAttributeAsBoolean("add")));
535+
ace.setWorkflow(Boolean.TRUE.equals(rec.getAttributeAsBoolean(WORKFLOW)));
536+
ace.setSign(Boolean.TRUE.equals(rec.getAttributeAsBoolean("sign")));
537+
ace.setImport(Boolean.TRUE.equals(rec.getAttributeAsBoolean(IMPORT)));
538+
ace.setExport(Boolean.TRUE.equals(rec.getAttributeAsBoolean(EXPORT)));
539+
ace.setImmutable(Boolean.TRUE.equals(rec.getAttributeAsBoolean(IMMUTABLE)));
540+
ace.setRename(Boolean.TRUE.equals(rec.getAttributeAsBoolean(RENAME)));
541+
ace.setSecurity(Boolean.TRUE.equals(rec.getAttributeAsBoolean(SECURITY)));
542+
ace.setArchive(Boolean.TRUE.equals(rec.getAttributeAsBoolean(ARCHIVE)));
543+
ace.setDownload(Boolean.TRUE.equals(rec.getAttributeAsBoolean(DOWNLOAD)));
544+
ace.setCalendar(Boolean.TRUE.equals(rec.getAttributeAsBoolean(CALENDAR)));
545+
ace.setSubscription(Boolean.TRUE.equals(rec.getAttributeAsBoolean(SUBSCRIPTION)));
546+
ace.setPassword(Boolean.TRUE.equals(rec.getAttributeAsBoolean(PASSWORD)));
547+
ace.setMove(Boolean.TRUE.equals(rec.getAttributeAsBoolean("move")));
548+
ace.setEmail(Boolean.TRUE.equals(rec.getAttributeAsBoolean(EMAIL)));
549+
ace.setAutomation(Boolean.TRUE.equals(rec.getAttributeAsBoolean(AUTOMATION)));
550+
ace.setStore(Boolean.TRUE.equals(rec.getAttributeAsBoolean(STORE)));
551+
ace.setReadingreq(Boolean.TRUE.equals(rec.getAttributeAsBoolean(READINGREQ)));
552552

553553
acl.add(ace);
554554
}

logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/impex/converters/FormatConvertersPanel.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ protected void prepareAssociationsGrid() {
6161
converter.setCanEdit(!Session.get().isDemo());
6262
converter.setCellFormatter((value, rec, rowNum, colNum) -> {
6363
String label = getConverterShortName(value != null ? value.toString() : null);
64-
boolean enabled = rec.getAttributeAsBoolean(EENABLED);
65-
if (!enabled)
64+
if (Boolean.FALSE.equals(rec.getAttributeAsBoolean(EENABLED)))
6665
label = "<span style='color:red;'>" + label + "</span>";
6766

6867
return label;
@@ -90,7 +89,7 @@ protected void prepareAssociationsGrid() {
9089
associationsGrid.getSelectedRecord().getAttributeAsString(gridAttributeName)));
9190
if (converterRecord != null)
9291
associationsGrid.getSelectedRecord().setAttribute(EENABLED,
93-
converterRecord.getAttributeAsBoolean(EENABLED));
92+
Boolean.TRUE.equals(converterRecord.getAttributeAsBoolean(EENABLED)));
9493
});
9594
}
9695

logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/impex/email/EmailAccountsPanel.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ public void onSuccess(Boolean result) {
186186

187187
MenuItem enable = new MenuItem();
188188
enable.setTitle(I18N.message("enable"));
189-
enable.setEnabled(!rec.getAttributeAsBoolean(ENABLED));
189+
enable.setEnabled(Boolean.FALSE.equals(rec.getAttributeAsBoolean(ENABLED)));
190190
enable.addClickHandler(click -> EmailAccountService.Instance.get()
191191
.changeStatus(Long.parseLong(rec.getAttributeAsString("id")), true, new DefaultAsyncCallback<>() {
192192
@Override
@@ -198,7 +198,7 @@ public void onSuccess(Void result) {
198198

199199
MenuItem disable = new MenuItem();
200200
disable.setTitle(I18N.message("disable"));
201-
disable.setEnabled(rec.getAttributeAsBoolean(ENABLED));
201+
disable.setEnabled(Boolean.TRUE.equals(rec.getAttributeAsBoolean(ENABLED)));
202202
disable.addClickHandler(click -> EmailAccountService.Instance.get()
203203
.changeStatus(Long.parseLong(rec.getAttributeAsString("id")), false, new DefaultAsyncCallback<>() {
204204
@Override

logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/impex/folders/ImportFoldersPanel.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ public void onSuccess(Boolean result) {
195195

196196
MenuItem enable = new MenuItem();
197197
enable.setTitle(I18N.message("enable"));
198-
enable.setEnabled(!rec.getAttributeAsBoolean(ENABLED));
198+
enable.setEnabled(Boolean.FALSE.equals(rec.getAttributeAsBoolean(ENABLED)));
199199
enable.addClickHandler(event -> ImportFolderService.Instance.get()
200200
.changeStatus(Long.parseLong(rec.getAttributeAsString("id")), true, new DefaultAsyncCallback<>() {
201201
@Override
@@ -207,7 +207,7 @@ public void onSuccess(Void result) {
207207

208208
MenuItem disable = new MenuItem();
209209
disable.setTitle(I18N.message("disable"));
210-
disable.setEnabled(rec.getAttributeAsBoolean(ENABLED));
210+
disable.setEnabled(Boolean.TRUE.equals(rec.getAttributeAsBoolean(ENABLED)));
211211
disable.addClickHandler(event -> ImportFolderService.Instance.get()
212212
.changeStatus(Long.parseLong(rec.getAttributeAsString("id")), false, new DefaultAsyncCallback<>() {
213213
@Override

logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/impex/syndication/SyndicationsPanel.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public void onSuccess(Boolean result) {
185185

186186
MenuItem enable = new MenuItem();
187187
enable.setTitle(I18N.message("enable"));
188-
enable.setEnabled(!rec.getAttributeAsBoolean(ENABLED));
188+
enable.setEnabled(Boolean.FALSE.equals(rec.getAttributeAsBoolean(ENABLED)));
189189
enable.addClickHandler(click -> SyndicationService.Instance.get()
190190
.changeStatus(Long.parseLong(rec.getAttributeAsString("id")), true, new DefaultAsyncCallback<>() {
191191
@Override
@@ -197,7 +197,7 @@ public void onSuccess(Void result) {
197197

198198
MenuItem disable = new MenuItem();
199199
disable.setTitle(I18N.message("disable"));
200-
disable.setEnabled(rec.getAttributeAsBoolean(ENABLED));
200+
disable.setEnabled(Boolean.TRUE.equals(rec.getAttributeAsBoolean(ENABLED)));
201201
disable.addClickHandler(event -> SyndicationService.Instance.get()
202202
.changeStatus(Long.parseLong(rec.getAttributeAsString("id")), false, new DefaultAsyncCallback<>() {
203203
@Override

logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/metadata/CustomIdPanel.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import java.util.ArrayList;
44
import java.util.List;
55

6-
import com.logicaldoc.gui.common.client.Feature;
76
import com.logicaldoc.gui.common.client.DefaultAsyncCallback;
7+
import com.logicaldoc.gui.common.client.Feature;
88
import com.logicaldoc.gui.common.client.beans.GUIScheme;
99
import com.logicaldoc.gui.common.client.data.SequencesDS;
1010
import com.logicaldoc.gui.common.client.grid.IdListGridField;
@@ -147,8 +147,8 @@ private VLayout setupSchemesPanel(List<GUIScheme> data, String type) {
147147
GUIScheme cid = new GUIScheme();
148148
ListGridRecord rec = customIds.getRecord(event.getRowNum());
149149
cid.setTemplateId(Long.parseLong(rec.getAttribute(TEMPLATE_ID)));
150-
cid.setEvaluateAtCheckin(rec.getAttributeAsBoolean(EVALUATE_AT_CHECKIN));
151-
cid.setEvaluateAtUpdate(rec.getAttributeAsBoolean(EVALUATE_AT_UPDATE));
150+
cid.setEvaluateAtCheckin(Boolean.TRUE.equals(rec.getAttributeAsBoolean(EVALUATE_AT_CHECKIN)));
151+
cid.setEvaluateAtUpdate(Boolean.TRUE.equals(rec.getAttributeAsBoolean(EVALUATE_AT_UPDATE)));
152152
cid.setScheme(rec.getAttributeAsString(SCHEME));
153153
cid.setType(rec.getAttributeAsString("type"));
154154

@@ -283,7 +283,7 @@ public void onSuccess(Void result) {
283283
contextMenu.setItems(delete);
284284
contextMenu.showContextMenu();
285285
}
286-
286+
287287
@Override
288288
public boolean equals(Object other) {
289289
return super.equals(other);

logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/metadata/RetentionPoliciesPanel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ public void onSuccess(Void result) {
235235

236236
MenuItem disable = new MenuItem();
237237
disable.setTitle(I18N.message("disable"));
238-
disable.setEnabled(rec.getAttributeAsBoolean("eenabled"));
238+
disable.setEnabled(rec.getAttributeAsBoolean(ENABLED));
239239
disable.addClickHandler(event -> RetentionPoliciesService.Instance.get()
240240
.changeStatus(Long.parseLong(rec.getAttributeAsString("id")), false, new DefaultAsyncCallback<>() {
241241
@Override

logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/metadata/form/FormsPanel.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ public void onSuccess(Void result) {
183183
MenuItem preview = new MenuItem();
184184
preview.setTitle(I18N.message(PREVIEW));
185185
preview.addClickHandler(event -> WindowUtils.openUrlInNewTab(webformURL(formId)));
186-
preview.setEnabled(rec.getAttributeAsBoolean(WEB_ENABLED));
186+
preview.setEnabled(Boolean.TRUE.equals(rec.getAttributeAsBoolean(WEB_ENABLED)));
187187

188188
MenuItem invite = new MenuItem();
189189
invite.setTitle(I18N.message("invite"));
@@ -193,7 +193,7 @@ public void onSuccess(Void result) {
193193
new WebFormInvitationDialog(selectedForm.getId()).show();
194194
}
195195
});
196-
invite.setEnabled(rec.getAttributeAsBoolean(WEB_ENABLED));
196+
invite.setEnabled(Boolean.TRUE.equals(rec.getAttributeAsBoolean(WEB_ENABLED)));
197197

198198
MenuItem getPrefilledLink = new MenuItem();
199199
getPrefilledLink.setTitle(I18N.message("getprefilledlink"));
@@ -203,7 +203,7 @@ public void onSuccess(Void result) {
203203
new WebFormPrefilledLink(selectedForm.getId()).show();
204204
}
205205
});
206-
getPrefilledLink.setEnabled(rec.getAttributeAsBoolean(WEB_ENABLED));
206+
getPrefilledLink.setEnabled(Boolean.TRUE.equals(rec.getAttributeAsBoolean(WEB_ENABLED)));
207207

208208
if (Feature.enabled(Feature.WEB_FORM))
209209
contextMenu.setItems(edit, preview, invite, getPrefilledLink, delete);

0 commit comments

Comments
 (0)