Merge branch 'elastic-computing' of github.com:sleuthkit/autopsy into cl_reports

This commit is contained in:
Eugene Livis 2019-08-04 07:49:38 -04:00
commit 63df6f9f49
23 changed files with 175 additions and 96 deletions

View File

@ -2,7 +2,7 @@ Manifest-Version: 1.0
OpenIDE-Module: org.sleuthkit.autopsy.core/10
OpenIDE-Module-Localizing-Bundle: org/sleuthkit/autopsy/core/Bundle.properties
OpenIDE-Module-Layer: org/sleuthkit/autopsy/core/layer.xml
OpenIDE-Module-Implementation-Version: 27
OpenIDE-Module-Implementation-Version: 28
OpenIDE-Module-Requires: org.openide.windows.WindowManager
AutoUpdate-Show-In-Client: true
AutoUpdate-Essential-Module: true

View File

@ -122,5 +122,5 @@ nbm.homepage=http://www.sleuthkit.org/
nbm.module.author=Brian Carrier
nbm.needs.restart=true
source.reference.curator-recipes-2.8.0.jar=release/modules/ext/curator-recipes-2.8.0-sources.jar
spec.version.base=10.15
spec.version.base=10.16

View File

@ -0,0 +1,8 @@
OptionsCategory_Name_Machine_Translation=Machine Translation
OptionsCategory_Keywords_Machine_Translation_Settings=Machine Translation Settings
TranslationContentPanel.ocrLabel.text=OCR:
TranslationOptionsPanelController.moduleErr=Module Error
TranslationOptionsPanelController.moduleErr.msg=A module caused an error listening to TranslationSettingsPanelController updates. See log to determine which module. Some data could be incomplete.
TranslationContentPanel.showLabel.text=Show:
TranslationOptionsPanel.translationServiceLabel.text=Text translator:
TranslationOptionsPanel.translationOptionsDescription.text=Configure a 3rd party text translation service to enable text and file name translation.

View File

@ -0,0 +1,12 @@
OptionsCategory_Name_Machine_Translation=Machine Translation
OptionsCategory_Keywords_Machine_Translation_Settings=Machine Translation Settings
TranslationContentPanel.ocrLabel.text=OCR:
TranslationOptionsPanel.noTextTranslators.text=No text translators exist, translation is disabled.
TranslationOptionsPanel.noTextTranslatorSelected.text=No text translator selected, translation is disabled.
TranslationOptionsPanel.textTranslatorsUnavailable.text=Unable to get selected text translator, translation is disabled.
TranslationOptionsPanel.translationDisabled.text=Translation disabled
TranslationOptionsPanelController.moduleErr=Module Error
TranslationOptionsPanelController.moduleErr.msg=A module caused an error listening to TranslationSettingsPanelController updates. See log to determine which module. Some data could be incomplete.
TranslationContentPanel.showLabel.text=Show:
TranslationOptionsPanel.translationServiceLabel.text=Text translator:
TranslationOptionsPanel.translationOptionsDescription.text=Configure a 3rd party text translation service to enable text and file name translation.

View File

