diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties index 8dfa489380..3593c66efe 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Bundle.properties @@ -221,5 +221,5 @@ Detail\: \n\ Cannot open a non-Autopsy config file (at {1}). XMLCaseManagement.open.msgDlg.notAutCase.title=Error AddImageWizardIngestConfigPanel.CANCEL_BUTTON.text=Cancel -NewCaseVisualPanel1.rbLocalCase.text=Single-user -NewCaseVisualPanel1.rbSharedCase.text=Multi-user +NewCaseVisualPanel1.rbSingleUserCase.text=Single-user +NewCaseVisualPanel1.rbMultiUserCase.text=Multi-user diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java index 7bafdb8190..020cb4bd14 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java @@ -65,7 +65,7 @@ public class Case implements SleuthkitCase.ErrorObserver { private static final String autopsyVer = Version.getVersion(); // current version of autopsy. Change it when the version is changed private static String appName = null; - + /** * Name for the property that determines whether to show the dialog at * startup @@ -73,12 +73,13 @@ public class Case implements SleuthkitCase.ErrorObserver { public static final String propStartup = "LBL_StartupDialog"; //NON-NLS // pcs is initialized in CaseListener constructor private static final PropertyChangeSupport pcs = new PropertyChangeSupport(Case.class); - + /** * Events that the case module will fire. Event listeners can get the event * name by using String returned by toString() method on a specific event. */ public enum Events { + /** * Property name that indicates the name of the current case has * changed. When a case is opened, "old name" is empty string and "new @@ -132,13 +133,13 @@ public class Case implements SleuthkitCase.ErrorObserver { }; /** - * This enum describes the type of case, either Local (standalone) or Shared - * (using PostgreSql) + * This enum describes the type of case, either single-user (standalone) or + * multi-user (using PostgreSql) */ public enum CaseType { - LOCAL("Single-user case"), - SHARED("Multi-user case"); + SINGLE_USER_CASE("Single-user case"), + MULTI_USER_CASE("Multi-user case"); private final String caseName; @@ -179,16 +180,14 @@ public class Case implements SleuthkitCase.ErrorObserver { private static final Logger logger = Logger.getLogger(Case.class.getName()); static final String CASE_EXTENSION = "aut"; //NON-NLS static final String CASE_DOT_EXTENSION = "." + CASE_EXTENSION; - private CaseType caseType; - private boolean isRemote=false; - + // we cache if the case has data in it yet since a few places ask for it and we dont' need to keep going to DB private boolean hasData = false; /** * Constructor for the Case class */ - private Case(String name, String number, String examiner, String configFilePath, XMLCaseManagement xmlcm, SleuthkitCase db, boolean isRemote) { + private Case(String name, String number, String examiner, String configFilePath, XMLCaseManagement xmlcm, SleuthkitCase db) { this.name = name; this.number = number; this.examiner = examiner; @@ -196,7 +195,6 @@ public class Case implements SleuthkitCase.ErrorObserver { this.xmlcm = xmlcm; this.db = db; this.services = new Services(db); - this.isRemote = isRemote; db.addErrorObserver(this); } @@ -229,10 +227,9 @@ public class Case implements SleuthkitCase.ErrorObserver { * property-change * * @param newCase the new current case or null if case is being closed - * + * */ private static void changeCase(Case newCase) { - /// KDM ensure this handles both databases properly // close the existing case Case oldCase = Case.currentCase; Case.currentCase = null; @@ -241,25 +238,23 @@ public class Case implements SleuthkitCase.ErrorObserver { try { pcs.firePropertyChange(Events.CURRENT_CASE.toString(), oldCase, null); - } - catch (Exception e) { + } catch (Exception e) { logger.log(Level.SEVERE, "Case listener threw exception", e); //NON-NLS MessageNotifyUtil.Notify.show(NbBundle.getMessage(Case.class, "Case.moduleErr"), - NbBundle.getMessage(Case.class, - "Case.changeCase.errListenToCaseUpdates.msg"), - MessageNotifyUtil.MessageType.ERROR); + NbBundle.getMessage(Case.class, + "Case.changeCase.errListenToCaseUpdates.msg"), + MessageNotifyUtil.MessageType.ERROR); } doCaseNameChange(""); - + try { pcs.firePropertyChange(Events.NAME.toString(), oldCase.name, ""); - } - catch (Exception e) { + } catch (Exception e) { logger.log(Level.SEVERE, "Case listener threw exception", e); //NON-NLS MessageNotifyUtil.Notify.show(NbBundle.getMessage(Case.class, "Case.moduleErr"), - NbBundle.getMessage(Case.class, - "Case.changeCase.errListenToCaseUpdates.msg"), - MessageNotifyUtil.MessageType.ERROR); + NbBundle.getMessage(Case.class, + "Case.changeCase.errListenToCaseUpdates.msg"), + MessageNotifyUtil.MessageType.ERROR); } } @@ -267,29 +262,26 @@ public class Case implements SleuthkitCase.ErrorObserver { currentCase = newCase; Logger.setLogDirectory(currentCase.getLogDirectoryPath()); - + try { pcs.firePropertyChange(Events.CURRENT_CASE.toString(), null, currentCase); - } - catch (Exception e) { + } catch (Exception e) { logger.log(Level.SEVERE, "Case listener threw exception", e); //NON-NLS MessageNotifyUtil.Notify.show(NbBundle.getMessage(Case.class, "Case.moduleErr"), - NbBundle.getMessage(Case.class, - "Case.changeCase.errListenToCaseUpdates.msg"), - MessageNotifyUtil.MessageType.ERROR); + NbBundle.getMessage(Case.class, + "Case.changeCase.errListenToCaseUpdates.msg"), + MessageNotifyUtil.MessageType.ERROR); } doCaseChange(currentCase); - try { pcs.firePropertyChange(Events.NAME.toString(), "", currentCase.name); - } - catch (Exception e) { + } catch (Exception e) { logger.log(Level.SEVERE, "Case threw exception", e); //NON-NLS MessageNotifyUtil.Notify.show(NbBundle.getMessage(Case.class, "Case.moduleErr"), - NbBundle.getMessage(Case.class, - "Case.changeCase.errListenToCaseUpdates.msg"), - MessageNotifyUtil.MessageType.ERROR); + NbBundle.getMessage(Case.class, + "Case.changeCase.errListenToCaseUpdates.msg"), + MessageNotifyUtil.MessageType.ERROR); } doCaseNameChange(currentCase.name); @@ -303,22 +295,36 @@ public class Case implements SleuthkitCase.ErrorObserver { return this.db.makeAddImageProcess(timezone, processUnallocSpace, noFatOrphans); } + /** + * Creates a new case (create the XML config file and database). Overload + * for API consistency, defaults to a single-user case. + * + * @param caseDir The directory to store case data in. Will be created if it + * doesn't already exist. If it exists, it should have all of the needed sub + * dirs that createCaseDirectory() will create. + * @param caseName the name of case + * @param caseNumber the case number + * @param examiner the examiner for this case + * @throws org.sleuthkit.autopsy.casemodule.CaseActionException + */ + public static void create(String caseDir, String caseName, String caseNumber, String examiner) throws CaseActionException { + create(caseDir, caseName, caseNumber, examiner, CaseType.SINGLE_USER_CASE); + } + /** * Creates a new case (create the XML config file and database) * - * @param caseDir The directory to store case data in. Will be created if - * it doesn't already exist. If it exists, it should have - * all of the needed sub dirs that createCaseDirectory() - * will create. - * @param caseName the name of case + * @param caseDir The directory to store case data in. Will be created if it + * doesn't already exist. If it exists, it should have all of the needed sub + * dirs that createCaseDirectory() will create. + * @param caseName the name of case * @param caseNumber the case number - * @param examiner the examiner for this case - * @param caseType the type of case, local or shared + * @param examiner the examiner for this case + * @param caseType the type of case, single-user or multi-user */ public static void create(String caseDir, String caseName, String caseNumber, String examiner, CaseType caseType) throws CaseActionException { logger.log(Level.INFO, "Creating new case.\ncaseDir: {0}\ncaseName: {1}", new Object[]{caseDir, caseName}); //NON-NLS - boolean isRemote=false; // create case directory if it doesn't already exist. if (new File(caseDir).exists() == false) { Case.createCaseDirectory(caseDir); @@ -328,38 +334,33 @@ public class Case implements SleuthkitCase.ErrorObserver { XMLCaseManagement xmlcm = new XMLCaseManagement(); - String dbName=null; + String dbName = null; // figure out the database name - if (caseType == CaseType.LOCAL) { + if (caseType == CaseType.SINGLE_USER_CASE) { dbName = caseDir + File.separator + "autopsy.db"; //NON-NLS - isRemote=false; - } else if (caseType == CaseType.SHARED) { + } else if (caseType == CaseType.MULTI_USER_CASE) { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd_HHmmss"); dbName = caseName + "_" + dateFormat.format(new Date()); - isRemote=true; } - + xmlcm.create(caseDir, caseName, examiner, caseNumber, caseType, dbName); // create a new XML config file xmlcm.writeFile(); - SleuthkitCase db = null; try { - if(isRemote==true) - { - db = SleuthkitCase.newCase(dbName, UserPreferences.getDatabaseConnectionInfo()); - } - else - { + if (caseType == CaseType.SINGLE_USER_CASE) { db = SleuthkitCase.newCase(dbName); } + else if (caseType == CaseType.MULTI_USER_CASE) { + db = SleuthkitCase.newCase(dbName, UserPreferences.getDatabaseConnectionInfo()); + } } catch (TskCoreException ex) { logger.log(Level.SEVERE, "Error creating a case: " + caseName + " in dir " + caseDir, ex); //NON-NLS throw new CaseActionException( NbBundle.getMessage(Case.class, "Case.create.exception.msg", caseName, caseDir), ex); } - Case newCase = new Case(caseName, caseNumber, examiner, configFilePath, xmlcm, db, isRemote); /// KDM TODO + Case newCase = new Case(caseName, caseNumber, examiner, configFilePath, xmlcm, db); changeCase(newCase); } @@ -372,7 +373,6 @@ public class Case implements SleuthkitCase.ErrorObserver { */ public static void open(String configFilePath) throws CaseActionException { logger.log(Level.INFO, "Opening case.\nconfigFilePath: {0}", configFilePath); //NON-NLS - boolean isRemote=false; try { XMLCaseManagement xmlcm = new XMLCaseManagement(); @@ -385,10 +385,9 @@ public class Case implements SleuthkitCase.ErrorObserver { CaseType caseType = xmlcm.getCaseType(); String caseDir = xmlcm.getCaseDirectory(); SleuthkitCase db; - - if (caseType == CaseType.LOCAL) { + + if (caseType == CaseType.SINGLE_USER_CASE) { // if the caseName is "", case / config file can't be opened - isRemote=false; if (caseName.equals("")) { throw new CaseActionException(NbBundle.getMessage(Case.class, "Case.open.exception.blankCase.msg")); } @@ -402,9 +401,7 @@ public class Case implements SleuthkitCase.ErrorObserver { NbBundle.getMessage(Case.class, "Case.open.msgDlg.updated.title"), JOptionPane.INFORMATION_MESSAGE); } - } - else { - isRemote=true; + } else { db = SleuthkitCase.openCase(xmlcm.getDatabaseName(), UserPreferences.getDatabaseConnectionInfo()); if (null != db.getBackupDatabasePath()) { JOptionPane.showMessageDialog(null, @@ -414,10 +411,10 @@ public class Case implements SleuthkitCase.ErrorObserver { JOptionPane.INFORMATION_MESSAGE); } } - + checkImagesExist(db); - Case openedCase = new Case(caseName, caseNumber, examiner, configFilePath, xmlcm, db, isRemote); + Case openedCase = new Case(caseName, caseNumber, examiner, configFilePath, xmlcm, db); changeCase(openedCase); @@ -462,16 +459,16 @@ public class Case implements SleuthkitCase.ErrorObserver { || driveExists(path)); if (!fileExists) { int ret = JOptionPane.showConfirmDialog(null, - NbBundle.getMessage(Case.class, - "Case.checkImgExist.confDlg.doesntExist.msg", - appName, path), - NbBundle.getMessage(Case.class, - "Case.checkImgExist.confDlg.doesntExist.title"), - JOptionPane.YES_NO_OPTION); + NbBundle.getMessage(Case.class, + "Case.checkImgExist.confDlg.doesntExist.msg", + appName, path), + NbBundle.getMessage(Case.class, + "Case.checkImgExist.confDlg.doesntExist.title"), + JOptionPane.YES_NO_OPTION); if (ret == JOptionPane.YES_OPTION) { - + MissingImageDialog.makeDialog(obj_id, db); - + } else { logger.log(Level.WARNING, "Selected image files don't match old files!"); //NON-NLS } @@ -485,7 +482,7 @@ public class Case implements SleuthkitCase.ErrorObserver { * Sends out event and reopens windows if needed. * * @param imgPaths the paths of the image that being added - * @param imgId the ID of the image that being added + * @param imgId the ID of the image that being added * @param timeZone the timeZone of the image where it's added */ @Deprecated @@ -494,17 +491,16 @@ public class Case implements SleuthkitCase.ErrorObserver { try { Image newImage = db.getImageById(imgId); - - try { - pcs.firePropertyChange(Events.DATA_SOURCE_ADDED.toString(), null, newImage); // the new value is the instance of the image - } - catch (Exception e) { - logger.log(Level.SEVERE, "Case listener threw exception", e); //NON-NLS - MessageNotifyUtil.Notify.show(NbBundle.getMessage(this.getClass(), "Case.moduleErr"), - NbBundle.getMessage(this.getClass(), - "Case.changeCase.errListenToCaseUpdates.msg"), - MessageNotifyUtil.MessageType.ERROR); - } + + try { + pcs.firePropertyChange(Events.DATA_SOURCE_ADDED.toString(), null, newImage); // the new value is the instance of the image + } catch (Exception e) { + logger.log(Level.SEVERE, "Case listener threw exception", e); //NON-NLS + MessageNotifyUtil.Notify.show(NbBundle.getMessage(this.getClass(), "Case.moduleErr"), + NbBundle.getMessage(this.getClass(), + "Case.changeCase.errListenToCaseUpdates.msg"), + MessageNotifyUtil.MessageType.ERROR); + } CoreComponentControl.openCoreWindows(); return newImage; } catch (Exception ex) { @@ -518,33 +514,32 @@ public class Case implements SleuthkitCase.ErrorObserver { * * @param newDataSource new data source added */ - @Deprecated + @Deprecated void addLocalDataSource(Content newDataSource) { - + notifyNewDataSource(newDataSource); } /** * Notifies the UI that a new data source has been added. - * + * * * @param newDataSource new data source added */ void notifyNewDataSource(Content newDataSource) { - + try { pcs.firePropertyChange(Events.DATA_SOURCE_ADDED.toString(), null, newDataSource); - } - catch (Exception e) { + } catch (Exception e) { logger.log(Level.SEVERE, "Case threw exception", e); //NON-NLS MessageNotifyUtil.Notify.show(NbBundle.getMessage(this.getClass(), "Case.moduleErr"), - NbBundle.getMessage(this.getClass(), - "Case.changeCase.errListenToCaseUpdates.msg"), - MessageNotifyUtil.MessageType.ERROR); + NbBundle.getMessage(this.getClass(), + "Case.changeCase.errListenToCaseUpdates.msg"), + MessageNotifyUtil.MessageType.ERROR); } CoreComponentControl.openCoreWindows(); } - + /** * @return The Services object for this case. */ @@ -609,9 +604,9 @@ public class Case implements SleuthkitCase.ErrorObserver { * Updates the case name. * * @param oldCaseName the old case name that wants to be updated - * @param oldPath the old path that wants to be updated + * @param oldPath the old path that wants to be updated * @param newCaseName the new case name - * @param newPath the new path + * @param newPath the new path */ void updateCaseName(String oldCaseName, String oldPath, String newCaseName, String newPath) throws CaseActionException { try { @@ -620,13 +615,12 @@ public class Case implements SleuthkitCase.ErrorObserver { RecentCases.getInstance().updateRecentCase(oldCaseName, oldPath, newCaseName, newPath); // update the recent case try { pcs.firePropertyChange(Events.NAME.toString(), oldCaseName, newCaseName); - } - catch (Exception e) { + } catch (Exception e) { logger.log(Level.SEVERE, "Case listener threw exception", e); //NON-NLS MessageNotifyUtil.Notify.show(NbBundle.getMessage(this.getClass(), "Case.moduleErr"), - NbBundle.getMessage(this.getClass(), - "Case.changeCase.errListenToCaseUpdates.msg"), - MessageNotifyUtil.MessageType.ERROR); + NbBundle.getMessage(this.getClass(), + "Case.changeCase.errListenToCaseUpdates.msg"), + MessageNotifyUtil.MessageType.ERROR); } doCaseNameChange(newCaseName); @@ -644,16 +638,15 @@ public class Case implements SleuthkitCase.ErrorObserver { void updateExaminer(String oldExaminer, String newExaminer) throws CaseActionException { try { xmlcm.setCaseExaminer(newExaminer); // set the examiner - examiner = newExaminer; + examiner = newExaminer; try { pcs.firePropertyChange(Events.EXAMINER.toString(), oldExaminer, newExaminer); - } - catch (Exception e) { + } catch (Exception e) { logger.log(Level.SEVERE, "Case listener threw exception", e); //NON-NLS MessageNotifyUtil.Notify.show(NbBundle.getMessage(this.getClass(), "Case.moduleErr"), - NbBundle.getMessage(this.getClass(), - "Case.changeCase.errListenToCaseUpdates.msg"), - MessageNotifyUtil.MessageType.ERROR); + NbBundle.getMessage(this.getClass(), + "Case.changeCase.errListenToCaseUpdates.msg"), + MessageNotifyUtil.MessageType.ERROR); } } catch (Exception e) { throw new CaseActionException(NbBundle.getMessage(this.getClass(), "Case.updateExaminer.exception.msg"), e); @@ -670,16 +663,15 @@ public class Case implements SleuthkitCase.ErrorObserver { try { xmlcm.setCaseNumber(newCaseNumber); // set the case number number = newCaseNumber; - + try { pcs.firePropertyChange(Events.NUMBER.toString(), oldCaseNumber, newCaseNumber); - } - catch (Exception e) { + } catch (Exception e) { logger.log(Level.SEVERE, "Case listener threw exception", e); //NON-NLS MessageNotifyUtil.Notify.show(NbBundle.getMessage(this.getClass(), "Case.moduleErr"), - NbBundle.getMessage(this.getClass(), - "Case.changeCase.errListenToCaseUpdates.msg"), - MessageNotifyUtil.MessageType.ERROR); + NbBundle.getMessage(this.getClass(), + "Case.changeCase.errListenToCaseUpdates.msg"), + MessageNotifyUtil.MessageType.ERROR); } } catch (Exception e) { throw new CaseActionException(NbBundle.getMessage(this.getClass(), "Case.updateCaseNum.exception.msg"), e); @@ -812,10 +804,10 @@ public class Case implements SleuthkitCase.ErrorObserver { return xmlcm.getExportDir(); } } - + /** * Gets the full path to the log directory for this case. - * + * * @return The log directory path. */ public String getLogDirectoryPath() { @@ -825,7 +817,7 @@ public class Case implements SleuthkitCase.ErrorObserver { return xmlcm.getLogDir(); } } - + /** * get the created date of this case * @@ -868,14 +860,14 @@ public class Case implements SleuthkitCase.ErrorObserver { public static PropertyChangeSupport getPropertyChangeSupport() { return pcs; } - + /** * Get the data model Content objects in the root of this case's hierarchy. * * @return a list of the root objects * @throws org.sleuthkit.datamodel.TskCoreException */ - public List getDataSources() throws TskCoreException { + public List getDataSources() throws TskCoreException { List list = db.getRootObjects(); hasData = (list.size() > 0); return list; @@ -892,7 +884,7 @@ public class Case implements SleuthkitCase.ErrorObserver { for (Content c : getDataSources()) { final Content dataSource = c.getDataSource(); if ((dataSource != null) && (dataSource instanceof Image)) { - Image image = (Image)dataSource; + Image image = (Image) dataSource; timezones.add(TimeZone.getTimeZone(image.getTimeZone())); } } @@ -1010,7 +1002,7 @@ public class Case implements SleuthkitCase.ErrorObserver { /** * to create the case directory * - * @param caseDir Path to the case directory (typically base + case name) + * @param caseDir Path to the case directory (typically base + case name) * @param caseName the case name (used only for error messages) * * @throws CaseActionException throw if could not create the case dir @@ -1064,7 +1056,7 @@ public class Case implements SleuthkitCase.ErrorObserver { if (result == false) { throw new CaseActionException( NbBundle.getMessage(Case.class, "Case.createCaseDir.exception.cantCreateModDir", - modulesOutDir)); + modulesOutDir)); } } catch (Exception e) { @@ -1191,7 +1183,6 @@ public class Case implements SleuthkitCase.ErrorObserver { //clear pending notifications MessageNotifyUtil.Notify.clear(); - Frame f = WindowManager.getDefault().getMainWindow(); f.setTitle(Case.getAppName()); // set the window name to just application name @@ -1203,7 +1194,6 @@ public class Case implements SleuthkitCase.ErrorObserver { //log memory usage after case changed logger.log(Level.INFO, PlatformUtil.getAllMemUsageInfo()); - } //case name change helper @@ -1231,13 +1221,15 @@ public class Case implements SleuthkitCase.ErrorObserver { /** * Adds a report to the case. - * - * @param [in] localPath The path of the report file, must be in the case directory or one of its subdirectories. - * @param [in] sourceModuleName The name of the module that created the report. + * + * @param [in] localPath The path of the report file, must be in the case + * directory or one of its subdirectories. + * @param [in] sourceModuleName The name of the module that created the + * report. * @param [in] reportName The report name, may be empty. * @return A Report data transfer object (DTO) for the new row. - * @throws TskCoreException - */ + * @throws TskCoreException + */ public void addReport(String localPath, String srcModuleName, String reportName) throws TskCoreException { Report report = this.db.addReport(localPath, srcModuleName, reportName); try { @@ -1246,15 +1238,16 @@ public class Case implements SleuthkitCase.ErrorObserver { String errorMessage = String.format("A Case %s listener threw an exception", Events.REPORT_ADDED.toString()); //NON-NLS logger.log(Level.SEVERE, errorMessage, ex); } - } - + } + public List getAllReports() throws TskCoreException { return this.db.getAllReports(); - } - + } + /** - * Returns if the case has data in it yet. - * @return + * Returns if the case has data in it yet. + * + * @return */ public boolean hasData() { // false is also the initial value, so make the DB trip if it is still false @@ -1266,23 +1259,4 @@ public class Case implements SleuthkitCase.ErrorObserver { } return hasData; } - - /** - * Returns true if the case is a remote case, false otherwise - * @return - */ - public boolean isRemote() { - return isRemote; - } - - - /** - * Returns true if the current database settings are sufficient to talk to - * the PostgreSql database - * @return - */ - public static boolean externalDatabaseSettingsValid() { - CaseDbConnectionInfo info = UserPreferences.getDatabaseConnectionInfo(); - return SleuthkitCase.settingsValid(info); - } -} \ No newline at end of file +} diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseSchema.xsd b/Core/src/org/sleuthkit/autopsy/casemodule/CaseSchema.xsd index 582403fa8c..50f0130589 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseSchema.xsd +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseSchema.xsd @@ -12,9 +12,9 @@ - + - + diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseVisualPanel1.form b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseVisualPanel1.form index f06c423ad3..291f3cb533 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseVisualPanel1.form +++ b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseVisualPanel1.form @@ -43,9 +43,9 @@ - + - + @@ -74,8 +74,8 @@ - - + + @@ -146,23 +146,23 @@ - + - + - + - + diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseVisualPanel1.java b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseVisualPanel1.java index 6f86650c45..e19e6aecef 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseVisualPanel1.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/NewCaseVisualPanel1.java @@ -48,28 +48,28 @@ final class NewCaseVisualPanel1 extends JPanel implements DocumentListener { caseParentDirTextField.getDocument().addDocumentListener(this); CaseDbConnectionInfo info = UserPreferences.getDatabaseConnectionInfo(); if (info.getDbType() == CaseDbConnectionInfo.DbType.UNKNOWN) { - rbLocalCase.setSelected(true); - rbLocalCase.setEnabled(false); - rbLocalCase.setVisible(false); - rbSharedCase.setEnabled(false); - rbSharedCase.setVisible(false); + rbSingleUserCase.setSelected(true); + rbSingleUserCase.setEnabled(false); + rbSingleUserCase.setVisible(false); + rbMultiUserCase.setEnabled(false); + rbMultiUserCase.setVisible(false); } else { // if we cannot connect to the shared database, don't present the option // but do not change the setting stored in the preferences file - rbLocalCase.setEnabled(true); - rbSharedCase.setEnabled(true); - rbLocalCase.setVisible(true); - rbSharedCase.setVisible(true); - if (true == Case.externalDatabaseSettingsValid()) { - if (UserPreferences.newCaseType() == CaseType.LOCAL.ordinal()) { - rbLocalCase.setSelected(true); + rbSingleUserCase.setEnabled(true); + rbMultiUserCase.setEnabled(true); + rbSingleUserCase.setVisible(true); + rbMultiUserCase.setVisible(true); + if (true == info.settingsValid()) { + if (UserPreferences.newCaseType() == CaseType.SINGLE_USER_CASE.ordinal()) { + rbSingleUserCase.setSelected(true); } else { - rbSharedCase.setSelected(true); + rbMultiUserCase.setSelected(true); } } else { - rbLocalCase.setSelected(true); - rbLocalCase.setEnabled(false); - rbSharedCase.setEnabled(false); + rbSingleUserCase.setSelected(true); + rbSingleUserCase.setEnabled(false); + rbMultiUserCase.setEnabled(false); } } } @@ -119,11 +119,11 @@ final class NewCaseVisualPanel1 extends JPanel implements DocumentListener { * @return CaseType as set via radio buttons */ public CaseType getCaseType() { - CaseType value = CaseType.LOCAL; - if (rbLocalCase.isSelected()) { - value = CaseType.LOCAL; - } else if (rbSharedCase.isSelected()) { - value = CaseType.SHARED; + CaseType value = CaseType.SINGLE_USER_CASE; + if (rbSingleUserCase.isSelected()) { + value = CaseType.SINGLE_USER_CASE; + } else if (rbMultiUserCase.isSelected()) { + value = CaseType.MULTI_USER_CASE; } return value; } @@ -145,8 +145,8 @@ final class NewCaseVisualPanel1 extends JPanel implements DocumentListener { caseDirBrowseButton = new javax.swing.JButton(); jLabel2 = new javax.swing.JLabel(); caseDirTextField = new javax.swing.JTextField(); - rbLocalCase = new javax.swing.JRadioButton(); - rbSharedCase = new javax.swing.JRadioButton(); + rbSingleUserCase = new javax.swing.JRadioButton(); + rbMultiUserCase = new javax.swing.JRadioButton(); jLabel1.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(NewCaseVisualPanel1.class, "NewCaseVisualPanel1.jLabel1.text_1")); // NOI18N @@ -171,11 +171,11 @@ final class NewCaseVisualPanel1 extends JPanel implements DocumentListener { caseDirTextField.setEditable(false); caseDirTextField.setText(org.openide.util.NbBundle.getMessage(NewCaseVisualPanel1.class, "NewCaseVisualPanel1.caseDirTextField.text_1")); // NOI18N - caseTypeButtonGroup.add(rbLocalCase); - org.openide.awt.Mnemonics.setLocalizedText(rbLocalCase, org.openide.util.NbBundle.getMessage(NewCaseVisualPanel1.class, "NewCaseVisualPanel1.rbLocalCase.text")); // NOI18N + caseTypeButtonGroup.add(rbSingleUserCase); + org.openide.awt.Mnemonics.setLocalizedText(rbSingleUserCase, org.openide.util.NbBundle.getMessage(NewCaseVisualPanel1.class, "NewCaseVisualPanel1.rbSingleUserCase.text")); // NOI18N - caseTypeButtonGroup.add(rbSharedCase); - org.openide.awt.Mnemonics.setLocalizedText(rbSharedCase, org.openide.util.NbBundle.getMessage(NewCaseVisualPanel1.class, "NewCaseVisualPanel1.rbSharedCase.text")); // NOI18N + caseTypeButtonGroup.add(rbMultiUserCase); + org.openide.awt.Mnemonics.setLocalizedText(rbMultiUserCase, org.openide.util.NbBundle.getMessage(NewCaseVisualPanel1.class, "NewCaseVisualPanel1.rbMultiUserCase.text")); // NOI18N javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); @@ -200,9 +200,9 @@ final class NewCaseVisualPanel1 extends JPanel implements DocumentListener { .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(caseDirBrowseButton)) .addGroup(layout.createSequentialGroup() - .addComponent(rbLocalCase) + .addComponent(rbSingleUserCase) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(rbSharedCase))) + .addComponent(rbMultiUserCase))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); layout.setVerticalGroup( @@ -225,8 +225,8 @@ final class NewCaseVisualPanel1 extends JPanel implements DocumentListener { .addComponent(caseDirTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(rbLocalCase) - .addComponent(rbSharedCase)) + .addComponent(rbSingleUserCase) + .addComponent(rbMultiUserCase)) .addContainerGap(16, Short.MAX_VALUE)) ); }// //GEN-END:initComponents @@ -266,8 +266,8 @@ final class NewCaseVisualPanel1 extends JPanel implements DocumentListener { private javax.swing.ButtonGroup caseTypeButtonGroup; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; - private javax.swing.JRadioButton rbLocalCase; - private javax.swing.JRadioButton rbSharedCase; + private javax.swing.JRadioButton rbMultiUserCase; + private javax.swing.JRadioButton rbSingleUserCase; // End of variables declaration//GEN-END:variables /** diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/XMLCaseManagement.java b/Core/src/org/sleuthkit/autopsy/casemodule/XMLCaseManagement.java index e751be33c9..f1ad541b5e 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/XMLCaseManagement.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/XMLCaseManagement.java @@ -207,17 +207,17 @@ import org.xml.sax.SAXException; * @return caseType from the document handler */ public CaseType getCaseType() { - try { - if (doc == null) { - return CaseType.LOCAL; - } else { + if (doc == null) { + return CaseType.SINGLE_USER_CASE; + } else { + if (getCaseElement().getElementsByTagName(CASE_TYPE).getLength() > 0) { Element nameElement = (Element) getCaseElement().getElementsByTagName(CASE_TYPE).item(0); return CaseType.fromString(nameElement.getTextContent()); + } else { + return CaseType.SINGLE_USER_CASE; } - } catch (Exception ex) { - return CaseType.LOCAL; } - } + } /** * Sets the database name internally (on local variable in this class) @@ -233,14 +233,18 @@ import org.xml.sax.SAXException; * * @return the database name */ - public String getDatabaseName() { - if (doc == null) { - return ""; - } else { - Element nameElement = (Element) getCaseElement().getElementsByTagName(DATABASE_NAME).item(0); - return nameElement.getTextContent(); - } - } + public String getDatabaseName() { + if (doc == null) { + return ""; + } else { + if (getCaseElement().getElementsByTagName(DATABASE_NAME).getLength() > 0) { + Element nameElement = (Element) getCaseElement().getElementsByTagName(DATABASE_NAME).item(0); + return nameElement.getTextContent(); + } else { + return ""; /// couldn't find one, so return a blank name + } + } + } /** * Sets the examiner name internally (on local variable in this class) @@ -755,7 +759,7 @@ import org.xml.sax.SAXException; caseName = ""; caseNumber = ""; examiner = ""; - caseType = CaseType.LOCAL; + caseType = CaseType.SINGLE_USER_CASE; dbName = ""; } } diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/Bundle.properties b/Core/src/org/sleuthkit/autopsy/corecomponents/Bundle.properties index 3c7199793b..97eb746ab7 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/Bundle.properties +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/Bundle.properties @@ -149,16 +149,16 @@ FXVideoPanel.progress.bufferingInterrupted=media buffering was interrupted FXVideoPanel.progress.errorWritingVideoToDisk=Error writing video to disk OptionsCategory_Name_Multi_User_Settings=Multi-user OptionsCategory_Keywords_Multi_User_Options=Multi-user Options -AutopsyMultiUserSettingsPanel.lbExternalDatabase.text=Database Settings -AutopsyMultiUserSettingsPanel.lbOops.text= -AutopsyMultiUserSettingsPanel.cbExternalDbEnabled.text=Enable Multi-user -AutopsyMultiUserSettingsPanel.tbPassword.toolTipText=Enter the password here -AutopsyMultiUserSettingsPanel.tbPassword.text= -AutopsyMultiUserSettingsPanel.tbUsername.toolTipText=User Name -AutopsyMultiUserSettingsPanel.tbUsername.text= -AutopsyMultiUserSettingsPanel.tbPortNumber.toolTipText=Port Number -AutopsyMultiUserSettingsPanel.tbPortNumber.text= -AutopsyMultiUserSettingsPanel.tbHostnameOrIp.toolTipText=Hostname or IP Address -AutopsyMultiUserSettingsPanel.tbHostnameOrIp.text= -AutopsyMultiUserSettingsPanel.lbMessagingSettings.text=Messaging Settings -AutopsyMultiUserSettingsPanel.lbSolrSettings.text=Solr Settings +MultiUserSettingsPanel.lbSolrSettings.text=Solr Settings +MultiUserSettingsPanel.lbOops.text= +MultiUserSettingsPanel.tbPassword.toolTipText=Enter the password here +MultiUserSettingsPanel.tbPassword.text= +MultiUserSettingsPanel.tbUsername.toolTipText=User Name +MultiUserSettingsPanel.tbUsername.text= +MultiUserSettingsPanel.tbPortNumber.toolTipText=Port Number +MultiUserSettingsPanel.tbPortNumber.text= +MultiUserSettingsPanel.tbHostnameOrIp.toolTipText=Hostname or IP Address +MultiUserSettingsPanel.tbHostnameOrIp.text= +MultiUserSettingsPanel.lbMessagingSettings.text=Messaging Settings +MultiUserSettingsPanel.cbEnableMultiUser.text=Enable Multi-user cases +MultiUserSettingsPanel.lbDatabaseSettings.text=Database Settings diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/AutopsyMultiUserSettingsPanel.form b/Core/src/org/sleuthkit/autopsy/corecomponents/MultiUserSettingsPanel.form similarity index 80% rename from Core/src/org/sleuthkit/autopsy/corecomponents/AutopsyMultiUserSettingsPanel.form rename to Core/src/org/sleuthkit/autopsy/corecomponents/MultiUserSettingsPanel.form index 227bb7b104..1dc807c2c3 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/AutopsyMultiUserSettingsPanel.form +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/MultiUserSettingsPanel.form @@ -16,11 +16,7 @@ - - - - - + @@ -37,15 +33,13 @@ - - - - - - - + + + + + - + @@ -53,9 +47,9 @@ - + - + @@ -66,7 +60,7 @@ - + @@ -87,7 +81,7 @@ - + @@ -102,7 +96,7 @@ - + @@ -126,10 +120,10 @@ - + - + @@ -139,10 +133,10 @@ - + - + @@ -152,10 +146,10 @@ - + - + @@ -165,10 +159,10 @@ - + - + @@ -181,18 +175,18 @@ - + - + - + @@ -235,7 +229,7 @@ - + @@ -256,7 +250,7 @@ - + @@ -277,20 +271,20 @@ - + - + - + - + diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/AutopsyMultiUserSettingsPanel.java b/Core/src/org/sleuthkit/autopsy/corecomponents/MultiUserSettingsPanel.java similarity index 74% rename from Core/src/org/sleuthkit/autopsy/corecomponents/AutopsyMultiUserSettingsPanel.java rename to Core/src/org/sleuthkit/autopsy/corecomponents/MultiUserSettingsPanel.java index d647be32b2..663785e516 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/AutopsyMultiUserSettingsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/MultiUserSettingsPanel.java @@ -12,15 +12,15 @@ import org.sleuthkit.datamodel.CaseDbConnectionInfo; import org.sleuthkit.datamodel.CaseDbConnectionInfo.DbType; import org.sleuthkit.autopsy.core.UserPreferences; -public class AutopsyMultiUserSettingsPanel extends javax.swing.JPanel { +public class MultiUserSettingsPanel extends javax.swing.JPanel { - private AutopsyMultiUserSettingsPanelController controller; + private MultiUserSettingsPanelController controller; private TextBoxChangedListener textBoxChangedListener; /** * Creates new form AutopsyMultiUserSettingsPanel */ - public AutopsyMultiUserSettingsPanel(AutopsyMultiUserSettingsPanelController theController) { + public MultiUserSettingsPanel(MultiUserSettingsPanelController theController) { initComponents(); controller = theController; @@ -40,7 +40,7 @@ public class AutopsyMultiUserSettingsPanel extends javax.swing.JPanel { tpUsername.changeAlpha(alpha); tpPassword.changeAlpha(alpha); - setNetworkDbEnabled(cbExternalDbEnabled.isSelected()); + setNetworkDbEnabled(cbEnableMultiUser.isSelected()); /// Register for notifications when the text boxes get updated textBoxChangedListener = new TextBoxChangedListener(); @@ -60,71 +60,71 @@ public class AutopsyMultiUserSettingsPanel extends javax.swing.JPanel { private void initComponents() { pnOverallPanel = new javax.swing.JPanel(); - pnExternalDatabase = new javax.swing.JPanel(); + pnDatabaseSettings = new javax.swing.JPanel(); tbHostnameOrIp = new javax.swing.JTextField(); tbPortNumber = new javax.swing.JTextField(); tbUsername = new javax.swing.JTextField(); tbPassword = new javax.swing.JPasswordField(); lbOops = new javax.swing.JLabel(); - lbExternalDatabase = new javax.swing.JLabel(); + lbDatabaseSettings = new javax.swing.JLabel(); pnSolrSettings = new javax.swing.JPanel(); lbSolrSettings = new javax.swing.JLabel(); pnMessagingSettings = new javax.swing.JPanel(); lbMessagingSettings = new javax.swing.JLabel(); - cbExternalDbEnabled = new javax.swing.JCheckBox(); + cbEnableMultiUser = new javax.swing.JCheckBox(); - pnExternalDatabase.setBorder(javax.swing.BorderFactory.createEtchedBorder()); + pnDatabaseSettings.setBorder(javax.swing.BorderFactory.createEtchedBorder()); tbHostnameOrIp.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N - tbHostnameOrIp.setText(org.openide.util.NbBundle.getMessage(AutopsyMultiUserSettingsPanel.class, "AutopsyMultiUserSettingsPanel.tbHostnameOrIp.text")); // NOI18N - tbHostnameOrIp.setToolTipText(org.openide.util.NbBundle.getMessage(AutopsyMultiUserSettingsPanel.class, "AutopsyMultiUserSettingsPanel.tbHostnameOrIp.toolTipText")); // NOI18N + tbHostnameOrIp.setText(org.openide.util.NbBundle.getMessage(MultiUserSettingsPanel.class, "MultiUserSettingsPanel.tbHostnameOrIp.text")); // NOI18N + tbHostnameOrIp.setToolTipText(org.openide.util.NbBundle.getMessage(MultiUserSettingsPanel.class, "MultiUserSettingsPanel.tbHostnameOrIp.toolTipText")); // NOI18N tbPortNumber.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N - tbPortNumber.setText(org.openide.util.NbBundle.getMessage(AutopsyMultiUserSettingsPanel.class, "AutopsyMultiUserSettingsPanel.tbPortNumber.text")); // NOI18N - tbPortNumber.setToolTipText(org.openide.util.NbBundle.getMessage(AutopsyMultiUserSettingsPanel.class, "AutopsyMultiUserSettingsPanel.tbPortNumber.toolTipText")); // NOI18N + tbPortNumber.setText(org.openide.util.NbBundle.getMessage(MultiUserSettingsPanel.class, "MultiUserSettingsPanel.tbPortNumber.text")); // NOI18N + tbPortNumber.setToolTipText(org.openide.util.NbBundle.getMessage(MultiUserSettingsPanel.class, "MultiUserSettingsPanel.tbPortNumber.toolTipText")); // NOI18N tbUsername.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N - tbUsername.setText(org.openide.util.NbBundle.getMessage(AutopsyMultiUserSettingsPanel.class, "AutopsyMultiUserSettingsPanel.tbUsername.text")); // NOI18N - tbUsername.setToolTipText(org.openide.util.NbBundle.getMessage(AutopsyMultiUserSettingsPanel.class, "AutopsyMultiUserSettingsPanel.tbUsername.toolTipText")); // NOI18N + tbUsername.setText(org.openide.util.NbBundle.getMessage(MultiUserSettingsPanel.class, "MultiUserSettingsPanel.tbUsername.text")); // NOI18N + tbUsername.setToolTipText(org.openide.util.NbBundle.getMessage(MultiUserSettingsPanel.class, "MultiUserSettingsPanel.tbUsername.toolTipText")); // NOI18N tbPassword.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N - tbPassword.setText(org.openide.util.NbBundle.getMessage(AutopsyMultiUserSettingsPanel.class, "AutopsyMultiUserSettingsPanel.tbPassword.text")); // NOI18N - tbPassword.setToolTipText(org.openide.util.NbBundle.getMessage(AutopsyMultiUserSettingsPanel.class, "AutopsyMultiUserSettingsPanel.tbPassword.toolTipText")); // NOI18N + tbPassword.setText(org.openide.util.NbBundle.getMessage(MultiUserSettingsPanel.class, "MultiUserSettingsPanel.tbPassword.text")); // NOI18N + tbPassword.setToolTipText(org.openide.util.NbBundle.getMessage(MultiUserSettingsPanel.class, "MultiUserSettingsPanel.tbPassword.toolTipText")); // NOI18N lbOops.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N lbOops.setForeground(new java.awt.Color(255, 0, 0)); - org.openide.awt.Mnemonics.setLocalizedText(lbOops, org.openide.util.NbBundle.getMessage(AutopsyMultiUserSettingsPanel.class, "AutopsyMultiUserSettingsPanel.lbOops.text")); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(lbOops, org.openide.util.NbBundle.getMessage(MultiUserSettingsPanel.class, "MultiUserSettingsPanel.lbOops.text")); // NOI18N lbOops.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM); - lbExternalDatabase.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N - org.openide.awt.Mnemonics.setLocalizedText(lbExternalDatabase, org.openide.util.NbBundle.getMessage(AutopsyMultiUserSettingsPanel.class, "AutopsyMultiUserSettingsPanel.lbExternalDatabase.text")); // NOI18N - lbExternalDatabase.setVerticalAlignment(javax.swing.SwingConstants.TOP); + lbDatabaseSettings.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(lbDatabaseSettings, org.openide.util.NbBundle.getMessage(MultiUserSettingsPanel.class, "MultiUserSettingsPanel.lbDatabaseSettings.text")); // NOI18N + lbDatabaseSettings.setVerticalAlignment(javax.swing.SwingConstants.TOP); - javax.swing.GroupLayout pnExternalDatabaseLayout = new javax.swing.GroupLayout(pnExternalDatabase); - pnExternalDatabase.setLayout(pnExternalDatabaseLayout); - pnExternalDatabaseLayout.setHorizontalGroup( - pnExternalDatabaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(pnExternalDatabaseLayout.createSequentialGroup() + javax.swing.GroupLayout pnDatabaseSettingsLayout = new javax.swing.GroupLayout(pnDatabaseSettings); + pnDatabaseSettings.setLayout(pnDatabaseSettingsLayout); + pnDatabaseSettingsLayout.setHorizontalGroup( + pnDatabaseSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(pnDatabaseSettingsLayout.createSequentialGroup() .addContainerGap() - .addGroup(pnExternalDatabaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(pnDatabaseSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(tbHostnameOrIp) .addComponent(tbPortNumber) .addComponent(tbUsername) .addComponent(tbPassword) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnExternalDatabaseLayout.createSequentialGroup() + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnDatabaseSettingsLayout.createSequentialGroup() .addGap(0, 1, Short.MAX_VALUE) - .addComponent(lbExternalDatabase) + .addComponent(lbDatabaseSettings) .addGap(18, 18, 18) .addComponent(lbOops, javax.swing.GroupLayout.PREFERRED_SIZE, 320, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap()) ); - pnExternalDatabaseLayout.setVerticalGroup( - pnExternalDatabaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnExternalDatabaseLayout.createSequentialGroup() - .addGroup(pnExternalDatabaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(pnExternalDatabaseLayout.createSequentialGroup() + pnDatabaseSettingsLayout.setVerticalGroup( + pnDatabaseSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnDatabaseSettingsLayout.createSequentialGroup() + .addGroup(pnDatabaseSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(pnDatabaseSettingsLayout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(lbExternalDatabase)) + .addComponent(lbDatabaseSettings)) .addComponent(lbOops, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(tbHostnameOrIp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) @@ -140,7 +140,7 @@ public class AutopsyMultiUserSettingsPanel extends javax.swing.JPanel { pnSolrSettings.setBorder(javax.swing.BorderFactory.createEtchedBorder()); lbSolrSettings.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N - org.openide.awt.Mnemonics.setLocalizedText(lbSolrSettings, org.openide.util.NbBundle.getMessage(AutopsyMultiUserSettingsPanel.class, "AutopsyMultiUserSettingsPanel.lbSolrSettings.text")); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(lbSolrSettings, org.openide.util.NbBundle.getMessage(MultiUserSettingsPanel.class, "MultiUserSettingsPanel.lbSolrSettings.text")); // NOI18N javax.swing.GroupLayout pnSolrSettingsLayout = new javax.swing.GroupLayout(pnSolrSettings); pnSolrSettings.setLayout(pnSolrSettingsLayout); @@ -162,7 +162,7 @@ public class AutopsyMultiUserSettingsPanel extends javax.swing.JPanel { pnMessagingSettings.setBorder(javax.swing.BorderFactory.createEtchedBorder()); lbMessagingSettings.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N - org.openide.awt.Mnemonics.setLocalizedText(lbMessagingSettings, org.openide.util.NbBundle.getMessage(AutopsyMultiUserSettingsPanel.class, "AutopsyMultiUserSettingsPanel.lbMessagingSettings.text")); // NOI18N + org.openide.awt.Mnemonics.setLocalizedText(lbMessagingSettings, org.openide.util.NbBundle.getMessage(MultiUserSettingsPanel.class, "MultiUserSettingsPanel.lbMessagingSettings.text")); // NOI18N javax.swing.GroupLayout pnMessagingSettingsLayout = new javax.swing.GroupLayout(pnMessagingSettings); pnMessagingSettings.setLayout(pnMessagingSettingsLayout); @@ -171,7 +171,7 @@ public class AutopsyMultiUserSettingsPanel extends javax.swing.JPanel { .addGroup(pnMessagingSettingsLayout.createSequentialGroup() .addContainerGap() .addComponent(lbMessagingSettings) - .addContainerGap(392, Short.MAX_VALUE)) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); pnMessagingSettingsLayout.setVerticalGroup( pnMessagingSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -181,10 +181,10 @@ public class AutopsyMultiUserSettingsPanel extends javax.swing.JPanel { .addContainerGap(74, Short.MAX_VALUE)) ); - org.openide.awt.Mnemonics.setLocalizedText(cbExternalDbEnabled, org.openide.util.NbBundle.getMessage(AutopsyMultiUserSettingsPanel.class, "AutopsyMultiUserSettingsPanel.cbExternalDbEnabled.text")); // NOI18N - cbExternalDbEnabled.addItemListener(new java.awt.event.ItemListener() { + org.openide.awt.Mnemonics.setLocalizedText(cbEnableMultiUser, org.openide.util.NbBundle.getMessage(MultiUserSettingsPanel.class, "MultiUserSettingsPanel.cbEnableMultiUser.text")); // NOI18N + cbEnableMultiUser.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { - cbExternalDbEnabledItemStateChanged(evt); + cbEnableMultiUserItemStateChanged(evt); } }); @@ -194,21 +194,20 @@ public class AutopsyMultiUserSettingsPanel extends javax.swing.JPanel { pnOverallPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(pnOverallPanelLayout.createSequentialGroup() .addContainerGap() - .addGroup(pnOverallPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(cbExternalDbEnabled) - .addGroup(pnOverallPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addComponent(pnSolrSettings, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(pnMessagingSettings, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - .addComponent(pnExternalDatabase, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addContainerGap(14, Short.MAX_VALUE)) + .addGroup(pnOverallPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(cbEnableMultiUser) + .addComponent(pnSolrSettings, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(pnDatabaseSettings, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(pnMessagingSettings, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); pnOverallPanelLayout.setVerticalGroup( pnOverallPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnOverallPanelLayout.createSequentialGroup() .addContainerGap() - .addComponent(cbExternalDbEnabled) + .addComponent(cbEnableMultiUser) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(pnExternalDatabase, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(pnDatabaseSettings, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(pnSolrSettings, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) @@ -220,10 +219,7 @@ public class AutopsyMultiUserSettingsPanel extends javax.swing.JPanel { this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGap(1, 1, 1) - .addComponent(pnOverallPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addComponent(pnOverallPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 481, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -243,10 +239,10 @@ public class AutopsyMultiUserSettingsPanel extends javax.swing.JPanel { tbPassword.setEnabled(enabled); } - private void cbExternalDbEnabledItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cbExternalDbEnabledItemStateChanged - setNetworkDbEnabled(cbExternalDbEnabled.isSelected()); + private void cbEnableMultiUserItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cbEnableMultiUserItemStateChanged + setNetworkDbEnabled(cbEnableMultiUser.isSelected()); controller.changed(); - }//GEN-LAST:event_cbExternalDbEnabledItemStateChanged + }//GEN-LAST:event_cbEnableMultiUserItemStateChanged void load() { CaseDbConnectionInfo info = UserPreferences.getDatabaseConnectionInfo(); @@ -255,9 +251,9 @@ public class AutopsyMultiUserSettingsPanel extends javax.swing.JPanel { tbUsername.setText(info.getUserName()); tbPassword.setText(info.getPassword()); if (info.getDbType() == DbType.UNKNOWN) { - cbExternalDbEnabled.setSelected(false); + cbEnableMultiUser.setSelected(false); } else { - cbExternalDbEnabled.setSelected(true); + cbEnableMultiUser.setSelected(true); } } @@ -266,7 +262,7 @@ public class AutopsyMultiUserSettingsPanel extends javax.swing.JPanel { DbType dbType = DbType.UNKNOWN; - if (cbExternalDbEnabled.isSelected()) { + if (cbEnableMultiUser.isSelected()) { dbType = DbType.POSTGRESQL; } @@ -288,7 +284,7 @@ public class AutopsyMultiUserSettingsPanel extends javax.swing.JPanel { boolean valid() { boolean result = false; String text = ""; - if (cbExternalDbEnabled.isSelected()) { + if (cbEnableMultiUser.isSelected()) { try { if (tbHostnameOrIp.getText().isEmpty() || tbPortNumber.getText().isEmpty() @@ -317,12 +313,12 @@ public class AutopsyMultiUserSettingsPanel extends javax.swing.JPanel { return result; } // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JCheckBox cbExternalDbEnabled; - private javax.swing.JLabel lbExternalDatabase; + private javax.swing.JCheckBox cbEnableMultiUser; + private javax.swing.JLabel lbDatabaseSettings; private javax.swing.JLabel lbMessagingSettings; private javax.swing.JLabel lbOops; private javax.swing.JLabel lbSolrSettings; - private javax.swing.JPanel pnExternalDatabase; + private javax.swing.JPanel pnDatabaseSettings; private javax.swing.JPanel pnMessagingSettings; private javax.swing.JPanel pnOverallPanel; private javax.swing.JPanel pnSolrSettings; diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/AutopsyMultiUserSettingsPanelController.java b/Core/src/org/sleuthkit/autopsy/corecomponents/MultiUserSettingsPanelController.java similarity index 91% rename from Core/src/org/sleuthkit/autopsy/corecomponents/AutopsyMultiUserSettingsPanelController.java rename to Core/src/org/sleuthkit/autopsy/corecomponents/MultiUserSettingsPanelController.java index 22ab52a80b..b2e3a81350 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/AutopsyMultiUserSettingsPanelController.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/MultiUserSettingsPanelController.java @@ -34,12 +34,12 @@ import org.sleuthkit.autopsy.coreutils.Logger; position = 2, keywords = "#OptionsCategory_Keywords_Multi_User_Options", keywordsCategory = "Multi-user") -public final class AutopsyMultiUserSettingsPanelController extends OptionsPanelController { +public final class MultiUserSettingsPanelController extends OptionsPanelController { - private AutopsyMultiUserSettingsPanel panel; + private MultiUserSettingsPanel panel; private final PropertyChangeSupport pcs = new PropertyChangeSupport(this); private boolean changed; - private static final Logger logger = Logger.getLogger(AutopsyMultiUserSettingsPanelController.class.getName()); + private static final Logger logger = Logger.getLogger(MultiUserSettingsPanelController.class.getName()); @Override public void update() { @@ -95,9 +95,9 @@ public final class AutopsyMultiUserSettingsPanelController extends OptionsPanelC */ } - private AutopsyMultiUserSettingsPanel getPanel() { + private MultiUserSettingsPanel getPanel() { if (panel == null) { - panel = new AutopsyMultiUserSettingsPanel(this); + panel = new MultiUserSettingsPanel(this); } return panel; }