Skip to content

Commit

Permalink
added new soap message
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentinoAvonEFSA committed Jan 22, 2018
1 parent ae1b023 commit 55ea858
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/global_utils/Warnings.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import ack.DcfAckLog;
import ack.OpResError;
import app_config.PropertiesReader;
import exception_manager.ExceptionConverter;
import converter.ExceptionConverter;
import i18n_messages.Messages;
import soap.MySOAPException;
import soap.SOAPError;
Expand Down Expand Up @@ -85,6 +85,10 @@ public static String[] getSOAPWarning(MySOAPException e) {
title = Messages.get("error.title");
message = Messages.get("wrong.credentials");
break;
case MESSAGE_SEND_FAILED:
title = Messages.get("error.title");
message = Messages.get("send.message.failed");
break;
}

return new String[] {title, message};
Expand Down
4 changes: 4 additions & 0 deletions src/i18n_messages/rcl_messages_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ dc.header.active.to=Active to
dc.header.category=Category
dc.header.resource.id=Resource id

# s1: technical support email
dc.no.element.found=WARN702: No data collection is configured for your account. Please contact %s1.

### progress bar
send.progress.title=Sending report

Expand All @@ -79,6 +82,7 @@ success.title=Success
warning.title=Warning
error.title=Error

send.message.failed=ERR104: It was not possible to connect to DCF. This could be caused by a wrongly typed user name in the User Settings. Please check.
wrong.credentials=ERR100: Your credentials are incorrect. Please check them in the Settings.

# s1: the current data collection code used
Expand Down
20 changes: 19 additions & 1 deletion src/report/ReportDownloader.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
import org.eclipse.swt.widgets.Shell;

import amend_manager.ReportImporter;
import app_config.PropertiesReader;
import data_collection.DataCollectionsListDialog;
import data_collection.DcfDataCollectionsList;
import data_collection.GetAvailableDataCollections;
import data_collection.IDcfDataCollection;
import data_collection.IDcfDataCollectionsList;
import dataset.Dataset;
import dataset.DatasetList;
import global_utils.Warnings;
import i18n_messages.Messages;
import progress_bar.FormProgressBar;
import progress_bar.ProgressListener;
Expand Down Expand Up @@ -69,9 +71,25 @@ public void download() throws MySOAPException {
shell.setCursor(shell.getDisplay().getSystemCursor(SWT.CURSOR_WAIT));

// select the data collection
IDcfDataCollectionsList<IDcfDataCollection> list = getAvailableDcList();
IDcfDataCollectionsList<IDcfDataCollection> list;
try {
list = getAvailableDcList();
} catch(MySOAPException e) {
shell.setCursor(shell.getDisplay().getSystemCursor(SWT.CURSOR_ARROW));
throw e;
}

shell.setCursor(shell.getDisplay().getSystemCursor(SWT.CURSOR_ARROW));

// if no data collection was retrieved
if (list.isEmpty()) {

Warnings.warnUser(shell, Messages.get("warning.title"),
Messages.get("dc.no.element.found", PropertiesReader.getSupportEmail()),
SWT.ICON_WARNING);

return;
}

DataCollectionsListDialog dcDialog = new DataCollectionsListDialog(list, shell);

Expand Down

0 comments on commit 55ea858

Please sign in to comment.