@ -23,6 +23,7 @@ import java.util.Collections;
import java.util.Optional;
import org.openide.util.Lookup;
import org.sleuthkit.autopsy.core.UserPreferences;
import javax.annotation.concurrent.GuardedBy;
/**
* Performs a lookup for a TextTranslator service provider and if present, will
@ -33,6 +34,7 @@ public final class TextTranslationService {
private final static TextTranslationService tts = new TextTranslationService();
private final Collection<? extends TextTranslator> translators;
@GuardedBy("this")
private Optional<TextTranslator> selectedTranslator;
private TextTranslationService() {
@ -50,7 +52,7 @@ public final class TextTranslationService {
* Update the translator currently in use to match the one saved to the user
* preferences
*/
public void updateSelectedTranslator() {
synchronized void updateSelectedTranslator() {
String translatorName = UserPreferences.getTextTranslatorName();
for (TextTranslator translator : translators) {
if (translator.getName().equals(translatorName)) {
@ -75,7 +77,7 @@ public final class TextTranslationService {
* when specific translation
* implementations fail
*/
public String translate(String input) throws NoServiceProviderException, TranslationException {
public synchronized String translate(String input) throws NoServiceProviderException, TranslationException {
if (hasProvider()) {
return selectedTranslator.get().translate(input);
}
@ -92,7 +94,7 @@ public final class TextTranslationService {
*
* @throws NoServiceProviderException
*/
public TextTranslator getTranslatorByName(String translatorName) throws NoServiceProviderException {
TextTranslator getTranslatorByName(String translatorName) throws NoServiceProviderException {
for (TextTranslator translator : translators) {
if (translator.getName().equals(translatorName)) {
return translator;
@ -107,7 +109,7 @@ public final class TextTranslationService {
*
* @return an unmodifiable collection of TextTranslators
*/
public Collection<? extends TextTranslator> getTranslators() {
Collection<? extends TextTranslator> getTranslators() {
return Collections.unmodifiableCollection(translators);
}
@ -117,16 +119,16 @@ public final class TextTranslationService {
*
* @return
*/
public boolean hasProvider() {
public synchronized boolean hasProvider() {
return selectedTranslator.isPresent();
}
/**
* Returns the hard limit for translation request sizes.
*
* @return
* Gets the maximum number of characters allowed in a translation request.
*
* @return The maximum character count.
*/
public int getMaxPayloadSize() {
return selectedTranslator.get().getMaxPayloadSize();
public synchronized int getMaxTextChars() {
return selectedTranslator.get().getMaxTextChars();
}
}

View File

@ -18,7 +18,7 @@
*/
package org.sleuthkit.autopsy.texttranslation;
import java.awt.Component;
import javax.swing.JPanel;
/**
* Interface for creating text translators. Implementing classes will be picked
@ -45,22 +45,24 @@ public interface TextTranslator {
String getName();
/**
* Get the component to display on the settings options panel when this
* Get the JPanel to display on the settings options panel when this
* TextTranslator is selected
*
* @return the component which displays the settings options
* @return the panel which displays the settings options
*/
Component getComponent();
JPanel getSettingsPanel();
/**
* Save the settings as they have been modified in the component.
*/
void saveSettings();
/**
* Returns the hard limit for translation request sizes.
* Saves the current state of the settings in the settings panel.
*
* @return
* @throws TranslationConfigException
*/
int getMaxPayloadSize();
void saveSettings() throws TranslationConfigException;
/**
* Gets the maximum number of characters allowed in a translation request.
*
* @return The maximum character count.
*/
int getMaxTextChars();
}

View File

@ -0,0 +1,48 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2019 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.sleuthkit.autopsy.texttranslation;
/**
* Instances of this exception class are thrown when there is an error
* configuring text translation.
*/
public class TranslationConfigException extends Exception {
private static final long serialVersionUID = 1L;
/**
* Constructs a new exception with the specified message.
*
* @param message The message.
*/
public TranslationConfigException(String message) {
super(message);
}
/**
* Constructs a new exception with the specified message and cause.
*
* @param message The message.
* @param cause The cause.
*/
public TranslationConfigException(String message, Throwable cause) {
super(message, cause);
}
}

View File

@ -22,13 +22,8 @@ package org.sleuthkit.autopsy.texttranslation;
* Provides a system exception for Text Translation errors
*/
public class TranslationException extends Exception {
/**
* Constructs a new exception with null as its message.
*/
public TranslationException() {
super();
}
private static final long serialVersionUID = 1L;
/**
* Constructs a new exception with the specified message.

View File

@ -61,7 +61,7 @@
<Component class="javax.swing.JLabel" name="translationServiceLabel">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/texttranslation/ui/Bundle.properties" key="TranslationOptionsPanel.translationServiceLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
<ResourceString bundle="org/sleuthkit/autopsy/texttranslation/Bundle.properties" key="TranslationOptionsPanel.translationServiceLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
@ -72,7 +72,7 @@
<Component class="javax.swing.JLabel" name="translationOptionsDescription">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/texttranslation/ui/Bundle.properties" key="TranslationOptionsPanel.translationOptionsDescription.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
<ResourceString bundle="org/sleuthkit/autopsy/texttranslation/Bundle.properties" key="TranslationOptionsPanel.translationOptionsDescription.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>

View File

@ -16,7 +16,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.sleuthkit.autopsy.texttranslation.ui;
package org.sleuthkit.autopsy.texttranslation;
import java.awt.BorderLayout;
import java.awt.Color;
@ -27,14 +27,12 @@ import java.util.logging.Level;
import javax.swing.JLabel;
import org.openide.util.NbBundle.Messages;
import org.sleuthkit.autopsy.core.UserPreferences;
import org.sleuthkit.autopsy.texttranslation.NoServiceProviderException;
import org.sleuthkit.autopsy.texttranslation.TextTranslationService;
import org.sleuthkit.autopsy.coreutils.Logger;
/**
* Options panel to display translation options
*/
public class TranslationOptionsPanel extends javax.swing.JPanel {
final class TranslationOptionsPanel extends javax.swing.JPanel {
private final static Logger logger = Logger.getLogger(TranslationOptionsPanel.class.getName());
private static final long serialVersionUID = 1L;
@ -45,7 +43,7 @@ public class TranslationOptionsPanel extends javax.swing.JPanel {
* Creates new form TranslationOptionsPanel
*/
@Messages({"TranslationOptionsPanel.translationDisabled.text=Translation disabled"})
public TranslationOptionsPanel(TranslationOptionsPanelController theController) {
TranslationOptionsPanel(TranslationOptionsPanelController theController) {
initComponents();
controller = theController;
translatorComboBox.addItem(Bundle.TranslationOptionsPanel_translationDisabled_text());
@ -78,7 +76,7 @@ public class TranslationOptionsPanel extends javax.swing.JPanel {
translationServicePanel.removeAll();
if (translatorComboBox.getSelectedItem() != null && !translatorComboBox.getSelectedItem().toString().equals(Bundle.TranslationOptionsPanel_translationDisabled_text())) {
try {
Component panel = TextTranslationService.getInstance().getTranslatorByName(translatorComboBox.getSelectedItem().toString()).getComponent();
Component panel = TextTranslationService.getInstance().getTranslatorByName(translatorComboBox.getSelectedItem().toString()).getSettingsPanel();
panel.addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
@ -126,7 +124,7 @@ public class TranslationOptionsPanel extends javax.swing.JPanel {
if (currentSelection != null && !currentSelection.equals(Bundle.TranslationOptionsPanel_translationDisabled_text())) {
try {
TextTranslationService.getInstance().getTranslatorByName(currentSelection).saveSettings();
} catch (NoServiceProviderException ex) {
} catch (NoServiceProviderException | TranslationConfigException ex) {
logger.log(Level.WARNING, "Unable to save settings for TextTranslator named: " + currentSelection, ex);
}
}
@ -172,7 +170,7 @@ public class TranslationOptionsPanel extends javax.swing.JPanel {
.addGap(10, 10, 10)
.addComponent(translatorComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 214, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE))
.addComponent(translationOptionsDescription, javax.swing.GroupLayout.DEFAULT_SIZE, 462, Short.MAX_VALUE))
.addComponent(translationOptionsDescription, javax.swing.GroupLayout.PREFERRED_SIZE, 462, Short.MAX_VALUE))
.addContainerGap())
);
layout.setVerticalGroup(

View File

@ -16,7 +16,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.sleuthkit.autopsy.texttranslation.ui;
package org.sleuthkit.autopsy.texttranslation;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;

View File

@ -26,11 +26,12 @@ import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.RequestBody;
import com.squareup.okhttp.Response;
import java.awt.Component;
import java.io.IOException;
import javax.swing.JPanel;
import org.openide.util.NbBundle.Messages;
import org.openide.util.lookup.ServiceProvider;
import org.sleuthkit.autopsy.texttranslation.TextTranslator;
import org.sleuthkit.autopsy.texttranslation.TranslationConfigException;
import org.sleuthkit.autopsy.texttranslation.TranslationException;
/**
@ -132,12 +133,12 @@ public class BingTranslator implements TextTranslator {
}
@Override
public Component getComponent() {
public JPanel getSettingsPanel() {
return settingsPanel;
}
@Override
public void saveSettings() {
public void saveSettings() throws TranslationConfigException {
settings.setAuthenticationKey(settingsPanel.getAuthenticationKey());
settings.setTargetLanguageCode(settingsPanel.getTargetLanguageCode());
settings.saveSettings();
@ -173,7 +174,7 @@ public class BingTranslator implements TextTranslator {
}
@Override
public int getMaxPayloadSize() {
public int getMaxTextChars() {
return MAX_STRING_LENGTH;
}
}

View File

@ -23,7 +23,6 @@ import com.google.auth.oauth2.ServiceAccountCredentials;
import com.google.cloud.translate.Translate;
import com.google.cloud.translate.TranslateOptions;
import com.google.cloud.translate.Translation;
import java.awt.Component;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
@ -31,12 +30,14 @@ import java.io.InputStream;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.logging.Level;
import javax.swing.JPanel;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.apache.commons.lang3.StringUtils;
import org.openide.util.NbBundle.Messages;
import org.openide.util.lookup.ServiceProvider;
import org.sleuthkit.autopsy.coreutils.EscapeUtil;
import org.sleuthkit.autopsy.texttranslation.TextTranslator;
import org.sleuthkit.autopsy.texttranslation.TranslationConfigException;
import org.sleuthkit.autopsy.texttranslation.TranslationException;
/**
@ -133,7 +134,7 @@ public final class GoogleTranslator implements TextTranslator {
}
@Override
public Component getComponent() {
public JPanel getSettingsPanel() {
return settingsPanel;
}
@ -172,7 +173,7 @@ public final class GoogleTranslator implements TextTranslator {
}
@Override
public void saveSettings() {
public void saveSettings() throws TranslationConfigException {
settings.setTargetLanguageCode(settingsPanel.getTargetLanguageCode());
settings.setCredentialPath(settingsPanel.getCredentialsPath());
settings.saveSettings();
@ -180,7 +181,7 @@ public final class GoogleTranslator implements TextTranslator {
}
@Override
public int getMaxPayloadSize() {
public int getMaxTextChars() {
return MAX_PAYLOAD_SIZE;
}
}

View File

@ -1,8 +1,6 @@
OptionsCategory_Name_Machine_Translation=Machine Translation
OptionsCategory_Keywords_Machine_Translation_Settings=Machine Translation Settings
TranslationContentPanel.ocrLabel.text=OCR:
TranslationOptionsPanel.translationServiceLabel.text=Text translator:
TranslationOptionsPanelController.moduleErr=Module Error
TranslationOptionsPanelController.moduleErr.msg=A module caused an error listening to TranslationSettingsPanelController updates. See log to determine which module. Some data could be incomplete.
TranslationOptionsPanel.translationOptionsDescription.text=Configure a 3rd party text translation service to enable text and file name translation.
TranslationContentPanel.showLabel.text=Show:

View File

@ -17,12 +17,6 @@ TranslatedTextViewer.title=Translation
TranslatedTextViewer.toolTip=Displays translated file text.
TranslationContentPanel.autoDetectOCR=Autodetect language
TranslationContentPanel.ocrLabel.text=OCR:
TranslationOptionsPanel.noTextTranslators.text=No text translators exist, translation is disabled.
TranslationOptionsPanel.noTextTranslatorSelected.text=No text translator selected, translation is disabled.
TranslationOptionsPanel.textTranslatorsUnavailable.text=Unable to get selected text translator, translation is disabled.
TranslationOptionsPanel.translationDisabled.text=Translation disabled
TranslationOptionsPanel.translationServiceLabel.text=Text translator:
TranslationOptionsPanelController.moduleErr=Module Error
TranslationOptionsPanelController.moduleErr.msg=A module caused an error listening to TranslationSettingsPanelController updates. See log to determine which module. Some data could be incomplete.
TranslationOptionsPanel.translationOptionsDescription.text=Configure a 3rd party text translation service to enable text and file name translation.
TranslationContentPanel.showLabel.text=Show:

View File

@ -96,7 +96,7 @@ public final class TranslatedTextViewer implements TextViewer {
}
}
int payloadMaxInKB = TextTranslationService.getInstance().getMaxPayloadSize() / 1000;
int payloadMaxInKB = TextTranslationService.getInstance().getMaxTextChars() / 1000;
panel.setWarningLabelMsg(String.format(Bundle.TranslatedTextViewer_maxPayloadSize(), payloadMaxInKB));
//Force a background task.

View File

@ -135,7 +135,7 @@
<compile-dependency/>
<run-dependency>
<release-version>10</release-version>
<specification-version>10.15</specification-version>
<specification-version>10.16</specification-version>
</run-dependency>
</dependency>
<dependency>

View File

@ -127,7 +127,7 @@
<compile-dependency/>
<run-dependency>
<release-version>10</release-version>
<specification-version>10.15</specification-version>
<specification-version>10.16</specification-version>
</run-dependency>
</dependency>
<dependency>

View File

@ -119,7 +119,7 @@
<compile-dependency/>
<run-dependency>
<release-version>10</release-version>
<specification-version>10.15</specification-version>
<specification-version>10.16</specification-version>
</run-dependency>
</dependency>
<dependency>

View File

@ -60,7 +60,7 @@
<compile-dependency/>
<run-dependency>
<release-version>10</release-version>
<specification-version>10.15</specification-version>
<specification-version>10.16</specification-version>
</run-dependency>
</dependency>
<dependency>

View File

@ -1,13 +1,11 @@
/*! \page logs_and_output_page Logs, Output, and Progress
There are several shortcuts for getting to the output folder, log folder, and progress shapshot shown below.
<br><br>
To open the Case output folder, use "Tools", "Open Output Folder" as shown below:
/*! \page logs_and_output_page Viewing Case Logs and Output
There are several shortcuts for getting to the case and log folders.
- To open the Case output folder, use "Tools", "Open Output Folder" as shown below:
\image html open_output_folder.PNG
<br><br>
To open the Case log folder, use "Help", "Open Log Folder" as shown below:
- To open the Case log folder, use "Help", "Open Log Folder" as shown below:
\image html open_log_folder.PNG
<br><br>
While Ingest is running, one can use the "Ingest Progress Snapshot" tool to see what activity is going on at the moment. Click on "Help", "Get Ingest Progress Snapshot" to view the dialog shown in the screenshot below.
\image html ingest_progress_snapshot.PNG
To refresh the view, use the "Refresh" button.
*/

View File

@ -10,13 +10,23 @@ Help Topics
-------
The following topics are available here:
- \subpage installation_page
- Installation
- \subpage installation_page
- \subpage performance_page
- Multi-user Cluster
- \subpage install_multiuser_page
- \subpage multiuser_sec_page
- \subpage multiuser_page
- \subpage quick_start_guide "Quick Start Guide"
- \subpage workflow_page
- Cases and Adding Data Sources
- \subpage workflow_page
- \subpage cases_page
- \subpage ds_page
- \subpage uilayout_page
- \subpage logs_and_output_page
- Ingest Modules
- \subpage ingest_page "Ingest Modules"
- \subpage recent_activity_page
@ -34,43 +44,55 @@ The following topics are available here:
- \subpage cr_ingest_module
- \subpage encryption_page
- \subpage vm_extractor_page
- Reviewing the Results
- \subpage uilayout_page
- \subpage tree_viewer_page
- \subpage result_viewer_page
- \subpage content_viewer_page
- \subpage machine_translation_page
- Searching
- \subpage ui_quick_search
- \subpage image_gallery_page
- \subpage file_search_page
- \subpage ad_hoc_keyword_search_page
- \subpage timeline_page
- \subpage stix_page
- \subpage central_repo_page
- \subpage communications_page
- \subpage common_properties_page
- \subpage search_all_cases_page
- \subpage logs_and_output_page
- \subpage machine_translation_page
- Specialized Viewers
- \subpage image_gallery_page
- \subpage timeline_page
- \subpage communications_page
- Reporting
- \subpage tagging_page
- \subpage reporting_page
- \subpage module_install_page
- \subpage performance_page
- Multi-user Cluster
- \subpage install_multiuser_page
- \subpage multiuser_sec_page
- \subpage multiuser_page
- Triage
- \subpage triage_page
- \subpage live_triage_page
- \subpage central_repo_page
- Other Workflows
- Triage
- \subpage triage_page
- \subpage live_triage_page
- \subpage logical_imager_page
- \subpage command_line_ingest_page
- Experimental Module
- \subpage experimental_page
- \ref auto_ingest_page
- \ref object_detection_page
- \ref volatility_dsp_page
- \subpage command_line_ingest_page
- \subpage logical_imager_page
- \subpage translations_page
If the topic you need is not listed, refer to the <a href="http://wiki.sleuthkit.org/index.php?title=Autopsy_User%27s_Guide">Autopsy Wiki</a> or join the <a href="https://lists.sourceforge.net/lists/listinfo/sleuthkit-users">SleuthKit User List</a> at SourceForge.
- \subpage translations_page
If the topic you need is not listed, then you can:
- Refer to the <a href="http://wiki.sleuthkit.org/index.php?title=Autopsy_User%27s_Guide">Autopsy Wiki</a>
- Ask a question on the <a href="http://forum.sleuthkit.org">Forum</a>
- Ask a question on the <a href="https://lists.sourceforge.net/lists/listinfo/sleuthkit-users">Email List</a>.
*/

View File

@ -36,7 +36,7 @@
<compile-dependency/>
<run-dependency>
<release-version>10</release-version>
<specification-version>10.15</specification-version>
<specification-version>10.16</specification-version>
</run-dependency>
</dependency>
<dependency>