diff --git a/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/beans/GUIExtensibleObject.java b/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/beans/GUIExtensibleObject.java index fa96e9ea5..8af981b11 100644 --- a/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/beans/GUIExtensibleObject.java +++ b/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/beans/GUIExtensibleObject.java @@ -56,7 +56,7 @@ public List getAttributes() { } public List getAttributeNames() { - return attributes.stream().map(att -> att.getName()).collect(Collectors.toList()); + return attributes.stream().map(att -> att.getName()).collect(Collectors.toUnmodifiableList()); } public void setAttributes(List attributes) { diff --git a/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/beans/GUIIncrementalArchive.java b/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/beans/GUIIncrementalArchive.java index cb973a38f..299555549 100644 --- a/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/beans/GUIIncrementalArchive.java +++ b/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/beans/GUIIncrementalArchive.java @@ -84,7 +84,7 @@ public void setId(long id) { } public List getTemplateIds() { - return templates.stream().map(t -> t.getId()).collect(Collectors.toList()); + return templates.stream().map(t -> t.getId()).collect(Collectors.toUnmodifiableList()); } public Long getAosManagerId() { diff --git a/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/controllers/ReadingRequestController.java b/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/controllers/ReadingRequestController.java index 8fc0fd496..55f3cb2f0 100644 --- a/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/controllers/ReadingRequestController.java +++ b/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/controllers/ReadingRequestController.java @@ -80,7 +80,7 @@ public List getUnconfirmedReadings(long docId) { public List getUnconfirmedReadingIds(long docId) { List readingIds = new ArrayList<>(); if (isReadingConfirmRequired(docId)) { - readingIds = unconfirmedReadings.get(docId).stream().map(r -> r.getId()).collect(Collectors.toList()); + readingIds = unconfirmedReadings.get(docId).stream().map(r -> r.getId()).collect(Collectors.toUnmodifiableList()); } return readingIds; } diff --git a/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/log/EventPanel.java b/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/log/EventPanel.java index 418f16d60..bcd683078 100644 --- a/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/log/EventPanel.java +++ b/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/log/EventPanel.java @@ -119,4 +119,29 @@ public void info(String message, String detail) { public void cleanLabel() { statusLabel.setContents(""); } + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((statusLabel == null) ? 0 : statusLabel.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (!super.equals(obj)) + return false; + if (getClass() != obj.getClass()) + return false; + EventPanel other = (EventPanel) obj; + if (statusLabel == null) { + if (other.statusLabel != null) + return false; + } else if (!statusLabel.equals(other.statusLabel)) + return false; + return true; + } } \ No newline at end of file diff --git a/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/log/MessagesWindow.java b/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/log/MessagesWindow.java index c260a1c6d..a7c9ceb8f 100644 --- a/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/log/MessagesWindow.java +++ b/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/log/MessagesWindow.java @@ -93,4 +93,29 @@ public void addEvent(GUIEvent event) { public static MessagesWindow get() { return instance; } + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((grid == null) ? 0 : grid.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (!super.equals(obj)) + return false; + if (getClass() != obj.getClass()) + return false; + MessagesWindow other = (MessagesWindow) obj; + if (grid == null) { + if (other.grid != null) + return false; + } else if (!grid.equals(other.grid)) + return false; + return true; + } } \ No newline at end of file diff --git a/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/util/ItemFactory.java b/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/util/ItemFactory.java index 65b742495..02e9574d3 100644 --- a/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/util/ItemFactory.java +++ b/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/util/ItemFactory.java @@ -2026,7 +2026,7 @@ public static TextAreaItem newTextAreaItemForAutomation(String name, String valu private static void appendAutomationEditorIcon(FormItem item, ChangedHandler handler, boolean withHtmlEditor) { FormItemIcon editAutomation = new FormItemIcon(); editAutomation.setName("editautomation"); - editAutomation.setSrc("[SKIN]/java.png"); + editAutomation.setSrc("[SKIN]/java.svg"); editAutomation.setPrompt(I18N.message("openautomationeditor")); editAutomation.addFormItemClickHandler(click -> new AutomationItemEditor(item, handler).show()); diff --git a/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/widgets/Avatar.java b/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/widgets/Avatar.java index 12f608b80..8e9e5c68f 100644 --- a/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/widgets/Avatar.java +++ b/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/widgets/Avatar.java @@ -186,4 +186,26 @@ public void onSuccess(Void result) { }); } } -} + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + (int) (userId ^ (userId >>> 32)); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (!super.equals(obj)) + return false; + if (getClass() != obj.getClass()) + return false; + Avatar other = (Avatar) obj; + if (userId != other.userId) + return false; + return true; + } +} \ No newline at end of file diff --git a/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/widgets/CronExpressionComposer.java b/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/widgets/CronExpressionComposer.java index 612ad3a7b..b4201070f 100644 --- a/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/widgets/CronExpressionComposer.java +++ b/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/widgets/CronExpressionComposer.java @@ -633,4 +633,29 @@ private void generateHourly() { vm.getItem(EXPRESSION).setValue("0 " + m + " " + h + DEFAULT_CRON_END_EXPRESSION); } } + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((sourceItem == null) ? 0 : sourceItem.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (!super.equals(obj)) + return false; + if (getClass() != obj.getClass()) + return false; + CronExpressionComposer other = (CronExpressionComposer) obj; + if (sourceItem == null) { + if (other.sourceItem != null) + return false; + } else if (!sourceItem.equals(other.sourceItem)) + return false; + return true; + } } \ No newline at end of file diff --git a/logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/impex/archives/IncrementalSettingsPanel.java b/logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/impex/archives/IncrementalSettingsPanel.java index 826f7db7a..fd3787cbf 100644 --- a/logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/impex/archives/IncrementalSettingsPanel.java +++ b/logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/impex/archives/IncrementalSettingsPanel.java @@ -69,7 +69,7 @@ public IncrementalSettingsPanel(GUIIncrementalArchive incremental, ChangedHandle templates = ItemFactory.newTemplateSelector(false, null); templates.addChangedHandler(changedHandler); templates.setValues(incremental.getTemplateIds().stream().map(id -> Long.toString(id)) - .collect(Collectors.toList()).toArray(new String[0])); + .collect(Collectors.toUnmodifiableList()).toArray(new String[0])); form.setFields(prefix, frequency, folderSelector, templates); diff --git a/logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/reports/LastChangesReport.java b/logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/reports/LastChangesReport.java index 9ee176781..9e3a9980a 100644 --- a/logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/reports/LastChangesReport.java +++ b/logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/reports/LastChangesReport.java @@ -4,7 +4,6 @@ import java.util.Arrays; import java.util.Date; import java.util.List; -import java.util.Map; import com.google.gwt.user.client.rpc.AsyncCallback; import com.logicaldoc.gui.common.client.Feature; @@ -306,43 +305,38 @@ public void onDraw() { * @return an array of select items */ public SelectItem[] getEventTypes() { - List items = new ArrayList<>(); - return items.toArray(new SelectItem[0]); + return new ArrayList<>().toArray(new SelectItem[0]); } - @SuppressWarnings("unchecked") private void onSearch() { histories.setData(); - - final Map values = vm.getValues(); - if (Boolean.FALSE.equals(vm.validate())) return; - List eventValues = getEvents(values); + List eventValues = getEvents(); - Long userId = getUserId(values); + Long userId = getUserId(); Date fromValue = null; - if (values.get(FROM_DATE) != null) - fromValue = (Date) values.get(FROM_DATE); + if (vm.getValue(FROM_DATE) != null) + fromValue = (Date) vm.getValue(FROM_DATE); Date tillValue = null; - if (values.get(TILL_DATE) != null) - tillValue = (Date) values.get(TILL_DATE); + if (vm.getValue(TILL_DATE) != null) + tillValue = (Date) vm.getValue(TILL_DATE); String sid = null; - if (values.get("sid") != null) - sid = (String) values.get("sid"); + if (vm.getValue("sid") != null) + sid = vm.getValueAsString("sid"); - int displayMaxValue = getDisplayMax(values); + int displayMaxValue = getDisplayMax(); doSearch(eventValues, userId, fromValue, tillValue, sid, displayMaxValue); } - private List getEvents(final Map values) { + private List getEvents() { String[] eventValues = new String[0]; - if (values.get(EVENT) != null) { - String buf = values.get(EVENT).toString().trim().toLowerCase(); + if (vm.getValue(EVENT) != null) { + String buf = vm.getValueAsString(EVENT).trim().toLowerCase(); buf = buf.replace('[', ' '); buf = buf.replace(']', ' '); buf = buf.replace(" ", ""); @@ -351,24 +345,24 @@ private List getEvents(final Map values) { return Arrays.asList(eventValues); } - private Long getUserId(final Map values) { + private Long getUserId() { Long userId = null; - if (values.get("user") != null) { - if (values.get("user") instanceof Long longVal) + if (vm.getValue("user") != null) { + if (vm.getValue("user") instanceof Long longVal) userId = longVal; else - userId = Long.parseLong(values.get("user").toString()); + userId = Long.parseLong(vm.getValueAsString("user")); } return userId; } - private int getDisplayMax(final Map values) { + private int getDisplayMax() { int displayMaxValue = 0; - if (values.get(DISPLAYMAX) != null) { - if (values.get(DISPLAYMAX) instanceof Integer intVal) + if (vm.getValue(DISPLAYMAX) != null) { + if (vm.getValue(DISPLAYMAX) instanceof Integer intVal) displayMaxValue = intVal; else - displayMaxValue = Integer.parseInt((String) values.get(DISPLAYMAX)); + displayMaxValue = Integer.parseInt(vm.getValueAsString(DISPLAYMAX)); } return displayMaxValue; } diff --git a/logicaldoc-gui/war/footer.jsp b/logicaldoc-gui/war/footer.jsp index 20ecd77ff..d72d813fc 100644 --- a/logicaldoc-gui/war/footer.jsp +++ b/logicaldoc-gui/war/footer.jsp @@ -1,4 +1,6 @@ <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> + + \ No newline at end of file diff --git a/logicaldoc-gui/war/frontend.jsp b/logicaldoc-gui/war/frontend.jsp index a38de391e..556b92966 100644 --- a/logicaldoc-gui/war/frontend.jsp +++ b/logicaldoc-gui/war/frontend.jsp @@ -20,7 +20,4 @@ <%@ include file="body.jsp" %> - - - <%@ include file="footer.jsp" %> diff --git a/logicaldoc-gui/war/header.jsp b/logicaldoc-gui/war/header.jsp index 01248cfa0..107da250d 100644 --- a/logicaldoc-gui/war/header.jsp +++ b/logicaldoc-gui/war/header.jsp @@ -127,7 +127,6 @@ body { -