From 9fdb0e9533325585faa3deb975c1cfc15b5d884a Mon Sep 17 00:00:00 2001 From: j-dimension Date: Thu, 22 Aug 2024 17:41:03 +0200 Subject: [PATCH] updated UI to get new file name suggestions from server. issue #2246 --- .../client/drebis/DrebisInboxPanel.java | 42 +++++++++++-------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/j-lawyer-client/src/com/jdimension/jlawyer/client/drebis/DrebisInboxPanel.java b/j-lawyer-client/src/com/jdimension/jlawyer/client/drebis/DrebisInboxPanel.java index ccecd5758..50e742393 100755 --- a/j-lawyer-client/src/com/jdimension/jlawyer/client/drebis/DrebisInboxPanel.java +++ b/j-lawyer-client/src/com/jdimension/jlawyer/client/drebis/DrebisInboxPanel.java @@ -1181,27 +1181,35 @@ private void cmdSaveConfirmActionPerformed(java.awt.event.ActionEvent evt) {//GE try { String archiveFileNumber = this.txtFileNumber.getText(); - - // just in case the Drebis request was started in the portal without the leading zeroes - // removed due to custom file numbers - // archiveFileNumber=ArchiveFileUtils.addLeadingZeroes(archiveFileNumber); - CaseFolder rootFolder = null; - CaseFolder targetFolder = null; + ArchiveFileBean targetCase=null; + ClientSettings settings = ClientSettings.getInstance(); + JLawyerServiceLocator locator = null; + try { + locator = JLawyerServiceLocator.getInstance(settings.getLookupProperties()); + targetCase=locator.lookupArchiveFileServiceRemote().getArchiveFileByFileNumber(archiveFileNumber); + } catch (Exception ex) { + log.error("Error getting case by reference number", ex); + } + + if(targetCase == null) { + CaseFolder rootFolder = null; + CaseFolder targetFolder = null; - // get folders - SearchAndAssignDialog saDlg = new SearchAndAssignDialog(EditorsRegistry.getInstance().getMainWindow(), true, "" + archiveFileNumber, null); - saDlg.setVisible(true); - ArchiveFileBean targetCase = saDlg.getCaseSelection(); - targetFolder = saDlg.getFolderSelection(); - rootFolder = saDlg.getRootFolder(); - - saDlg.dispose(); + // get folders + SearchAndAssignDialog saDlg = new SearchAndAssignDialog(EditorsRegistry.getInstance().getMainWindow(), true, "" + archiveFileNumber, null); + saDlg.setVisible(true); + targetCase = saDlg.getCaseSelection(); + targetFolder = saDlg.getFolderSelection(); + rootFolder = saDlg.getRootFolder(); + bulkSaveDlg.setCaseFolder(rootFolder, targetFolder); + saDlg.dispose(); + } if (targetCase == null) return; - bulkSaveDlg.setCaseFolder(rootFolder, targetFolder); + bulkSaveDlg.setSelectedCase(targetCase); for (int i = 0; i < this.tblAttachments.getRowCount(); i++) { @@ -1215,9 +1223,7 @@ private void cmdSaveConfirmActionPerformed(java.awt.event.ActionEvent evt) {//GE String newName = da.getName() + "." + da.getSuffix(); newName = FileUtils.sanitizeFileName(newName); - bulkEntry.setDocumentFilename(da.getName() + "." + da.getSuffix()); - bulkEntry.setDocumentFilenameNew(FileUtils.getNewFileNamePrefix(new Date()) + newName); - + bulkEntry.setDocumentFilename(newName); bulkSaveDlg.addEntry(bulkEntry); }