From 856bf551d8abf9dc1da5c237672bdeeee93e826a Mon Sep 17 00:00:00 2001 From: car031 Date: Wed, 23 Oct 2024 19:45:15 +0200 Subject: [PATCH] automation at the end of the crawling --- .../common/client/beans/GUIEmailAccount.java | 10 +++++++++ .../common/client/beans/GUIImportFolder.java | 10 +++++++++ .../email/EmailAccountAutomationPanel.java | 22 +++++++++++++------ .../folders/ImportFolderAutomationPanel.java | 10 ++++++++- .../main/resources/i18n/messages.properties | 1 + .../web/data/AttributeSetsDataServlet.java | 1 - 6 files changed, 45 insertions(+), 9 deletions(-) diff --git a/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/beans/GUIEmailAccount.java b/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/beans/GUIEmailAccount.java index 4f9bc8dcc..873dc63cd 100644 --- a/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/beans/GUIEmailAccount.java +++ b/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/beans/GUIEmailAccount.java @@ -89,6 +89,8 @@ public class GUIEmailAccount implements Serializable { private String automationAfter; + private String automationEnd; + public GUIEmailAccount() { super(); target = null; @@ -293,4 +295,12 @@ public String getClientTenant() { public void setClientTenant(String clientTenant) { this.clientTenant = clientTenant; } + + public String getAutomationEnd() { + return automationEnd; + } + + public void setAutomationEnd(String automationEnd) { + this.automationEnd = automationEnd; + } } \ No newline at end of file diff --git a/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/beans/GUIImportFolder.java b/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/beans/GUIImportFolder.java index 39b4c2572..5e380b5d3 100644 --- a/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/beans/GUIImportFolder.java +++ b/logicaldoc-gui/src/main/java/com/logicaldoc/gui/common/client/beans/GUIImportFolder.java @@ -86,6 +86,8 @@ public class GUIImportFolder implements Serializable { private String automation; private String automationAfter; + + private String automationEnd; public GUIImportFolder() { super(); @@ -360,4 +362,12 @@ public String getAutomationAfter() { public void setAutomationAfter(String automationAfter) { this.automationAfter = automationAfter; } + + public String getAutomationEnd() { + return automationEnd; + } + + public void setAutomationEnd(String automationEnd) { + this.automationEnd = automationEnd; + } } \ No newline at end of file diff --git a/logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/impex/email/EmailAccountAutomationPanel.java b/logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/impex/email/EmailAccountAutomationPanel.java index feb735274..80fc3e6e1 100644 --- a/logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/impex/email/EmailAccountAutomationPanel.java +++ b/logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/impex/email/EmailAccountAutomationPanel.java @@ -35,7 +35,7 @@ public void onDraw() { form.clearErrors(false); form.destroy(); - if (Boolean.TRUE.equals(container.contains(form))) + if (Boolean.TRUE.equals(container.contains(form))) container.removeChild(form); form = new DynamicForm(); @@ -44,21 +44,28 @@ public void onDraw() { form.setNumCols(1); form.setTitleOrientation(TitleOrientation.TOP); - TextAreaItem automationBefore = ItemFactory.newTextAreaItemForAutomation("automationBefore", "whenemailprocessing", - account.getAutomation(), changedHandler, false); + TextAreaItem automationBefore = ItemFactory.newTextAreaItemForAutomation("automationBefore", + "whenemailprocessing", account.getAutomation(), changedHandler, false); automationBefore.setRequired(false); automationBefore.setWidth("*"); automationBefore.setHeight("*"); automationBefore.addChangedHandler(changedHandler); - TextAreaItem automationAfter = ItemFactory.newTextAreaItemForAutomation("automationAfter", "afteremailprocessed", - account.getAutomationAfter(), changedHandler, false); + TextAreaItem automationAfter = ItemFactory.newTextAreaItemForAutomation("automationAfter", + "afteremailprocessed", account.getAutomationAfter(), changedHandler, false); automationAfter.setRequired(false); automationAfter.setWidth("*"); automationAfter.setHeight("*"); automationAfter.addChangedHandler(changedHandler); - - form.setItems(automationBefore, automationAfter); + + TextAreaItem automationEnd = ItemFactory.newTextAreaItemForAutomation("automationEnd", "aftercrawlingprocessed", + account.getAutomationEnd(), changedHandler, false); + automationEnd.setRequired(false); + automationEnd.setWidth("*"); + automationEnd.setHeight("*"); + automationEnd.addChangedHandler(changedHandler); + + form.setItems(automationBefore, automationAfter, automationEnd); container.addMember(form); } @@ -70,6 +77,7 @@ boolean validate() { if (Boolean.FALSE.equals(form.hasErrors())) { account.setAutomation((String) values.get("automationBefore")); account.setAutomationAfter((String) values.get("automationAfter")); + account.setAutomationEnd((String) values.get("automationEnd")); } return !form.hasErrors(); } diff --git a/logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/impex/folders/ImportFolderAutomationPanel.java b/logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/impex/folders/ImportFolderAutomationPanel.java index f13d97f4d..5e8e8b74d 100644 --- a/logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/impex/folders/ImportFolderAutomationPanel.java +++ b/logicaldoc-gui/src/main/java/com/logicaldoc/gui/frontend/client/impex/folders/ImportFolderAutomationPanel.java @@ -57,8 +57,15 @@ public void onDraw() { automationAfter.setWidth("*"); automationAfter.setHeight("*"); automationAfter.addChangedHandler(changedHandler); + + TextAreaItem automationEnd = ItemFactory.newTextAreaItemForAutomation("automationEnd", + "aftercrawlingprocessed", importFolder.getAutomationEnd(), changedHandler, false); + automationEnd.setRequired(false); + automationEnd.setWidth("*"); + automationEnd.setHeight("*"); + automationAfter.addChangedHandler(changedHandler); - form.setItems(automationBefore, automationAfter); + form.setItems(automationBefore, automationAfter, automationEnd); container.addMember(form); } @@ -70,6 +77,7 @@ boolean validate() { if (Boolean.FALSE.equals(form.hasErrors())) { importFolder.setAutomation((String) values.get("automationBefore")); importFolder.setAutomationAfter((String) values.get("automationAfter")); + importFolder.setAutomationEnd((String) values.get("automationEnd")); } return !form.hasErrors(); } diff --git a/logicaldoc-i18n/src/main/resources/i18n/messages.properties b/logicaldoc-i18n/src/main/resources/i18n/messages.properties index d4ca77af1..3821729ea 100644 --- a/logicaldoc-i18n/src/main/resources/i18n/messages.properties +++ b/logicaldoc-i18n/src/main/resources/i18n/messages.properties @@ -2443,6 +2443,7 @@ onerrormarkunindexable=On error, mark unindexable onerrormarkunindexablehint=In case of error, the document gets marked as unindexable whendocumentprocessing=When the document is being processed afterdocumentprocessed=After the document has been processed +aftercrawlingprocessed=After the crawling has been completed indexable=Indexable metadata=metadata all=all diff --git a/logicaldoc-webapp/src/main/java/com/logicaldoc/web/data/AttributeSetsDataServlet.java b/logicaldoc-webapp/src/main/java/com/logicaldoc/web/data/AttributeSetsDataServlet.java index 8b682917e..612bc6cb9 100644 --- a/logicaldoc-webapp/src/main/java/com/logicaldoc/web/data/AttributeSetsDataServlet.java +++ b/logicaldoc-webapp/src/main/java/com/logicaldoc/web/data/AttributeSetsDataServlet.java @@ -59,7 +59,6 @@ protected void service(HttpServletRequest request, HttpServletResponse response, * Iterate over the collection of templates */ for (AttributeSet set : sets) { - writer.print(""); writer.print("" + set.getId() + ""); writer.print("");