Skip to content

Commit

Permalink
updated UI to get new file name suggestions from server. issue #2246
Browse files Browse the repository at this point in the history
  • Loading branch information
j-dimension committed Aug 22, 2024
1 parent c146599 commit 9fdb0e9
Showing 1 changed file with 24 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand All @@ -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);

}
Expand Down

0 comments on commit 9fdb0e9

Please sign in to comment.