code review updates

This commit is contained in:
Karl Mortensen 2015-04-02 16:16:04 -04:00
parent 2ea37fce91
commit a365b39268
10 changed files with 302 additions and 334 deletions

View File

@ -221,5 +221,5 @@ Detail\: \n\
Cannot open a non-Autopsy config file (at {1}). Cannot open a non-Autopsy config file (at {1}).
XMLCaseManagement.open.msgDlg.notAutCase.title=Error XMLCaseManagement.open.msgDlg.notAutCase.title=Error
AddImageWizardIngestConfigPanel.CANCEL_BUTTON.text=Cancel AddImageWizardIngestConfigPanel.CANCEL_BUTTON.text=Cancel
NewCaseVisualPanel1.rbLocalCase.text=Single-user NewCaseVisualPanel1.rbSingleUserCase.text=Single-user
NewCaseVisualPanel1.rbSharedCase.text=Multi-user NewCaseVisualPanel1.rbMultiUserCase.text=Multi-user

View File

@ -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 final String autopsyVer = Version.getVersion(); // current version of autopsy. Change it when the version is changed
private static String appName = null; private static String appName = null;
/** /**
* Name for the property that determines whether to show the dialog at * Name for the property that determines whether to show the dialog at
* startup * startup
@ -73,12 +73,13 @@ public class Case implements SleuthkitCase.ErrorObserver {
public static final String propStartup = "LBL_StartupDialog"; //NON-NLS public static final String propStartup = "LBL_StartupDialog"; //NON-NLS
// pcs is initialized in CaseListener constructor // pcs is initialized in CaseListener constructor
private static final PropertyChangeSupport pcs = new PropertyChangeSupport(Case.class); private static final PropertyChangeSupport pcs = new PropertyChangeSupport(Case.class);
/** /**
* Events that the case module will fire. Event listeners can get the event * 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. * name by using String returned by toString() method on a specific event.
*/ */
public enum Events { public enum Events {
/** /**
* Property name that indicates the name of the current case has * Property name that indicates the name of the current case has
* changed. When a case is opened, "old name" is empty string and "new * 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 * This enum describes the type of case, either single-user (standalone) or
* (using PostgreSql) * multi-user (using PostgreSql)
*/ */
public enum CaseType { public enum CaseType {
LOCAL("Single-user case"), SINGLE_USER_CASE("Single-user case"),
SHARED("Multi-user case"); MULTI_USER_CASE("Multi-user case");
private final String caseName; private final String caseName;
@ -179,16 +180,14 @@ public class Case implements SleuthkitCase.ErrorObserver {
private static final Logger logger = Logger.getLogger(Case.class.getName()); private static final Logger logger = Logger.getLogger(Case.class.getName());
static final String CASE_EXTENSION = "aut"; //NON-NLS static final String CASE_EXTENSION = "aut"; //NON-NLS
static final String CASE_DOT_EXTENSION = "." + CASE_EXTENSION; 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 // 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; private boolean hasData = false;
/** /**
* Constructor for the Case class * 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.name = name;
this.number = number; this.number = number;
this.examiner = examiner; this.examiner = examiner;
@ -196,7 +195,6 @@ public class Case implements SleuthkitCase.ErrorObserver {
this.xmlcm = xmlcm; this.xmlcm = xmlcm;
this.db = db; this.db = db;
this.services = new Services(db); this.services = new Services(db);
this.isRemote = isRemote;
db.addErrorObserver(this); db.addErrorObserver(this);
} }
@ -229,10 +227,9 @@ public class Case implements SleuthkitCase.ErrorObserver {
* property-change * property-change
* *
* @param newCase the new current case or null if case is being closed * @param newCase the new current case or null if case is being closed
* *
*/ */
private static void changeCase(Case newCase) { private static void changeCase(Case newCase) {
/// KDM ensure this handles both databases properly
// close the existing case // close the existing case
Case oldCase = Case.currentCase; Case oldCase = Case.currentCase;
Case.currentCase = null; Case.currentCase = null;
@ -241,25 +238,23 @@ public class Case implements SleuthkitCase.ErrorObserver {
try { try {
pcs.firePropertyChange(Events.CURRENT_CASE.toString(), oldCase, null); 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 logger.log(Level.SEVERE, "Case listener threw exception", e); //NON-NLS
MessageNotifyUtil.Notify.show(NbBundle.getMessage(Case.class, "Case.moduleErr"), MessageNotifyUtil.Notify.show(NbBundle.getMessage(Case.class, "Case.moduleErr"),
NbBundle.getMessage(Case.class, NbBundle.getMessage(Case.class,
"Case.changeCase.errListenToCaseUpdates.msg"), "Case.changeCase.errListenToCaseUpdates.msg"),
MessageNotifyUtil.MessageType.ERROR); MessageNotifyUtil.MessageType.ERROR);
} }
doCaseNameChange(""); doCaseNameChange("");
try { try {
pcs.firePropertyChange(Events.NAME.toString(), oldCase.name, ""); pcs.firePropertyChange(Events.NAME.toString(), oldCase.name, "");
} } catch (Exception e) {
catch (Exception e) {
logger.log(Level.SEVERE, "Case listener threw exception", e); //NON-NLS logger.log(Level.SEVERE, "Case listener threw exception", e); //NON-NLS
MessageNotifyUtil.Notify.show(NbBundle.getMessage(Case.class, "Case.moduleErr"), MessageNotifyUtil.Notify.show(NbBundle.getMessage(Case.class, "Case.moduleErr"),
NbBundle.getMessage(Case.class, NbBundle.getMessage(Case.class,
"Case.changeCase.errListenToCaseUpdates.msg"), "Case.changeCase.errListenToCaseUpdates.msg"),
MessageNotifyUtil.MessageType.ERROR); MessageNotifyUtil.MessageType.ERROR);
} }
} }
@ -267,29 +262,26 @@ public class Case implements SleuthkitCase.ErrorObserver {
currentCase = newCase; currentCase = newCase;
Logger.setLogDirectory(currentCase.getLogDirectoryPath()); Logger.setLogDirectory(currentCase.getLogDirectoryPath());
try { try {
pcs.firePropertyChange(Events.CURRENT_CASE.toString(), null, currentCase); 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 logger.log(Level.SEVERE, "Case listener threw exception", e); //NON-NLS
MessageNotifyUtil.Notify.show(NbBundle.getMessage(Case.class, "Case.moduleErr"), MessageNotifyUtil.Notify.show(NbBundle.getMessage(Case.class, "Case.moduleErr"),
NbBundle.getMessage(Case.class, NbBundle.getMessage(Case.class,
"Case.changeCase.errListenToCaseUpdates.msg"), "Case.changeCase.errListenToCaseUpdates.msg"),
MessageNotifyUtil.MessageType.ERROR); MessageNotifyUtil.MessageType.ERROR);
} }
doCaseChange(currentCase); doCaseChange(currentCase);
try { try {
pcs.firePropertyChange(Events.NAME.toString(), "", currentCase.name); pcs.firePropertyChange(Events.NAME.toString(), "", currentCase.name);
} } catch (Exception e) {
catch (Exception e) {
logger.log(Level.SEVERE, "Case threw exception", e); //NON-NLS logger.log(Level.SEVERE, "Case threw exception", e); //NON-NLS
MessageNotifyUtil.Notify.show(NbBundle.getMessage(Case.class, "Case.moduleErr"), MessageNotifyUtil.Notify.show(NbBundle.getMessage(Case.class, "Case.moduleErr"),
NbBundle.getMessage(Case.class, NbBundle.getMessage(Case.class,
"Case.changeCase.errListenToCaseUpdates.msg"), "Case.changeCase.errListenToCaseUpdates.msg"),
MessageNotifyUtil.MessageType.ERROR); MessageNotifyUtil.MessageType.ERROR);
} }
doCaseNameChange(currentCase.name); doCaseNameChange(currentCase.name);
@ -303,22 +295,36 @@ public class Case implements SleuthkitCase.ErrorObserver {
return this.db.makeAddImageProcess(timezone, processUnallocSpace, noFatOrphans); 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) * Creates a new case (create the XML config file and database)
* *
* @param caseDir The directory to store case data in. Will be created if * @param caseDir The directory to store case data in. Will be created if it
* it doesn't already exist. If it exists, it should have * doesn't already exist. If it exists, it should have all of the needed sub
* all of the needed sub dirs that createCaseDirectory() * dirs that createCaseDirectory() will create.
* will create. * @param caseName the name of case
* @param caseName the name of case
* @param caseNumber the case number * @param caseNumber the case number
* @param examiner the examiner for this case * @param examiner the examiner for this case
* @param caseType the type of case, local or shared * @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 { 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 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. // create case directory if it doesn't already exist.
if (new File(caseDir).exists() == false) { if (new File(caseDir).exists() == false) {
Case.createCaseDirectory(caseDir); Case.createCaseDirectory(caseDir);
@ -328,38 +334,33 @@ public class Case implements SleuthkitCase.ErrorObserver {
XMLCaseManagement xmlcm = new XMLCaseManagement(); XMLCaseManagement xmlcm = new XMLCaseManagement();
String dbName=null; String dbName = null;
// figure out the database name // figure out the database name
if (caseType == CaseType.LOCAL) { if (caseType == CaseType.SINGLE_USER_CASE) {
dbName = caseDir + File.separator + "autopsy.db"; //NON-NLS dbName = caseDir + File.separator + "autopsy.db"; //NON-NLS
isRemote=false; } else if (caseType == CaseType.MULTI_USER_CASE) {
} else if (caseType == CaseType.SHARED) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd_HHmmss"); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd_HHmmss");
dbName = caseName + "_" + dateFormat.format(new Date()); dbName = caseName + "_" + dateFormat.format(new Date());
isRemote=true;
} }
xmlcm.create(caseDir, caseName, examiner, caseNumber, caseType, dbName); // create a new XML config file xmlcm.create(caseDir, caseName, examiner, caseNumber, caseType, dbName); // create a new XML config file
xmlcm.writeFile(); xmlcm.writeFile();
SleuthkitCase db = null; SleuthkitCase db = null;
try { try {
if(isRemote==true) if (caseType == CaseType.SINGLE_USER_CASE) {
{
db = SleuthkitCase.newCase(dbName, UserPreferences.getDatabaseConnectionInfo());
}
else
{
db = SleuthkitCase.newCase(dbName); db = SleuthkitCase.newCase(dbName);
} }
else if (caseType == CaseType.MULTI_USER_CASE) {
db = SleuthkitCase.newCase(dbName, UserPreferences.getDatabaseConnectionInfo());
}
} catch (TskCoreException ex) { } catch (TskCoreException ex) {
logger.log(Level.SEVERE, "Error creating a case: " + caseName + " in dir " + caseDir, ex); //NON-NLS logger.log(Level.SEVERE, "Error creating a case: " + caseName + " in dir " + caseDir, ex); //NON-NLS
throw new CaseActionException( throw new CaseActionException(
NbBundle.getMessage(Case.class, "Case.create.exception.msg", caseName, caseDir), ex); 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); changeCase(newCase);
} }
@ -372,7 +373,6 @@ public class Case implements SleuthkitCase.ErrorObserver {
*/ */
public static void open(String configFilePath) throws CaseActionException { public static void open(String configFilePath) throws CaseActionException {
logger.log(Level.INFO, "Opening case.\nconfigFilePath: {0}", configFilePath); //NON-NLS logger.log(Level.INFO, "Opening case.\nconfigFilePath: {0}", configFilePath); //NON-NLS
boolean isRemote=false;
try { try {
XMLCaseManagement xmlcm = new XMLCaseManagement(); XMLCaseManagement xmlcm = new XMLCaseManagement();
@ -385,10 +385,9 @@ public class Case implements SleuthkitCase.ErrorObserver {
CaseType caseType = xmlcm.getCaseType(); CaseType caseType = xmlcm.getCaseType();
String caseDir = xmlcm.getCaseDirectory(); String caseDir = xmlcm.getCaseDirectory();
SleuthkitCase db; SleuthkitCase db;
if (caseType == CaseType.LOCAL) { if (caseType == CaseType.SINGLE_USER_CASE) {
// if the caseName is "", case / config file can't be opened // if the caseName is "", case / config file can't be opened
isRemote=false;
if (caseName.equals("")) { if (caseName.equals("")) {
throw new CaseActionException(NbBundle.getMessage(Case.class, "Case.open.exception.blankCase.msg")); 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"), NbBundle.getMessage(Case.class, "Case.open.msgDlg.updated.title"),
JOptionPane.INFORMATION_MESSAGE); JOptionPane.INFORMATION_MESSAGE);
} }
} } else {
else {
isRemote=true;
db = SleuthkitCase.openCase(xmlcm.getDatabaseName(), UserPreferences.getDatabaseConnectionInfo()); db = SleuthkitCase.openCase(xmlcm.getDatabaseName(), UserPreferences.getDatabaseConnectionInfo());
if (null != db.getBackupDatabasePath()) { if (null != db.getBackupDatabasePath()) {
JOptionPane.showMessageDialog(null, JOptionPane.showMessageDialog(null,
@ -414,10 +411,10 @@ public class Case implements SleuthkitCase.ErrorObserver {
JOptionPane.INFORMATION_MESSAGE); JOptionPane.INFORMATION_MESSAGE);
} }
} }
checkImagesExist(db); 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); changeCase(openedCase);
@ -462,16 +459,16 @@ public class Case implements SleuthkitCase.ErrorObserver {
|| driveExists(path)); || driveExists(path));
if (!fileExists) { if (!fileExists) {
int ret = JOptionPane.showConfirmDialog(null, int ret = JOptionPane.showConfirmDialog(null,
NbBundle.getMessage(Case.class, NbBundle.getMessage(Case.class,
"Case.checkImgExist.confDlg.doesntExist.msg", "Case.checkImgExist.confDlg.doesntExist.msg",
appName, path), appName, path),
NbBundle.getMessage(Case.class, NbBundle.getMessage(Case.class,
"Case.checkImgExist.confDlg.doesntExist.title"), "Case.checkImgExist.confDlg.doesntExist.title"),
JOptionPane.YES_NO_OPTION); JOptionPane.YES_NO_OPTION);
if (ret == JOptionPane.YES_OPTION) { if (ret == JOptionPane.YES_OPTION) {
MissingImageDialog.makeDialog(obj_id, db); MissingImageDialog.makeDialog(obj_id, db);
} else { } else {
logger.log(Level.WARNING, "Selected image files don't match old files!"); //NON-NLS 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. * Sends out event and reopens windows if needed.
* *
* @param imgPaths the paths of the image that being added * @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 * @param timeZone the timeZone of the image where it's added
*/ */
@Deprecated @Deprecated
@ -494,17 +491,16 @@ public class Case implements SleuthkitCase.ErrorObserver {
try { try {
Image newImage = db.getImageById(imgId); Image newImage = db.getImageById(imgId);
try { try {
pcs.firePropertyChange(Events.DATA_SOURCE_ADDED.toString(), null, newImage); // the new value is the instance of the image pcs.firePropertyChange(Events.DATA_SOURCE_ADDED.toString(), null, newImage); // the new value is the instance of the image
} } catch (Exception e) {
catch (Exception e) { logger.log(Level.SEVERE, "Case listener threw exception", e); //NON-NLS
logger.log(Level.SEVERE, "Case listener threw exception", e); //NON-NLS MessageNotifyUtil.Notify.show(NbBundle.getMessage(this.getClass(), "Case.moduleErr"),
MessageNotifyUtil.Notify.show(NbBundle.getMessage(this.getClass(), "Case.moduleErr"), NbBundle.getMessage(this.getClass(),
NbBundle.getMessage(this.getClass(), "Case.changeCase.errListenToCaseUpdates.msg"),
"Case.changeCase.errListenToCaseUpdates.msg"), MessageNotifyUtil.MessageType.ERROR);
MessageNotifyUtil.MessageType.ERROR); }
}
CoreComponentControl.openCoreWindows(); CoreComponentControl.openCoreWindows();
return newImage; return newImage;
} catch (Exception ex) { } catch (Exception ex) {
@ -518,33 +514,32 @@ public class Case implements SleuthkitCase.ErrorObserver {
* *
* @param newDataSource new data source added * @param newDataSource new data source added
*/ */
@Deprecated @Deprecated
void addLocalDataSource(Content newDataSource) { void addLocalDataSource(Content newDataSource) {
notifyNewDataSource(newDataSource); notifyNewDataSource(newDataSource);
} }
/** /**
* Notifies the UI that a new data source has been added. * Notifies the UI that a new data source has been added.
* *
* *
* @param newDataSource new data source added * @param newDataSource new data source added
*/ */
void notifyNewDataSource(Content newDataSource) { void notifyNewDataSource(Content newDataSource) {
try { try {
pcs.firePropertyChange(Events.DATA_SOURCE_ADDED.toString(), null, newDataSource); 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 logger.log(Level.SEVERE, "Case threw exception", e); //NON-NLS
MessageNotifyUtil.Notify.show(NbBundle.getMessage(this.getClass(), "Case.moduleErr"), MessageNotifyUtil.Notify.show(NbBundle.getMessage(this.getClass(), "Case.moduleErr"),
NbBundle.getMessage(this.getClass(), NbBundle.getMessage(this.getClass(),
"Case.changeCase.errListenToCaseUpdates.msg"), "Case.changeCase.errListenToCaseUpdates.msg"),
MessageNotifyUtil.MessageType.ERROR); MessageNotifyUtil.MessageType.ERROR);
} }
CoreComponentControl.openCoreWindows(); CoreComponentControl.openCoreWindows();
} }
/** /**
* @return The Services object for this case. * @return The Services object for this case.
*/ */
@ -609,9 +604,9 @@ public class Case implements SleuthkitCase.ErrorObserver {
* Updates the case name. * Updates the case name.
* *
* @param oldCaseName the old case name that wants to be updated * @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 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 { void updateCaseName(String oldCaseName, String oldPath, String newCaseName, String newPath) throws CaseActionException {
try { try {
@ -620,13 +615,12 @@ public class Case implements SleuthkitCase.ErrorObserver {
RecentCases.getInstance().updateRecentCase(oldCaseName, oldPath, newCaseName, newPath); // update the recent case RecentCases.getInstance().updateRecentCase(oldCaseName, oldPath, newCaseName, newPath); // update the recent case
try { try {
pcs.firePropertyChange(Events.NAME.toString(), oldCaseName, newCaseName); pcs.firePropertyChange(Events.NAME.toString(), oldCaseName, newCaseName);
} } catch (Exception e) {
catch (Exception e) {
logger.log(Level.SEVERE, "Case listener threw exception", e); //NON-NLS logger.log(Level.SEVERE, "Case listener threw exception", e); //NON-NLS
MessageNotifyUtil.Notify.show(NbBundle.getMessage(this.getClass(), "Case.moduleErr"), MessageNotifyUtil.Notify.show(NbBundle.getMessage(this.getClass(), "Case.moduleErr"),
NbBundle.getMessage(this.getClass(), NbBundle.getMessage(this.getClass(),
"Case.changeCase.errListenToCaseUpdates.msg"), "Case.changeCase.errListenToCaseUpdates.msg"),
MessageNotifyUtil.MessageType.ERROR); MessageNotifyUtil.MessageType.ERROR);
} }
doCaseNameChange(newCaseName); doCaseNameChange(newCaseName);
@ -644,16 +638,15 @@ public class Case implements SleuthkitCase.ErrorObserver {
void updateExaminer(String oldExaminer, String newExaminer) throws CaseActionException { void updateExaminer(String oldExaminer, String newExaminer) throws CaseActionException {
try { try {
xmlcm.setCaseExaminer(newExaminer); // set the examiner xmlcm.setCaseExaminer(newExaminer); // set the examiner
examiner = newExaminer; examiner = newExaminer;
try { try {
pcs.firePropertyChange(Events.EXAMINER.toString(), oldExaminer, newExaminer); pcs.firePropertyChange(Events.EXAMINER.toString(), oldExaminer, newExaminer);
} } catch (Exception e) {
catch (Exception e) {
logger.log(Level.SEVERE, "Case listener threw exception", e); //NON-NLS logger.log(Level.SEVERE, "Case listener threw exception", e); //NON-NLS
MessageNotifyUtil.Notify.show(NbBundle.getMessage(this.getClass(), "Case.moduleErr"), MessageNotifyUtil.Notify.show(NbBundle.getMessage(this.getClass(), "Case.moduleErr"),
NbBundle.getMessage(this.getClass(), NbBundle.getMessage(this.getClass(),
"Case.changeCase.errListenToCaseUpdates.msg"), "Case.changeCase.errListenToCaseUpdates.msg"),
MessageNotifyUtil.MessageType.ERROR); MessageNotifyUtil.MessageType.ERROR);
} }
} catch (Exception e) { } catch (Exception e) {
throw new CaseActionException(NbBundle.getMessage(this.getClass(), "Case.updateExaminer.exception.msg"), e); throw new CaseActionException(NbBundle.getMessage(this.getClass(), "Case.updateExaminer.exception.msg"), e);
@ -670,16 +663,15 @@ public class Case implements SleuthkitCase.ErrorObserver {
try { try {
xmlcm.setCaseNumber(newCaseNumber); // set the case number xmlcm.setCaseNumber(newCaseNumber); // set the case number
number = newCaseNumber; number = newCaseNumber;
try { try {
pcs.firePropertyChange(Events.NUMBER.toString(), oldCaseNumber, newCaseNumber); pcs.firePropertyChange(Events.NUMBER.toString(), oldCaseNumber, newCaseNumber);
} } catch (Exception e) {
catch (Exception e) {
logger.log(Level.SEVERE, "Case listener threw exception", e); //NON-NLS logger.log(Level.SEVERE, "Case listener threw exception", e); //NON-NLS
MessageNotifyUtil.Notify.show(NbBundle.getMessage(this.getClass(), "Case.moduleErr"), MessageNotifyUtil.Notify.show(NbBundle.getMessage(this.getClass(), "Case.moduleErr"),
NbBundle.getMessage(this.getClass(), NbBundle.getMessage(this.getClass(),
"Case.changeCase.errListenToCaseUpdates.msg"), "Case.changeCase.errListenToCaseUpdates.msg"),
MessageNotifyUtil.MessageType.ERROR); MessageNotifyUtil.MessageType.ERROR);
} }
} catch (Exception e) { } catch (Exception e) {
throw new CaseActionException(NbBundle.getMessage(this.getClass(), "Case.updateCaseNum.exception.msg"), 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(); return xmlcm.getExportDir();
} }
} }
/** /**
* Gets the full path to the log directory for this case. * Gets the full path to the log directory for this case.
* *
* @return The log directory path. * @return The log directory path.
*/ */
public String getLogDirectoryPath() { public String getLogDirectoryPath() {
@ -825,7 +817,7 @@ public class Case implements SleuthkitCase.ErrorObserver {
return xmlcm.getLogDir(); return xmlcm.getLogDir();
} }
} }
/** /**
* get the created date of this case * get the created date of this case
* *
@ -868,14 +860,14 @@ public class Case implements SleuthkitCase.ErrorObserver {
public static PropertyChangeSupport getPropertyChangeSupport() { public static PropertyChangeSupport getPropertyChangeSupport() {
return pcs; return pcs;
} }
/** /**
* Get the data model Content objects in the root of this case's hierarchy. * Get the data model Content objects in the root of this case's hierarchy.
* *
* @return a list of the root objects * @return a list of the root objects
* @throws org.sleuthkit.datamodel.TskCoreException * @throws org.sleuthkit.datamodel.TskCoreException
*/ */
public List<Content> getDataSources() throws TskCoreException { public List<Content> getDataSources() throws TskCoreException {
List<Content> list = db.getRootObjects(); List<Content> list = db.getRootObjects();
hasData = (list.size() > 0); hasData = (list.size() > 0);
return list; return list;
@ -892,7 +884,7 @@ public class Case implements SleuthkitCase.ErrorObserver {
for (Content c : getDataSources()) { for (Content c : getDataSources()) {
final Content dataSource = c.getDataSource(); final Content dataSource = c.getDataSource();
if ((dataSource != null) && (dataSource instanceof Image)) { if ((dataSource != null) && (dataSource instanceof Image)) {
Image image = (Image)dataSource; Image image = (Image) dataSource;
timezones.add(TimeZone.getTimeZone(image.getTimeZone())); timezones.add(TimeZone.getTimeZone(image.getTimeZone()));
} }
} }
@ -1010,7 +1002,7 @@ public class Case implements SleuthkitCase.ErrorObserver {
/** /**
* to create the case directory * 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) * @param caseName the case name (used only for error messages)
* *
* @throws CaseActionException throw if could not create the case dir * @throws CaseActionException throw if could not create the case dir
@ -1064,7 +1056,7 @@ public class Case implements SleuthkitCase.ErrorObserver {
if (result == false) { if (result == false) {
throw new CaseActionException( throw new CaseActionException(
NbBundle.getMessage(Case.class, "Case.createCaseDir.exception.cantCreateModDir", NbBundle.getMessage(Case.class, "Case.createCaseDir.exception.cantCreateModDir",
modulesOutDir)); modulesOutDir));
} }
} catch (Exception e) { } catch (Exception e) {
@ -1191,7 +1183,6 @@ public class Case implements SleuthkitCase.ErrorObserver {
//clear pending notifications //clear pending notifications
MessageNotifyUtil.Notify.clear(); MessageNotifyUtil.Notify.clear();
Frame f = WindowManager.getDefault().getMainWindow(); Frame f = WindowManager.getDefault().getMainWindow();
f.setTitle(Case.getAppName()); // set the window name to just application name 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 //log memory usage after case changed
logger.log(Level.INFO, PlatformUtil.getAllMemUsageInfo()); logger.log(Level.INFO, PlatformUtil.getAllMemUsageInfo());
} }
//case name change helper //case name change helper
@ -1231,13 +1221,15 @@ public class Case implements SleuthkitCase.ErrorObserver {
/** /**
* Adds a report to the case. * 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] localPath The path of the report file, must be in the case
* @param [in] sourceModuleName The name of the module that created the report. * 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. * @param [in] reportName The report name, may be empty.
* @return A Report data transfer object (DTO) for the new row. * @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 { public void addReport(String localPath, String srcModuleName, String reportName) throws TskCoreException {
Report report = this.db.addReport(localPath, srcModuleName, reportName); Report report = this.db.addReport(localPath, srcModuleName, reportName);
try { 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 String errorMessage = String.format("A Case %s listener threw an exception", Events.REPORT_ADDED.toString()); //NON-NLS
logger.log(Level.SEVERE, errorMessage, ex); logger.log(Level.SEVERE, errorMessage, ex);
} }
} }
public List<Report> getAllReports() throws TskCoreException { public List<Report> getAllReports() throws TskCoreException {
return this.db.getAllReports(); return this.db.getAllReports();
} }
/** /**
* Returns if the case has data in it yet. * Returns if the case has data in it yet.
* @return *
* @return
*/ */
public boolean hasData() { public boolean hasData() {
// false is also the initial value, so make the DB trip if it is still false // 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; 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);
}
}

View File

@ -12,9 +12,9 @@
<xs:element name="Examiner" type="String" nillable="true"/> <xs:element name="Examiner" type="String" nillable="true"/>
<xs:element name="CaseType" type="String" nillable="false"/> <xs:element name="CaseType" type="String" minOccurs="0" maxOccurs="1" nillable="false"/>
<xs:element name="DatabaseName" type="String" nillable="false"/> <xs:element name="DatabaseName" type="String" minOccurs="0" maxOccurs="1" nillable="false"/>
<xs:attribute name="Relative" type="xs:boolean"/> <xs:attribute name="Relative" type="xs:boolean"/>

View File

@ -43,9 +43,9 @@
<Component id="caseDirBrowseButton" min="-2" max="-2" attributes="0"/> <Component id="caseDirBrowseButton" min="-2" max="-2" attributes="0"/>
</Group> </Group>
<Group type="102" alignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0">
<Component id="rbLocalCase" min="-2" max="-2" attributes="0"/> <Component id="rbSingleUserCase" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/> <EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="rbSharedCase" min="-2" max="-2" attributes="0"/> <Component id="rbMultiUserCase" min="-2" max="-2" attributes="0"/>
</Group> </Group>
</Group> </Group>
<EmptySpace max="32767" attributes="0"/> <EmptySpace max="32767" attributes="0"/>
@ -74,8 +74,8 @@
<Component id="caseDirTextField" min="-2" max="-2" attributes="0"/> <Component id="caseDirTextField" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/> <EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0"> <Group type="103" groupAlignment="3" attributes="0">
<Component id="rbLocalCase" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="rbSingleUserCase" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="rbSharedCase" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="rbMultiUserCase" alignment="3" min="-2" max="-2" attributes="0"/>
</Group> </Group>
<EmptySpace pref="16" max="32767" attributes="0"/> <EmptySpace pref="16" max="32767" attributes="0"/>
</Group> </Group>
@ -146,23 +146,23 @@
</Property> </Property>
</Properties> </Properties>
</Component> </Component>
<Component class="javax.swing.JRadioButton" name="rbLocalCase"> <Component class="javax.swing.JRadioButton" name="rbSingleUserCase">
<Properties> <Properties>
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor"> <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
<ComponentRef name="caseTypeButtonGroup"/> <ComponentRef name="caseTypeButtonGroup"/>
</Property> </Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="NewCaseVisualPanel1.rbLocalCase.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/> <ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="NewCaseVisualPanel1.rbSingleUserCase.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property> </Property>
</Properties> </Properties>
</Component> </Component>
<Component class="javax.swing.JRadioButton" name="rbSharedCase"> <Component class="javax.swing.JRadioButton" name="rbMultiUserCase">
<Properties> <Properties>
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor"> <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
<ComponentRef name="caseTypeButtonGroup"/> <ComponentRef name="caseTypeButtonGroup"/>
</Property> </Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="NewCaseVisualPanel1.rbSharedCase.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/> <ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="NewCaseVisualPanel1.rbMultiUserCase.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property> </Property>
</Properties> </Properties>
</Component> </Component>

View File

@ -48,28 +48,28 @@ final class NewCaseVisualPanel1 extends JPanel implements DocumentListener {
caseParentDirTextField.getDocument().addDocumentListener(this); caseParentDirTextField.getDocument().addDocumentListener(this);
CaseDbConnectionInfo info = UserPreferences.getDatabaseConnectionInfo(); CaseDbConnectionInfo info = UserPreferences.getDatabaseConnectionInfo();
if (info.getDbType() == CaseDbConnectionInfo.DbType.UNKNOWN) { if (info.getDbType() == CaseDbConnectionInfo.DbType.UNKNOWN) {
rbLocalCase.setSelected(true); rbSingleUserCase.setSelected(true);
rbLocalCase.setEnabled(false); rbSingleUserCase.setEnabled(false);
rbLocalCase.setVisible(false); rbSingleUserCase.setVisible(false);
rbSharedCase.setEnabled(false); rbMultiUserCase.setEnabled(false);
rbSharedCase.setVisible(false); rbMultiUserCase.setVisible(false);
} else { } else {
// if we cannot connect to the shared database, don't present the option // if we cannot connect to the shared database, don't present the option
// but do not change the setting stored in the preferences file // but do not change the setting stored in the preferences file
rbLocalCase.setEnabled(true); rbSingleUserCase.setEnabled(true);
rbSharedCase.setEnabled(true); rbMultiUserCase.setEnabled(true);
rbLocalCase.setVisible(true); rbSingleUserCase.setVisible(true);
rbSharedCase.setVisible(true); rbMultiUserCase.setVisible(true);
if (true == Case.externalDatabaseSettingsValid()) { if (true == info.settingsValid()) {
if (UserPreferences.newCaseType() == CaseType.LOCAL.ordinal()) { if (UserPreferences.newCaseType() == CaseType.SINGLE_USER_CASE.ordinal()) {
rbLocalCase.setSelected(true); rbSingleUserCase.setSelected(true);
} else { } else {
rbSharedCase.setSelected(true); rbMultiUserCase.setSelected(true);
} }
} else { } else {
rbLocalCase.setSelected(true); rbSingleUserCase.setSelected(true);
rbLocalCase.setEnabled(false); rbSingleUserCase.setEnabled(false);
rbSharedCase.setEnabled(false); rbMultiUserCase.setEnabled(false);
} }
} }
} }
@ -119,11 +119,11 @@ final class NewCaseVisualPanel1 extends JPanel implements DocumentListener {
* @return CaseType as set via radio buttons * @return CaseType as set via radio buttons
*/ */
public CaseType getCaseType() { public CaseType getCaseType() {
CaseType value = CaseType.LOCAL; CaseType value = CaseType.SINGLE_USER_CASE;
if (rbLocalCase.isSelected()) { if (rbSingleUserCase.isSelected()) {
value = CaseType.LOCAL; value = CaseType.SINGLE_USER_CASE;
} else if (rbSharedCase.isSelected()) { } else if (rbMultiUserCase.isSelected()) {
value = CaseType.SHARED; value = CaseType.MULTI_USER_CASE;
} }
return value; return value;
} }
@ -145,8 +145,8 @@ final class NewCaseVisualPanel1 extends JPanel implements DocumentListener {
caseDirBrowseButton = new javax.swing.JButton(); caseDirBrowseButton = new javax.swing.JButton();
jLabel2 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel();
caseDirTextField = new javax.swing.JTextField(); caseDirTextField = new javax.swing.JTextField();
rbLocalCase = new javax.swing.JRadioButton(); rbSingleUserCase = new javax.swing.JRadioButton();
rbSharedCase = new javax.swing.JRadioButton(); rbMultiUserCase = new javax.swing.JRadioButton();
jLabel1.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N 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 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.setEditable(false);
caseDirTextField.setText(org.openide.util.NbBundle.getMessage(NewCaseVisualPanel1.class, "NewCaseVisualPanel1.caseDirTextField.text_1")); // NOI18N caseDirTextField.setText(org.openide.util.NbBundle.getMessage(NewCaseVisualPanel1.class, "NewCaseVisualPanel1.caseDirTextField.text_1")); // NOI18N
caseTypeButtonGroup.add(rbLocalCase); caseTypeButtonGroup.add(rbSingleUserCase);
org.openide.awt.Mnemonics.setLocalizedText(rbLocalCase, org.openide.util.NbBundle.getMessage(NewCaseVisualPanel1.class, "NewCaseVisualPanel1.rbLocalCase.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(rbSingleUserCase, org.openide.util.NbBundle.getMessage(NewCaseVisualPanel1.class, "NewCaseVisualPanel1.rbSingleUserCase.text")); // NOI18N
caseTypeButtonGroup.add(rbSharedCase); caseTypeButtonGroup.add(rbMultiUserCase);
org.openide.awt.Mnemonics.setLocalizedText(rbSharedCase, org.openide.util.NbBundle.getMessage(NewCaseVisualPanel1.class, "NewCaseVisualPanel1.rbSharedCase.text")); // NOI18N 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); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout); this.setLayout(layout);
@ -200,9 +200,9 @@ final class NewCaseVisualPanel1 extends JPanel implements DocumentListener {
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(caseDirBrowseButton)) .addComponent(caseDirBrowseButton))
.addGroup(layout.createSequentialGroup() .addGroup(layout.createSequentialGroup()
.addComponent(rbLocalCase) .addComponent(rbSingleUserCase)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(rbSharedCase))) .addComponent(rbMultiUserCase)))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
); );
layout.setVerticalGroup( 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) .addComponent(caseDirTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18) .addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(rbLocalCase) .addComponent(rbSingleUserCase)
.addComponent(rbSharedCase)) .addComponent(rbMultiUserCase))
.addContainerGap(16, Short.MAX_VALUE)) .addContainerGap(16, Short.MAX_VALUE))
); );
}// </editor-fold>//GEN-END:initComponents }// </editor-fold>//GEN-END:initComponents
@ -266,8 +266,8 @@ final class NewCaseVisualPanel1 extends JPanel implements DocumentListener {
private javax.swing.ButtonGroup caseTypeButtonGroup; private javax.swing.ButtonGroup caseTypeButtonGroup;
private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel2;
private javax.swing.JRadioButton rbLocalCase; private javax.swing.JRadioButton rbMultiUserCase;
private javax.swing.JRadioButton rbSharedCase; private javax.swing.JRadioButton rbSingleUserCase;
// End of variables declaration//GEN-END:variables // End of variables declaration//GEN-END:variables
/** /**

View File

@ -207,17 +207,17 @@ import org.xml.sax.SAXException;
* @return caseType from the document handler * @return caseType from the document handler
*/ */
public CaseType getCaseType() { public CaseType getCaseType() {
try { if (doc == null) {
if (doc == null) { return CaseType.SINGLE_USER_CASE;
return CaseType.LOCAL; } else {
} else { if (getCaseElement().getElementsByTagName(CASE_TYPE).getLength() > 0) {
Element nameElement = (Element) getCaseElement().getElementsByTagName(CASE_TYPE).item(0); Element nameElement = (Element) getCaseElement().getElementsByTagName(CASE_TYPE).item(0);
return CaseType.fromString(nameElement.getTextContent()); 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) * Sets the database name internally (on local variable in this class)
@ -233,14 +233,18 @@ import org.xml.sax.SAXException;
* *
* @return the database name * @return the database name
*/ */
public String getDatabaseName() { public String getDatabaseName() {
if (doc == null) { if (doc == null) {
return ""; return "";
} else { } else {
Element nameElement = (Element) getCaseElement().getElementsByTagName(DATABASE_NAME).item(0); if (getCaseElement().getElementsByTagName(DATABASE_NAME).getLength() > 0) {
return nameElement.getTextContent(); 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) * Sets the examiner name internally (on local variable in this class)
@ -755,7 +759,7 @@ import org.xml.sax.SAXException;
caseName = ""; caseName = "";
caseNumber = ""; caseNumber = "";
examiner = ""; examiner = "";
caseType = CaseType.LOCAL; caseType = CaseType.SINGLE_USER_CASE;
dbName = ""; dbName = "";
} }
} }

View File

@ -149,16 +149,16 @@ FXVideoPanel.progress.bufferingInterrupted=media buffering was interrupted
FXVideoPanel.progress.errorWritingVideoToDisk=Error writing video to disk FXVideoPanel.progress.errorWritingVideoToDisk=Error writing video to disk
OptionsCategory_Name_Multi_User_Settings=Multi-user OptionsCategory_Name_Multi_User_Settings=Multi-user
OptionsCategory_Keywords_Multi_User_Options=Multi-user Options OptionsCategory_Keywords_Multi_User_Options=Multi-user Options
AutopsyMultiUserSettingsPanel.lbExternalDatabase.text=Database Settings MultiUserSettingsPanel.lbSolrSettings.text=Solr Settings
AutopsyMultiUserSettingsPanel.lbOops.text= MultiUserSettingsPanel.lbOops.text=
AutopsyMultiUserSettingsPanel.cbExternalDbEnabled.text=Enable Multi-user MultiUserSettingsPanel.tbPassword.toolTipText=Enter the password here
AutopsyMultiUserSettingsPanel.tbPassword.toolTipText=Enter the password here MultiUserSettingsPanel.tbPassword.text=
AutopsyMultiUserSettingsPanel.tbPassword.text= MultiUserSettingsPanel.tbUsername.toolTipText=User Name
AutopsyMultiUserSettingsPanel.tbUsername.toolTipText=User Name MultiUserSettingsPanel.tbUsername.text=
AutopsyMultiUserSettingsPanel.tbUsername.text= MultiUserSettingsPanel.tbPortNumber.toolTipText=Port Number
AutopsyMultiUserSettingsPanel.tbPortNumber.toolTipText=Port Number MultiUserSettingsPanel.tbPortNumber.text=
AutopsyMultiUserSettingsPanel.tbPortNumber.text= MultiUserSettingsPanel.tbHostnameOrIp.toolTipText=Hostname or IP Address
AutopsyMultiUserSettingsPanel.tbHostnameOrIp.toolTipText=Hostname or IP Address MultiUserSettingsPanel.tbHostnameOrIp.text=
AutopsyMultiUserSettingsPanel.tbHostnameOrIp.text= MultiUserSettingsPanel.lbMessagingSettings.text=Messaging Settings
AutopsyMultiUserSettingsPanel.lbMessagingSettings.text=Messaging Settings MultiUserSettingsPanel.cbEnableMultiUser.text=Enable Multi-user cases
AutopsyMultiUserSettingsPanel.lbSolrSettings.text=Solr Settings MultiUserSettingsPanel.lbDatabaseSettings.text=Database Settings

View File

@ -16,11 +16,7 @@
<Layout> <Layout>
<DimensionLayout dim="0"> <DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0"> <Component id="pnOverallPanel" pref="481" max="32767" attributes="0"/>
<EmptySpace min="-2" pref="1" max="-2" attributes="0"/>
<Component id="pnOverallPanel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
</Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
<DimensionLayout dim="1"> <DimensionLayout dim="1">
@ -37,15 +33,13 @@
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="cbExternalDbEnabled" min="-2" max="-2" attributes="0"/> <Component id="cbEnableMultiUser" min="-2" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0"> <Component id="pnSolrSettings" alignment="0" max="32767" attributes="0"/>
<Component id="pnSolrSettings" alignment="0" max="32767" attributes="0"/> <Component id="pnDatabaseSettings" alignment="0" max="32767" attributes="0"/>
<Component id="pnMessagingSettings" alignment="0" max="32767" attributes="0"/> <Component id="pnMessagingSettings" alignment="0" max="32767" attributes="0"/>
</Group>
<Component id="pnExternalDatabase" alignment="0" min="-2" max="-2" attributes="0"/>
</Group> </Group>
<EmptySpace pref="14" max="32767" attributes="0"/> <EmptySpace max="32767" attributes="0"/>
</Group> </Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
@ -53,9 +47,9 @@
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0"> <Group type="102" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="cbExternalDbEnabled" min="-2" max="-2" attributes="0"/> <Component id="cbEnableMultiUser" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/> <EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="pnExternalDatabase" min="-2" max="-2" attributes="0"/> <Component id="pnDatabaseSettings" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/> <EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="pnSolrSettings" min="-2" max="-2" attributes="0"/> <Component id="pnSolrSettings" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/> <EmptySpace type="unrelated" max="-2" attributes="0"/>
@ -66,7 +60,7 @@
</DimensionLayout> </DimensionLayout>
</Layout> </Layout>
<SubComponents> <SubComponents>
<Container class="javax.swing.JPanel" name="pnExternalDatabase"> <Container class="javax.swing.JPanel" name="pnDatabaseSettings">
<Properties> <Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo"> <Border info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo">
@ -87,7 +81,7 @@
<Component id="tbPassword" alignment="0" max="32767" attributes="0"/> <Component id="tbPassword" alignment="0" max="32767" attributes="0"/>
<Group type="102" alignment="1" attributes="0"> <Group type="102" alignment="1" attributes="0">
<EmptySpace min="0" pref="1" max="32767" attributes="0"/> <EmptySpace min="0" pref="1" max="32767" attributes="0"/>
<Component id="lbExternalDatabase" min="-2" max="-2" attributes="0"/> <Component id="lbDatabaseSettings" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/> <EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="lbOops" min="-2" pref="320" max="-2" attributes="0"/> <Component id="lbOops" min="-2" pref="320" max="-2" attributes="0"/>
</Group> </Group>
@ -102,7 +96,7 @@
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0"> <Group type="102" attributes="0">
<EmptySpace max="32767" attributes="0"/> <EmptySpace max="32767" attributes="0"/>
<Component id="lbExternalDatabase" min="-2" max="-2" attributes="0"/> <Component id="lbDatabaseSettings" min="-2" max="-2" attributes="0"/>
</Group> </Group>
<Component id="lbOops" max="32767" attributes="0"/> <Component id="lbOops" max="32767" attributes="0"/>
</Group> </Group>
@ -126,10 +120,10 @@
<Font name="Tahoma" size="12" style="0"/> <Font name="Tahoma" size="12" style="0"/>
</Property> </Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/corecomponents/Bundle.properties" key="AutopsyMultiUserSettingsPanel.tbHostnameOrIp.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/> <ResourceString bundle="org/sleuthkit/autopsy/corecomponents/Bundle.properties" key="MultiUserSettingsPanel.tbHostnameOrIp.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property> </Property>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/corecomponents/Bundle.properties" key="AutopsyMultiUserSettingsPanel.tbHostnameOrIp.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/> <ResourceString bundle="org/sleuthkit/autopsy/corecomponents/Bundle.properties" key="MultiUserSettingsPanel.tbHostnameOrIp.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property> </Property>
</Properties> </Properties>
</Component> </Component>
@ -139,10 +133,10 @@
<Font name="Tahoma" size="12" style="0"/> <Font name="Tahoma" size="12" style="0"/>
</Property> </Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/corecomponents/Bundle.properties" key="AutopsyMultiUserSettingsPanel.tbPortNumber.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/> <ResourceString bundle="org/sleuthkit/autopsy/corecomponents/Bundle.properties" key="MultiUserSettingsPanel.tbPortNumber.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property> </Property>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/corecomponents/Bundle.properties" key="AutopsyMultiUserSettingsPanel.tbPortNumber.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/> <ResourceString bundle="org/sleuthkit/autopsy/corecomponents/Bundle.properties" key="MultiUserSettingsPanel.tbPortNumber.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property> </Property>
</Properties> </Properties>
</Component> </Component>
@ -152,10 +146,10 @@
<Font name="Tahoma" size="12" style="0"/> <Font name="Tahoma" size="12" style="0"/>
</Property> </Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/corecomponents/Bundle.properties" key="AutopsyMultiUserSettingsPanel.tbUsername.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/> <ResourceString bundle="org/sleuthkit/autopsy/corecomponents/Bundle.properties" key="MultiUserSettingsPanel.tbUsername.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property> </Property>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/corecomponents/Bundle.properties" key="AutopsyMultiUserSettingsPanel.tbUsername.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/> <ResourceString bundle="org/sleuthkit/autopsy/corecomponents/Bundle.properties" key="MultiUserSettingsPanel.tbUsername.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property> </Property>
</Properties> </Properties>
</Component> </Component>
@ -165,10 +159,10 @@
<Font name="Tahoma" size="12" style="0"/> <Font name="Tahoma" size="12" style="0"/>
</Property> </Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/corecomponents/Bundle.properties" key="AutopsyMultiUserSettingsPanel.tbPassword.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/> <ResourceString bundle="org/sleuthkit/autopsy/corecomponents/Bundle.properties" key="MultiUserSettingsPanel.tbPassword.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property> </Property>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/corecomponents/Bundle.properties" key="AutopsyMultiUserSettingsPanel.tbPassword.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/> <ResourceString bundle="org/sleuthkit/autopsy/corecomponents/Bundle.properties" key="MultiUserSettingsPanel.tbPassword.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property> </Property>
</Properties> </Properties>
</Component> </Component>
@ -181,18 +175,18 @@
<Color blue="0" green="0" red="ff" type="rgb"/> <Color blue="0" green="0" red="ff" type="rgb"/>
</Property> </Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/corecomponents/Bundle.properties" key="AutopsyMultiUserSettingsPanel.lbOops.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/> <ResourceString bundle="org/sleuthkit/autopsy/corecomponents/Bundle.properties" key="MultiUserSettingsPanel.lbOops.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property> </Property>
<Property name="verticalAlignment" type="int" value="3"/> <Property name="verticalAlignment" type="int" value="3"/>
</Properties> </Properties>
</Component> </Component>
<Component class="javax.swing.JLabel" name="lbExternalDatabase"> <Component class="javax.swing.JLabel" name="lbDatabaseSettings">
<Properties> <Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Tahoma" size="12" style="0"/> <Font name="Tahoma" size="12" style="0"/>
</Property> </Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/corecomponents/Bundle.properties" key="AutopsyMultiUserSettingsPanel.lbExternalDatabase.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/> <ResourceString bundle="org/sleuthkit/autopsy/corecomponents/Bundle.properties" key="MultiUserSettingsPanel.lbDatabaseSettings.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property> </Property>
<Property name="verticalAlignment" type="int" value="1"/> <Property name="verticalAlignment" type="int" value="1"/>
</Properties> </Properties>
@ -235,7 +229,7 @@
<Font name="Tahoma" size="12" style="0"/> <Font name="Tahoma" size="12" style="0"/>
</Property> </Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/corecomponents/Bundle.properties" key="AutopsyMultiUserSettingsPanel.lbSolrSettings.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/> <ResourceString bundle="org/sleuthkit/autopsy/corecomponents/Bundle.properties" key="MultiUserSettingsPanel.lbSolrSettings.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property> </Property>
</Properties> </Properties>
</Component> </Component>
@ -256,7 +250,7 @@
<Group type="102" alignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="lbMessagingSettings" min="-2" max="-2" attributes="0"/> <Component id="lbMessagingSettings" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="392" max="32767" attributes="0"/> <EmptySpace max="32767" attributes="0"/>
</Group> </Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
@ -277,20 +271,20 @@
<Font name="Tahoma" size="12" style="0"/> <Font name="Tahoma" size="12" style="0"/>
</Property> </Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/corecomponents/Bundle.properties" key="AutopsyMultiUserSettingsPanel.lbMessagingSettings.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/> <ResourceString bundle="org/sleuthkit/autopsy/corecomponents/Bundle.properties" key="MultiUserSettingsPanel.lbMessagingSettings.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property> </Property>
</Properties> </Properties>
</Component> </Component>
</SubComponents> </SubComponents>
</Container> </Container>
<Component class="javax.swing.JCheckBox" name="cbExternalDbEnabled"> <Component class="javax.swing.JCheckBox" name="cbEnableMultiUser">
<Properties> <Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/corecomponents/Bundle.properties" key="AutopsyMultiUserSettingsPanel.cbExternalDbEnabled.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/> <ResourceString bundle="org/sleuthkit/autopsy/corecomponents/Bundle.properties" key="MultiUserSettingsPanel.cbEnableMultiUser.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property> </Property>
</Properties> </Properties>
<Events> <Events>
<EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="cbExternalDbEnabledItemStateChanged"/> <EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="cbEnableMultiUserItemStateChanged"/>
</Events> </Events>
</Component> </Component>
</SubComponents> </SubComponents>

View File

@ -12,15 +12,15 @@ import org.sleuthkit.datamodel.CaseDbConnectionInfo;
import org.sleuthkit.datamodel.CaseDbConnectionInfo.DbType; import org.sleuthkit.datamodel.CaseDbConnectionInfo.DbType;
import org.sleuthkit.autopsy.core.UserPreferences; 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; private TextBoxChangedListener textBoxChangedListener;
/** /**
* Creates new form AutopsyMultiUserSettingsPanel * Creates new form AutopsyMultiUserSettingsPanel
*/ */
public AutopsyMultiUserSettingsPanel(AutopsyMultiUserSettingsPanelController theController) { public MultiUserSettingsPanel(MultiUserSettingsPanelController theController) {
initComponents(); initComponents();
controller = theController; controller = theController;
@ -40,7 +40,7 @@ public class AutopsyMultiUserSettingsPanel extends javax.swing.JPanel {
tpUsername.changeAlpha(alpha); tpUsername.changeAlpha(alpha);
tpPassword.changeAlpha(alpha); tpPassword.changeAlpha(alpha);
setNetworkDbEnabled(cbExternalDbEnabled.isSelected()); setNetworkDbEnabled(cbEnableMultiUser.isSelected());
/// Register for notifications when the text boxes get updated /// Register for notifications when the text boxes get updated
textBoxChangedListener = new TextBoxChangedListener(); textBoxChangedListener = new TextBoxChangedListener();
@ -60,71 +60,71 @@ public class AutopsyMultiUserSettingsPanel extends javax.swing.JPanel {
private void initComponents() { private void initComponents() {
pnOverallPanel = new javax.swing.JPanel(); pnOverallPanel = new javax.swing.JPanel();
pnExternalDatabase = new javax.swing.JPanel(); pnDatabaseSettings = new javax.swing.JPanel();
tbHostnameOrIp = new javax.swing.JTextField(); tbHostnameOrIp = new javax.swing.JTextField();
tbPortNumber = new javax.swing.JTextField(); tbPortNumber = new javax.swing.JTextField();
tbUsername = new javax.swing.JTextField(); tbUsername = new javax.swing.JTextField();
tbPassword = new javax.swing.JPasswordField(); tbPassword = new javax.swing.JPasswordField();
lbOops = new javax.swing.JLabel(); lbOops = new javax.swing.JLabel();
lbExternalDatabase = new javax.swing.JLabel(); lbDatabaseSettings = new javax.swing.JLabel();
pnSolrSettings = new javax.swing.JPanel(); pnSolrSettings = new javax.swing.JPanel();
lbSolrSettings = new javax.swing.JLabel(); lbSolrSettings = new javax.swing.JLabel();
pnMessagingSettings = new javax.swing.JPanel(); pnMessagingSettings = new javax.swing.JPanel();
lbMessagingSettings = new javax.swing.JLabel(); 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.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
tbHostnameOrIp.setText(org.openide.util.NbBundle.getMessage(AutopsyMultiUserSettingsPanel.class, "AutopsyMultiUserSettingsPanel.tbHostnameOrIp.text")); // NOI18N tbHostnameOrIp.setText(org.openide.util.NbBundle.getMessage(MultiUserSettingsPanel.class, "MultiUserSettingsPanel.tbHostnameOrIp.text")); // NOI18N
tbHostnameOrIp.setToolTipText(org.openide.util.NbBundle.getMessage(AutopsyMultiUserSettingsPanel.class, "AutopsyMultiUserSettingsPanel.tbHostnameOrIp.toolTipText")); // 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.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
tbPortNumber.setText(org.openide.util.NbBundle.getMessage(AutopsyMultiUserSettingsPanel.class, "AutopsyMultiUserSettingsPanel.tbPortNumber.text")); // NOI18N tbPortNumber.setText(org.openide.util.NbBundle.getMessage(MultiUserSettingsPanel.class, "MultiUserSettingsPanel.tbPortNumber.text")); // NOI18N
tbPortNumber.setToolTipText(org.openide.util.NbBundle.getMessage(AutopsyMultiUserSettingsPanel.class, "AutopsyMultiUserSettingsPanel.tbPortNumber.toolTipText")); // 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.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
tbUsername.setText(org.openide.util.NbBundle.getMessage(AutopsyMultiUserSettingsPanel.class, "AutopsyMultiUserSettingsPanel.tbUsername.text")); // NOI18N tbUsername.setText(org.openide.util.NbBundle.getMessage(MultiUserSettingsPanel.class, "MultiUserSettingsPanel.tbUsername.text")); // NOI18N
tbUsername.setToolTipText(org.openide.util.NbBundle.getMessage(AutopsyMultiUserSettingsPanel.class, "AutopsyMultiUserSettingsPanel.tbUsername.toolTipText")); // 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.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
tbPassword.setText(org.openide.util.NbBundle.getMessage(AutopsyMultiUserSettingsPanel.class, "AutopsyMultiUserSettingsPanel.tbPassword.text")); // NOI18N tbPassword.setText(org.openide.util.NbBundle.getMessage(MultiUserSettingsPanel.class, "MultiUserSettingsPanel.tbPassword.text")); // NOI18N
tbPassword.setToolTipText(org.openide.util.NbBundle.getMessage(AutopsyMultiUserSettingsPanel.class, "AutopsyMultiUserSettingsPanel.tbPassword.toolTipText")); // 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.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
lbOops.setForeground(new java.awt.Color(255, 0, 0)); 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); lbOops.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
lbExternalDatabase.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N lbDatabaseSettings.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 org.openide.awt.Mnemonics.setLocalizedText(lbDatabaseSettings, org.openide.util.NbBundle.getMessage(MultiUserSettingsPanel.class, "MultiUserSettingsPanel.lbDatabaseSettings.text")); // NOI18N
lbExternalDatabase.setVerticalAlignment(javax.swing.SwingConstants.TOP); lbDatabaseSettings.setVerticalAlignment(javax.swing.SwingConstants.TOP);
javax.swing.GroupLayout pnExternalDatabaseLayout = new javax.swing.GroupLayout(pnExternalDatabase); javax.swing.GroupLayout pnDatabaseSettingsLayout = new javax.swing.GroupLayout(pnDatabaseSettings);
pnExternalDatabase.setLayout(pnExternalDatabaseLayout); pnDatabaseSettings.setLayout(pnDatabaseSettingsLayout);
pnExternalDatabaseLayout.setHorizontalGroup( pnDatabaseSettingsLayout.setHorizontalGroup(
pnExternalDatabaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) pnDatabaseSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(pnExternalDatabaseLayout.createSequentialGroup() .addGroup(pnDatabaseSettingsLayout.createSequentialGroup()
.addContainerGap() .addContainerGap()
.addGroup(pnExternalDatabaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(pnDatabaseSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(tbHostnameOrIp) .addComponent(tbHostnameOrIp)
.addComponent(tbPortNumber) .addComponent(tbPortNumber)
.addComponent(tbUsername) .addComponent(tbUsername)
.addComponent(tbPassword) .addComponent(tbPassword)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnExternalDatabaseLayout.createSequentialGroup() .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnDatabaseSettingsLayout.createSequentialGroup()
.addGap(0, 1, Short.MAX_VALUE) .addGap(0, 1, Short.MAX_VALUE)
.addComponent(lbExternalDatabase) .addComponent(lbDatabaseSettings)
.addGap(18, 18, 18) .addGap(18, 18, 18)
.addComponent(lbOops, javax.swing.GroupLayout.PREFERRED_SIZE, 320, javax.swing.GroupLayout.PREFERRED_SIZE))) .addComponent(lbOops, javax.swing.GroupLayout.PREFERRED_SIZE, 320, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap()) .addContainerGap())
); );
pnExternalDatabaseLayout.setVerticalGroup( pnDatabaseSettingsLayout.setVerticalGroup(
pnExternalDatabaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) pnDatabaseSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnExternalDatabaseLayout.createSequentialGroup() .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnDatabaseSettingsLayout.createSequentialGroup()
.addGroup(pnExternalDatabaseLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(pnDatabaseSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(pnExternalDatabaseLayout.createSequentialGroup() .addGroup(pnDatabaseSettingsLayout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .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)) .addComponent(lbOops, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(tbHostnameOrIp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .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()); pnSolrSettings.setBorder(javax.swing.BorderFactory.createEtchedBorder());
lbSolrSettings.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N 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); javax.swing.GroupLayout pnSolrSettingsLayout = new javax.swing.GroupLayout(pnSolrSettings);
pnSolrSettings.setLayout(pnSolrSettingsLayout); pnSolrSettings.setLayout(pnSolrSettingsLayout);
@ -162,7 +162,7 @@ public class AutopsyMultiUserSettingsPanel extends javax.swing.JPanel {
pnMessagingSettings.setBorder(javax.swing.BorderFactory.createEtchedBorder()); pnMessagingSettings.setBorder(javax.swing.BorderFactory.createEtchedBorder());
lbMessagingSettings.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N 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); javax.swing.GroupLayout pnMessagingSettingsLayout = new javax.swing.GroupLayout(pnMessagingSettings);
pnMessagingSettings.setLayout(pnMessagingSettingsLayout); pnMessagingSettings.setLayout(pnMessagingSettingsLayout);
@ -171,7 +171,7 @@ public class AutopsyMultiUserSettingsPanel extends javax.swing.JPanel {
.addGroup(pnMessagingSettingsLayout.createSequentialGroup() .addGroup(pnMessagingSettingsLayout.createSequentialGroup()
.addContainerGap() .addContainerGap()
.addComponent(lbMessagingSettings) .addComponent(lbMessagingSettings)
.addContainerGap(392, Short.MAX_VALUE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
); );
pnMessagingSettingsLayout.setVerticalGroup( pnMessagingSettingsLayout.setVerticalGroup(
pnMessagingSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) pnMessagingSettingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@ -181,10 +181,10 @@ public class AutopsyMultiUserSettingsPanel extends javax.swing.JPanel {
.addContainerGap(74, Short.MAX_VALUE)) .addContainerGap(74, Short.MAX_VALUE))
); );
org.openide.awt.Mnemonics.setLocalizedText(cbExternalDbEnabled, org.openide.util.NbBundle.getMessage(AutopsyMultiUserSettingsPanel.class, "AutopsyMultiUserSettingsPanel.cbExternalDbEnabled.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(cbEnableMultiUser, org.openide.util.NbBundle.getMessage(MultiUserSettingsPanel.class, "MultiUserSettingsPanel.cbEnableMultiUser.text")); // NOI18N
cbExternalDbEnabled.addItemListener(new java.awt.event.ItemListener() { cbEnableMultiUser.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) { 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) pnOverallPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(pnOverallPanelLayout.createSequentialGroup() .addGroup(pnOverallPanelLayout.createSequentialGroup()
.addContainerGap() .addContainerGap()
.addGroup(pnOverallPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(pnOverallPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(cbExternalDbEnabled) .addComponent(cbEnableMultiUser)
.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(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)) .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(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap(14, Short.MAX_VALUE))
); );
pnOverallPanelLayout.setVerticalGroup( pnOverallPanelLayout.setVerticalGroup(
pnOverallPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) pnOverallPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnOverallPanelLayout.createSequentialGroup() .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnOverallPanelLayout.createSequentialGroup()
.addContainerGap() .addContainerGap()
.addComponent(cbExternalDbEnabled) .addComponent(cbEnableMultiUser)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .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) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(pnSolrSettings, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(pnSolrSettings, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
@ -220,10 +219,7 @@ public class AutopsyMultiUserSettingsPanel extends javax.swing.JPanel {
this.setLayout(layout); this.setLayout(layout);
layout.setHorizontalGroup( layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup() .addComponent(pnOverallPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 481, Short.MAX_VALUE)
.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))
); );
layout.setVerticalGroup( layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@ -243,10 +239,10 @@ public class AutopsyMultiUserSettingsPanel extends javax.swing.JPanel {
tbPassword.setEnabled(enabled); tbPassword.setEnabled(enabled);
} }
private void cbExternalDbEnabledItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cbExternalDbEnabledItemStateChanged private void cbEnableMultiUserItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cbEnableMultiUserItemStateChanged
setNetworkDbEnabled(cbExternalDbEnabled.isSelected()); setNetworkDbEnabled(cbEnableMultiUser.isSelected());
controller.changed(); controller.changed();
}//GEN-LAST:event_cbExternalDbEnabledItemStateChanged }//GEN-LAST:event_cbEnableMultiUserItemStateChanged
void load() { void load() {
CaseDbConnectionInfo info = UserPreferences.getDatabaseConnectionInfo(); CaseDbConnectionInfo info = UserPreferences.getDatabaseConnectionInfo();
@ -255,9 +251,9 @@ public class AutopsyMultiUserSettingsPanel extends javax.swing.JPanel {
tbUsername.setText(info.getUserName()); tbUsername.setText(info.getUserName());
tbPassword.setText(info.getPassword()); tbPassword.setText(info.getPassword());
if (info.getDbType() == DbType.UNKNOWN) { if (info.getDbType() == DbType.UNKNOWN) {
cbExternalDbEnabled.setSelected(false); cbEnableMultiUser.setSelected(false);
} else { } else {
cbExternalDbEnabled.setSelected(true); cbEnableMultiUser.setSelected(true);
} }
} }
@ -266,7 +262,7 @@ public class AutopsyMultiUserSettingsPanel extends javax.swing.JPanel {
DbType dbType = DbType.UNKNOWN; DbType dbType = DbType.UNKNOWN;
if (cbExternalDbEnabled.isSelected()) { if (cbEnableMultiUser.isSelected()) {
dbType = DbType.POSTGRESQL; dbType = DbType.POSTGRESQL;
} }
@ -288,7 +284,7 @@ public class AutopsyMultiUserSettingsPanel extends javax.swing.JPanel {
boolean valid() { boolean valid() {
boolean result = false; boolean result = false;
String text = ""; String text = "";
if (cbExternalDbEnabled.isSelected()) { if (cbEnableMultiUser.isSelected()) {
try { try {
if (tbHostnameOrIp.getText().isEmpty() if (tbHostnameOrIp.getText().isEmpty()
|| tbPortNumber.getText().isEmpty() || tbPortNumber.getText().isEmpty()
@ -317,12 +313,12 @@ public class AutopsyMultiUserSettingsPanel extends javax.swing.JPanel {
return result; return result;
} }
// Variables declaration - do not modify//GEN-BEGIN:variables // Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JCheckBox cbExternalDbEnabled; private javax.swing.JCheckBox cbEnableMultiUser;
private javax.swing.JLabel lbExternalDatabase; private javax.swing.JLabel lbDatabaseSettings;
private javax.swing.JLabel lbMessagingSettings; private javax.swing.JLabel lbMessagingSettings;
private javax.swing.JLabel lbOops; private javax.swing.JLabel lbOops;
private javax.swing.JLabel lbSolrSettings; private javax.swing.JLabel lbSolrSettings;
private javax.swing.JPanel pnExternalDatabase; private javax.swing.JPanel pnDatabaseSettings;
private javax.swing.JPanel pnMessagingSettings; private javax.swing.JPanel pnMessagingSettings;
private javax.swing.JPanel pnOverallPanel; private javax.swing.JPanel pnOverallPanel;
private javax.swing.JPanel pnSolrSettings; private javax.swing.JPanel pnSolrSettings;

View File

@ -34,12 +34,12 @@ import org.sleuthkit.autopsy.coreutils.Logger;
position = 2, position = 2,
keywords = "#OptionsCategory_Keywords_Multi_User_Options", keywords = "#OptionsCategory_Keywords_Multi_User_Options",
keywordsCategory = "Multi-user") 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 final PropertyChangeSupport pcs = new PropertyChangeSupport(this);
private boolean changed; private boolean changed;
private static final Logger logger = Logger.getLogger(AutopsyMultiUserSettingsPanelController.class.getName()); private static final Logger logger = Logger.getLogger(MultiUserSettingsPanelController.class.getName());
@Override @Override
public void update() { public void update() {
@ -95,9 +95,9 @@ public final class AutopsyMultiUserSettingsPanelController extends OptionsPanelC
*/ */
} }
private AutopsyMultiUserSettingsPanel getPanel() { private MultiUserSettingsPanel getPanel() {
if (panel == null) { if (panel == null) {
panel = new AutopsyMultiUserSettingsPanel(this); panel = new MultiUserSettingsPanel(this);
} }
return panel; return panel;
} }