Merge remote-tracking branch 'origin/master'

This commit is contained in:
Simon Pamies committed 2015-02-05 18:52:33 +08:00
commit ece9a9153d
49 files changed
+324 -269

No files matched your search

@@ -19,7 +19,6 @@ import com.sap.sailing.gwt.ui.client.MediaServiceAsync;
import com.sap.sailing.gwt.ui.client.RegattaRefresher;
import com.sap.sailing.gwt.ui.client.RegattasDisplayer;
import com.sap.sailing.gwt.ui.client.RemoteServiceMappingConstants;
import com.sap.sailing.gwt.ui.client.filestorage.FileStoragePanel;
import com.sap.sailing.gwt.ui.masterdataimport.MasterDataImportPanel;
import com.sap.sailing.gwt.ui.shared.BetterDateTimeBox;
import com.sap.sailing.gwt.ui.shared.LeaderboardGroupDTO;
@@ -31,6 +30,7 @@ import com.sap.sse.gwt.adminconsole.DefaultRefreshableAdminConsolePanel;
import com.sap.sse.gwt.client.EntryPointHelper;
import com.sap.sse.gwt.client.async.AsyncActionsExecutor;
import com.sap.sse.gwt.client.async.MarkedAsyncCallback;
import com.sap.sse.gwt.client.controls.filestorage.FileStoragePanel;
import com.sap.sse.security.ui.client.component.UserManagementPanel;
import com.sap.sse.security.ui.client.i18n.StringMessages;
@@ -222,7 +222,7 @@ public class AdminConsoleEntryPoint extends AbstractSailingEntryPoint implements
panel.addToTabPanel(advancedTabPanel, new DefaultRefreshableAdminConsolePanel<UserManagementPanel>(userManagementPanel),
getStringMessages().userManagement(), SailingAdminConsoleFeatures.MANAGE_USERS);
final FileStoragePanel fileStoragePanel = new FileStoragePanel(sailingService, this, getStringMessages());
final FileStoragePanel fileStoragePanel = new FileStoragePanel(sailingService, this);
panel.addToTabPanel(advancedTabPanel, new DefaultRefreshableAdminConsolePanel<FileStoragePanel>(fileStoragePanel),
getStringMessages().fileStorage(), SailingAdminConsoleFeatures.MANAGE_FILE_STORAGE);
@@ -55,8 +55,6 @@ import com.sap.sailing.gwt.ui.shared.DeviceConfigurationMatcherDTO;
import com.sap.sailing.gwt.ui.shared.DeviceMappingDTO;
import com.sap.sailing.gwt.ui.shared.EventBaseDTO;
import com.sap.sailing.gwt.ui.shared.EventDTO;
import com.sap.sailing.gwt.ui.shared.FileStorageServiceDTO;
import com.sap.sailing.gwt.ui.shared.FileStorageServicePropertyErrorsDTO;
import com.sap.sailing.gwt.ui.shared.GPSFixDTO;
import com.sap.sailing.gwt.ui.shared.LeaderboardGroupDTO;
import com.sap.sailing.gwt.ui.shared.LeaderboardSearchResultDTO;
@@ -90,12 +88,13 @@ import com.sap.sse.common.NoCorrespondingServiceRegisteredException;
import com.sap.sse.common.Util;
import com.sap.sse.common.Util.Pair;
import com.sap.sse.common.search.KeywordQuery;
import com.sap.sse.gwt.client.filestorage.FileStorageManagementGwtService;
/**
* The client side stub for the RPC service. Usually, when a <code>null</code> date is passed to
* the time-dependent service methods, an empty (non-<code>null</code>) result is returned.
*/
public interface SailingService extends RemoteService {
public interface SailingService extends RemoteService, FileStorageManagementGwtService {
List<TracTracConfigurationDTO> getPreviousTracTracConfigurations() throws Exception;
List<RegattaDTO> getRegattas();
@@ -576,27 +575,4 @@ public interface SailingService extends RemoteService {
List<DeviceMappingDTO> getDeviceMappingsFromLogHierarchy(String leaderboardName, String raceColumnName,
String fleetName) throws TransformationException;
FileStorageServiceDTO[] getAvailableFileStorageServices();
/**
* @throws NoCorrespondingServiceRegisteredException service may have disappeared from registry in the meantime
*/
FileStorageServicePropertyErrorsDTO testFileStorageServiceProperties(String serviceName) throws NoCorrespondingServiceRegisteredException;
/**
* @throws NoCorrespondingServiceRegisteredException service may have disappeared from registry in the meantime
*/
void setActiveFileStorageService(String serviceName) throws NoCorrespondingServiceRegisteredException;
/**
* @return may be {@code null}
*/
String getActiveFileStorageServiceName();
/**
* @throws NoCorrespondingServiceRegisteredException service may have disappeared from registry in the meantime
* @throws IllegalArgumentException if the property with name {@code propertyName} doesn't exist for the service
*/
void setFileStorageServiceProperties(String serviceName, Map<String, String> properties);
}
@@ -45,8 +45,6 @@ import com.sap.sailing.gwt.ui.shared.DeviceConfigurationMatcherDTO;
import com.sap.sailing.gwt.ui.shared.DeviceMappingDTO;
import com.sap.sailing.gwt.ui.shared.EventBaseDTO;
import com.sap.sailing.gwt.ui.shared.EventDTO;
import com.sap.sailing.gwt.ui.shared.FileStorageServiceDTO;
import com.sap.sailing.gwt.ui.shared.FileStorageServicePropertyErrorsDTO;
import com.sap.sailing.gwt.ui.shared.GPSFixDTO;
import com.sap.sailing.gwt.ui.shared.LeaderboardGroupDTO;
import com.sap.sailing.gwt.ui.shared.LeaderboardSearchResultDTO;
@@ -79,11 +77,14 @@ import com.sap.sailing.gwt.ui.shared.WindInfoForRaceDTO;
import com.sap.sse.common.Util;
import com.sap.sse.common.search.KeywordQuery;
import com.sap.sse.gwt.client.BuildVersionRetriever;
import com.sap.sse.gwt.client.filestorage.FileStorageManagementGwtServiceAsync;
import com.sap.sse.gwt.shared.filestorage.FileStorageServiceDTO;
import com.sap.sse.gwt.shared.filestorage.FileStorageServicePropertyErrorsDTO;
/**
* The async counterpart of {@link SailingService}
*/
public interface SailingServiceAsync extends BuildVersionRetriever {
public interface SailingServiceAsync extends BuildVersionRetriever, FileStorageManagementGwtServiceAsync {
void getRegattas(AsyncCallback<List<RegattaDTO>> callback);
@@ -1131,10 +1131,9 @@ public interface StringMessages extends com.sap.sse.gwt.client.StringMessages {
String createNewEvent();
String noFleetsDefined();
String successfullyCreatedRegattas();
String active();
String errorTryingToRegisterRacesForTracking(String raceNames, String message);
String errorDeterminingPolarAvailability(String raceName, String message);
String error();
String setAsActive();
String fileStorage();
String active();
}
@@ -1107,16 +1107,14 @@ showXYDiagram=Show x-y-diagram
xyDiagram=x-y-Diagram
boatSpeed=Boat Speed
confidence=Confidence
createDefaultSettingsForAllRegattas=Create default settings for all regattas...
noOverallEventSelected=No overall event selected...
errorTryingToCreateNewEvent=Error trying to create new event {0}: {1}
createNewEvent=Create New Event
noFleetsDefined=No fleets defined.
successfullyCreatedRegattas=Successfully created regattas
active=Active
errorTryingToRegisterRacesForTracking=Error trying to register races {0} for tracking: {1}. Check live/stored URI syntax.
errorDeterminingPolarAvailability=Error determining availability of polar / VPP data for race {0}: {1}
error=Error
setAsActive=Set as active
fileStorage=File Storage
fileStorage=File Storage
active=Active
@@ -1103,9 +1103,8 @@ errorTryingToCreateNewEvent=Fehler beim Anlegen einer neuen Veranstaltung {0}: {
createNewEvent=Neue Veranstaltung anlegen
noFleetsDefined=Keine Gruppen definiert.
successfullyCreatedRegattas=Regatten erfolgreich angelegt
active=Aktiv
errorTryingToRegisterRacesForTracking=Fehler beim Versuch, die Wettfahrten {0} zum Tracking zu registrieren: {1}. Live/stored URI syntax prüfen.
errorDeterminingPolarAvailability=Fehler bei der Verfügbarkeitsprüfung für Polardaten für Wettfahrt {0}: {1}
error=Fehler
setAsActive=Aktiv setzen
fileStorage=Datei Speicherung
fileStorage=Datei Speicherung
active=Aktiv
@@ -1051,9 +1051,8 @@ errorTryingToCreateNewEvent=Error trying to create new event {0}: {1}
createNewEvent=Create New Event
noFleetsDefined=No fleets defined.
successfullyCreatedRegattas=Successfully created regattas
active=Active
errorTryingToRegisterRacesForTracking=Error trying to register races {0} for tracking: {1}. Check live/stored URI syntax.
errorDeterminingPolarAvailability=Error determining availability of polar / VPP data for race {0}: {1}
error=Error
setAsActive=Set as active
fileStorage=File Storage
fileStorage=File Storage
active=Active
@@ -6,12 +6,12 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import com.sap.sailing.gwt.ui.shared.FileStorageServicePropertyDTO;
import com.sap.sailing.gwt.ui.shared.FileStorageServicePropertyErrorsDTO;
import com.sap.sailing.gwt.ui.shared.FileStorageServiceDTO;
import com.sap.sse.filestorage.FileStorageService;
import com.sap.sse.filestorage.InvalidPropertiesException;
import com.sap.sse.filestorage.FileStorageServiceProperty;
import com.sap.sse.gwt.shared.filestorage.FileStorageServiceDTO;
import com.sap.sse.gwt.shared.filestorage.FileStorageServicePropertyDTO;
import com.sap.sse.gwt.shared.filestorage.FileStorageServicePropertyErrorsDTO;
public class FileStorageServiceDTOUtils {
public static FileStorageServicePropertyDTO convert(FileStorageServiceProperty p) {
@@ -276,8 +276,6 @@ import com.sap.sailing.gwt.ui.shared.DeviceIdentifierDTO;
import com.sap.sailing.gwt.ui.shared.DeviceMappingDTO;
import com.sap.sailing.gwt.ui.shared.EventBaseDTO;
import com.sap.sailing.gwt.ui.shared.EventDTO;
import com.sap.sailing.gwt.ui.shared.FileStorageServiceDTO;
import com.sap.sailing.gwt.ui.shared.FileStorageServicePropertyErrorsDTO;
import com.sap.sailing.gwt.ui.shared.GPSFixDTO;
import com.sap.sailing.gwt.ui.shared.GateDTO;
import com.sap.sailing.gwt.ui.shared.LeaderboardGroupBaseDTO;
@@ -423,6 +421,8 @@ import com.sap.sse.common.search.KeywordQuery;
import com.sap.sse.common.search.Result;
import com.sap.sse.filestorage.FileStorageService;
import com.sap.sse.filestorage.InvalidPropertiesException;
import com.sap.sse.gwt.shared.filestorage.FileStorageServiceDTO;
import com.sap.sse.gwt.shared.filestorage.FileStorageServicePropertyErrorsDTO;
import com.sap.sse.replication.OperationWithResult;
import com.sap.sse.replication.ReplicationFactory;
import com.sap.sse.replication.ReplicationMasterDescriptor;
@@ -48,8 +48,7 @@ Require-Bundle: com.sap.sailing.domain,
com.sap.sailing.server.gateway.serialization.shared.android,
com.sap.sse.shared.android,
com.sap.sse.filestorage,
com.sun.jersey.contribs.jersey-multipart;bundle-version="1.17.1",
com.sap.sse.osgi
com.sun.jersey.contribs.jersey-multipart;bundle-version="1.17.1"
Bundle-ClassPath: .
Web-ContextPath: /sailingserver
Export-Package: com.sap.sailing.server.gateway,
@@ -100,6 +100,9 @@ public class CompetitorsResource extends AbstractSailingServerResource {
return Response.ok(json, MediaType.APPLICATION_JSON).build();
}
/**
* Expects the HTTP header {@code Content-Length} to be set.
*/
//
// example for testing upload:
// $ curl -v -H "Content-Type:image/jpeg" \
@@ -31,8 +31,7 @@ Require-Bundle: com.sap.sailing.domain,
com.sap.sse,
com.sap.sailing.server.gateway.serialization.shared.android,
com.sap.sse.shared.android,
com.sap.sse.filestorage,
com.sap.sse.osgi
com.sap.sse.filestorage
Bundle-ClassPath: .
Export-Package: com.sap.sailing.server,
com.sap.sailing.server.impl;
@@ -2,33 +2,45 @@ package com.sap.sse.common;
import java.util.Set;
/**
* Manages a set of services implementing {@code ServiceType}. Each of these services provides similar functionality
* (e.g. a storage service), but for a different {@code type} of input/output (e.g. storage for competitors or GPS
* fixes).
*
* Methods exist for {@link #findService(String) finding a service for a certain type}, or {@link #findAllServices()
* finding all services} that implement {@code ServiceType}.
*
* An implementation of this interface might e.g. be backed by the OSGi service registry. For that case, this
* OSGi-agnostic interface allows such a {@code TypeBasedServiceFinder} object to be introduced in contexts that are not
* OSGi-aware, and also allows for easier mocking/dummy implementations in unit testing.
*
* @author Fredrik Teschke
*
* @param <ServiceType> Specifies desired the service interface
* @param <ServiceType>
* Specifies desired the service interface
*/
public interface TypeBasedServiceFinder<ServiceType> {
public static final String TYPE = "type";
/**
* Find a service that implements the <ServiceType> interface for the specified {@code type}
* of object (e.g. type of a {@link GPSFix}).
* @param type A {@link String} that specifies for which type the service should be registered
* @throws NoCorrespondingServiceRegisteredException Thrown, if no service is registered for this type.
* Find a service that implements the <ServiceType> interface for the specified {@code type} of object (e.g. type of
* a {@link GPSFix}).
*
* @param type
* A {@link String} that specifies for which type the service should be registered
* @throws NoCorrespondingServiceRegisteredException
* Thrown, if no service is registered for this type.
*/
ServiceType findService(String type) throws NoCorrespondingServiceRegisteredException;
Set<ServiceType> findAllServices();
/**
* Sets a fallback service (optional), that is used if no service is registered for a {@code type}.
* This should be a generic service, that can deal with any {@code type}, and provides a
* "better-than-nothing" implementation, which will be returned instead of throwing a
* {@link NoCorrespondingServiceRegisteredException}.
* Sets a fallback service (optional), that is used if no service is registered for a {@code type}. This should be a
* generic service, that can deal with any {@code type}, and provides a "better-than-nothing" implementation, which
* will be returned instead of throwing a {@link NoCorrespondingServiceRegisteredException}.
* <p>
* This method does not need to be implemented, but can remain a stub, if no fallback behaviour
* is desired.
* This method does not need to be implemented, but can remain a stub, if no fallback behaviour is desired.
*/
void setFallbackService(ServiceType fallback);
}
-7
View File
@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
-28
View File
@@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.sap.sse.gateway</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
@@ -1,7 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
@@ -1,3 +0,0 @@
eclipse.preferences.version=1
pluginProject.extensions=false
resolve.requirebundle=false
@@ -1,15 +0,0 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Gateway
Bundle-SymbolicName: com.sap.sse.gateway
Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: SAP
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: javax.servlet;version="3.1.0",
javax.servlet.http;version="3.1.0",
org.osgi.framework;version="1.8.0",
org.osgi.util.tracker;version="1.5.1"
Require-Bundle: com.sap.sse.common,
com.sap.sse
Export-Package: com.sap.sse.gateway
Bundle-ActivationPolicy: lazy
@@ -1,4 +0,0 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.
-12
View File
@@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>root</artifactId>
<groupId>com.sap.sailing</groupId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>com.sap.sse.gateway</artifactId>
<packaging>eclipse-plugin</packaging>
</project>
@@ -0,0 +1,3 @@
eclipse.preferences.version=1
encoding//src/com/sap/sse/gwt/client/controls/filestorage/StringMessages_de.properties=UTF-8
encoding//src/com/sap/sse/gwt/client/controls/filestorage/StringMessages_ru.properties=UTF-8
+4 -1
View File
@@ -20,13 +20,16 @@ Export-Package: com.sap.sse.gwt.client,
com.sap.sse.gwt.client.controls,
com.sap.sse.gwt.client.controls.busyindicator,
com.sap.sse.gwt.client.controls.carousel,
com.sap.sse.gwt.client.controls.filestorage,
com.sap.sse.gwt.client.controls.listedit,
com.sap.sse.gwt.client.controls.slider,
com.sap.sse.gwt.client.dialog,
com.sap.sse.gwt.client.event,
com.sap.sse.gwt.client.filestorage,
com.sap.sse.gwt.client.mvp,
com.sap.sse.gwt.client.panels,
com.sap.sse.gwt.client.player,
com.sap.sse.gwt.client.useragent,
com.sap.sse.gwt.server,
com.sap.sse.gwt.shared
com.sap.sse.gwt.shared,
com.sap.sse.gwt.shared.filestorage
@@ -0,0 +1,52 @@
package com.sap.sse.gwt.client.controls;
import com.google.gwt.cell.client.TextInputCell;
import com.google.gwt.core.client.GWT;
import com.google.gwt.safehtml.client.SafeHtmlTemplates;
import com.google.gwt.safehtml.shared.SafeHtml;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
/**
* Allows cycling through text cells in a CellTable using TAB by setting a decent {@code tabIndex} instead of -1.
*
* To use, also set {@code cellTable.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED);}.
*
* @author Fredrik Teschke
*
*/
public class TabbingTextInputCell extends TextInputCell {
interface Template extends SafeHtmlTemplates {
@Template("<input type=\"text\" value=\"{0}\"></input>")
SafeHtml input(String value);
}
private static Template template;
public TabbingTextInputCell() {
super();
if (template == null) {
template = GWT.create(Template.class);
}
}
@Override
/**
* Do everything like the {@link TextInputCell#render() super implementation}, but do not set the {@code tabIndex}.
*/
public void render(com.google.gwt.cell.client.Cell.Context context, String value, SafeHtmlBuilder sb) {
// Get the view data.
Object key = context.getKey();
ViewData viewData = getViewData(key);
if (viewData != null && viewData.getCurrentValue().equals(value)) {
clearViewData(key);
viewData = null;
}
String s = (viewData != null) ? viewData.getCurrentValue() : value;
if (s != null) {
sb.append(template.input(s));
} else {
sb.appendHtmlConstant("<input type=\"text\"></input>");
}
}
}
@@ -1,4 +1,4 @@
package com.sap.sailing.gwt.ui.client.filestorage;
package com.sap.sse.gwt.client.controls.filestorage;
import java.util.ArrayList;
import java.util.Arrays;
@@ -7,7 +7,6 @@ import java.util.List;
import java.util.Map;
import com.google.gwt.cell.client.FieldUpdater;
import com.google.gwt.cell.client.TextInputCell;
import com.google.gwt.core.client.Callback;
import com.google.gwt.event.dom.client.ChangeEvent;
import com.google.gwt.event.dom.client.ChangeHandler;
@@ -15,8 +14,8 @@ import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.cellview.client.CellTable;
import com.google.gwt.user.cellview.client.Column;
import com.google.gwt.user.cellview.client.HasKeyboardSelectionPolicy.KeyboardSelectionPolicy;
import com.google.gwt.user.cellview.client.TextColumn;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.CaptionPanel;
@@ -26,15 +25,25 @@ import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.ListBox;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.view.client.ListDataProvider;
import com.sap.sailing.gwt.ui.client.SailingServiceAsync;
import com.sap.sailing.gwt.ui.client.StringMessages;
import com.sap.sailing.gwt.ui.shared.FileStorageServiceDTO;
import com.sap.sailing.gwt.ui.shared.FileStorageServicePropertyDTO;
import com.sap.sailing.gwt.ui.shared.FileStorageServicePropertyErrorsDTO;
import com.sap.sse.gwt.client.ErrorReporter;
import com.sap.sse.gwt.client.controls.TabbingTextInputCell;
import com.sap.sse.gwt.client.filestorage.FileStorageManagementGwtServiceAsync;
import com.sap.sse.gwt.shared.filestorage.FileStorageServiceDTO;
import com.sap.sse.gwt.shared.filestorage.FileStorageServicePropertyDTO;
import com.sap.sse.gwt.shared.filestorage.FileStorageServicePropertyErrorsDTO;
/**
* Provides a management interface for {@link FileStorageService}s. Allows choosing which service to use, and setting
* the configuration properties of the available services.
*
* Essentially, this provides a UI for interfacing with the {@link FileStorageManagementService}.
*
* @author Fredrik Teschke
*
*/
public class FileStoragePanel extends FlowPanel {
private final SailingServiceAsync sailingService;
private final StringMessages stringMessages = StringMessages.INSTANCE;
private final FileStorageManagementGwtServiceAsync sailingService;
private final ErrorReporter errorReporter;
private final Label activeServiceLabel;
@@ -48,8 +57,7 @@ public class FileStoragePanel extends FlowPanel {
private final Map<FileStorageServicePropertyDTO, String> perPropertyErrors = new HashMap<>();
private final ListDataProvider<FileStorageServicePropertyDTO> propertiesListDataProvider;
public FileStoragePanel(SailingServiceAsync sailingService, ErrorReporter errorReporter,
StringMessages stringMessages) {
public FileStoragePanel(FileStorageManagementGwtServiceAsync sailingService, ErrorReporter errorReporter) {
this.sailingService = sailingService;
this.errorReporter = errorReporter;
@@ -61,12 +69,12 @@ public class FileStoragePanel extends FlowPanel {
}
});
add(refreshButton);
CaptionPanel activeServicePanel = new CaptionPanel(stringMessages.active());
activeServiceLabel = new Label();
activeServicePanel.add(activeServiceLabel);
add(activeServicePanel);
CaptionPanel editServicePanel = new CaptionPanel(stringMessages.edit());
VerticalPanel editServicePanelContent = new VerticalPanel();
editServicePanel.add(editServicePanelContent);
@@ -78,11 +86,12 @@ public class FileStoragePanel extends FlowPanel {
}
});
editServicePanelContent.add(servicesListBox);
serviceDescriptionLabel = new Label();
editServicePanelContent.add(serviceDescriptionLabel);
propertiesTable = new CellTable<>();
propertiesTable.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED); //allow for default tabbing behaviour
propertiesListDataProvider = new ListDataProvider<>(new ArrayList<FileStorageServicePropertyDTO>());
properties = propertiesListDataProvider.getList();
propertiesListDataProvider.addDataDisplay(propertiesTable);
@@ -95,7 +104,8 @@ public class FileStoragePanel extends FlowPanel {
};
propertiesTable.addColumn(nameColumn, stringMessages.name());
Column<FileStorageServicePropertyDTO, String> inputColumn = new Column<FileStorageServicePropertyDTO, String>(new TextInputCell()) {
Column<FileStorageServicePropertyDTO, String> inputColumn = new Column<FileStorageServicePropertyDTO, String>(
new TabbingTextInputCell()) {
@Override
public String getValue(FileStorageServicePropertyDTO object) {
return object.value;
@@ -126,15 +136,15 @@ public class FileStoragePanel extends FlowPanel {
};
errorColumn.setCellStyleNames("errorLabel");
propertiesTable.addColumn(errorColumn, stringMessages.error());
editServicePanelContent.add(propertiesTable);
propertiesErrorLabel = new Label();
propertiesErrorLabel.setStyleName("errorLabel");
editServicePanelContent.add(propertiesErrorLabel);
editServicePanelContent.add(propertiesErrorLabel);
HorizontalPanel buttonsPanel = new HorizontalPanel();
Button saveAndTestPropertiesButton = new Button(stringMessages.save());
saveAndTestPropertiesButton.addClickHandler(new ClickHandler() {
@Override
@@ -143,7 +153,7 @@ public class FileStoragePanel extends FlowPanel {
}
});
buttonsPanel.add(saveAndTestPropertiesButton);
Button setAsActiveServiceButton = new Button(stringMessages.setAsActive());
setAsActiveServiceButton.addClickHandler(new ClickHandler() {
@Override
@@ -152,11 +162,11 @@ public class FileStoragePanel extends FlowPanel {
}
});
buttonsPanel.add(setAsActiveServiceButton);
editServicePanelContent.add(buttonsPanel);
add(editServicePanel);
refresh();
}
@@ -164,7 +174,13 @@ public class FileStoragePanel extends FlowPanel {
int i = servicesListBox.getSelectedIndex();
return i < 0 ? "" : servicesListBox.getItemText(i);
}
/**
* Test the properties using {@link FileStorageService#testProperties()}, and display global errors and per-property
* errors in the according label and table cells.
*
* @param callback
*/
private void testProperties(final Callback<Void, Void> callback) {
sailingService.testFileStorageServiceProperties(getSelectedServiceName(),
new AsyncCallback<FileStorageServicePropertyErrorsDTO>() {
@@ -184,7 +200,7 @@ public class FileStoragePanel extends FlowPanel {
@Override
public void onFailure(Throwable caught) {
errorReporter.reportError("Could not test properties: " + caught.getMessage());
errorReporter.reportError(stringMessages.couldNotTestProperties() + ": " + caught.getMessage());
}
});
}
@@ -205,18 +221,18 @@ public class FileStoragePanel extends FlowPanel {
@Override
public void onFailure(Throwable caught) {
errorReporter.reportError("Could not set service properties: " + caught.getMessage());
errorReporter.reportError(stringMessages.couldNotSetProperties() + ": " + caught.getMessage());
}
});
}
private void saveAndTestProperties(final Callback<Void, Void> callback) {
saveProperties(new Callback<Void, Void>() {
@Override
public void onSuccess(Void result) {
testProperties(callback);
}
@Override
public void onFailure(Void reason) {
}
@@ -232,17 +248,17 @@ public class FileStoragePanel extends FlowPanel {
public void onSuccess(Void result) {
activeServiceLabel.setText(getSelectedServiceName());
}
@Override
public void onFailure(Throwable caught) {
errorReporter.reportError("Could not set new active service: " + caught.getMessage());
errorReporter.reportError(stringMessages.couldNotSetActiveService() + ": "
+ caught.getMessage());
}
});
}
@Override
public void onFailure(Void reason) {
Window.alert("Cannot activate service with errors");
}
});
@@ -263,7 +279,7 @@ public class FileStoragePanel extends FlowPanel {
private void refresh() {
String oldSelectedService = getSelectedServiceName();
servicesListBox.clear();
servicesListBox.addItem("");
availableServices.clear();
@@ -279,7 +295,7 @@ public class FileStoragePanel extends FlowPanel {
@Override
public void onFailure(Throwable caught) {
errorReporter.reportError("Could not load active file storage service: " + caught.getMessage());
errorReporter.reportError(stringMessages.couldNotLoadActiveService() + ": " + caught.getMessage());
}
});
@@ -294,17 +310,17 @@ public class FileStoragePanel extends FlowPanel {
@Override
public void onFailure(Throwable caught) {
errorReporter.reportError("Could not load available file storage services: " + caught.getMessage());
errorReporter.reportError(stringMessages.couldNotLoadAvailableServices() + ": " + caught.getMessage());
}
});
for (int i=0; i<servicesListBox.getItemCount(); i++) {
for (int i = 0; i < servicesListBox.getItemCount(); i++) {
if (servicesListBox.getItemText(i).equals(oldSelectedService)) {
servicesListBox.setSelectedIndex(i);
}
}
onServiceSelectionChanged();
testProperties(null);
}
}
@@ -0,0 +1,20 @@
package com.sap.sse.gwt.client.controls.filestorage;
import com.google.gwt.core.client.GWT;
public interface StringMessages extends com.sap.sse.gwt.client.StringMessages {
public static StringMessages INSTANCE = GWT.create(StringMessages.class);
String active();
String setAsActive();
String couldNotTestProperties();
String couldNotSetProperties();
String couldNotSetActiveService();
String couldNotLoadActiveService();
String couldNotLoadAvailableServices();
String refresh();
String name();
String value();
String description();
String error();
}
@@ -0,0 +1,22 @@
save=Save
remove=Remove
cancel=Cancel
add=Add
edit=Edit
serverError=An error occurred while attempting to contact the server. Please check your network connection and try again.
close=Close
remoteProcedureCall=Remote Procedure Call
serverReplies=Server replies
errorCommunicatingWithServer=Error communicating with server
active=Active
setAsActive=Set as active
couldNotTestProperties=Could not test properties
couldNotSetProperties=Could not set properties
couldNotSetActiveService=Could not set active service
couldNotLoadActiveService=Could not load active service
couldNotLoadAvailableServices=Could not load available services
refresh=Refresh
name=Name
value=Value
description=Description
error=Error
@@ -0,0 +1,22 @@
save=Sichern
remove=Löschen
cancel=Abbrechen
add=Hinzufügen
edit=Bearbeiten
serverError=Es ist ein Fehler beim Versuch aufgetreten, den Server zu kontaktieren. Bitte Netzwerkverbindung prüfen und erneut versuchen.
close=Schliessen
remoteProcedureCall=Entfernter Prozeduraufruf
serverReplies=Server antwortet
errorCommunicatingWithServer=Fehler bei der Kommunikation mit dem Server
active=Aktiv
setAsActive=Aktiv setzen
couldNotTestProperties=Einstellungen konnten nicht validiert werden
couldNotSetProperties=Einstellungen konnten nicht gesetzt werden
couldNotSetActiveService=Aktive Dienst konnte nicht gesetzt werden
couldNotLoadActiveService=Aktiver Dienst konnte nicht geladen werden
couldNotLoadAvailableServices=Verfügbare Dienste konnten nicht geladen werden
refresh=Aktualisieren
name=Name
value=Wert
description=Beschreibung
error=Fehler
@@ -0,0 +1,22 @@
save=Сохранить
remove=Удалить
cancel=Отмена
add=Добавить
edit=Изменить
serverError=An error occurred while attempting to contact the server. Please check your network connection and try again.
close=Закрыть
remoteProcedureCall=Remote Procedure Call
serverReplies=Server replies
errorCommunicatingWithServer=Error communicating with server
active=Active
setAsActive=Set as active
couldNotTestProperties=Could not test properties
couldNotSetProperties=Could not set properties
couldNotSetActiveService=Could not set active service
couldNotLoadActiveService=Could not load active service
couldNotLoadAvailableServices=Could not load available services
refresh=Обновить
name=Имя
value=Значение
description=Описание
error=Error
@@ -0,0 +1,40 @@
package com.sap.sse.gwt.client.filestorage;
import java.util.Map;
import com.google.gwt.user.client.rpc.RemoteService;
import com.sap.sse.common.NoCorrespondingServiceRegisteredException;
import com.sap.sse.gwt.shared.filestorage.FileStorageServiceDTO;
import com.sap.sse.gwt.shared.filestorage.FileStorageServicePropertyErrorsDTO;
/**
* GWT wrapper for the {@code FileStorageManagementService}. The only implementation currently
* exists in {@code SailingServiceImpl}, ideally this would be pulled out into a separate RPC end point.
* @author Fredrik Teschke
*
*/
public interface FileStorageManagementGwtService extends RemoteService {
FileStorageServiceDTO[] getAvailableFileStorageServices();
/**
* @throws NoCorrespondingServiceRegisteredException service may have disappeared from registry in the meantime
*/
FileStorageServicePropertyErrorsDTO testFileStorageServiceProperties(String serviceName) throws NoCorrespondingServiceRegisteredException;
/**
* @throws NoCorrespondingServiceRegisteredException service may have disappeared from registry in the meantime
*/
void setActiveFileStorageService(String serviceName) throws NoCorrespondingServiceRegisteredException;
/**
* @return may be {@code null}
*/
String getActiveFileStorageServiceName();
/**
* @throws NoCorrespondingServiceRegisteredException service may have disappeared from registry in the meantime
* @throws IllegalArgumentException if the property with name {@code propertyName} doesn't exist for the service
*/
void setFileStorageServiceProperties(String serviceName, Map<String, String> properties);
}
@@ -0,0 +1,23 @@
package com.sap.sse.gwt.client.filestorage;
import java.util.Map;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.sap.sse.gwt.shared.filestorage.FileStorageServiceDTO;
import com.sap.sse.gwt.shared.filestorage.FileStorageServicePropertyErrorsDTO;
public interface FileStorageManagementGwtServiceAsync {
void getActiveFileStorageServiceName(AsyncCallback<String> callback);
void getAvailableFileStorageServices(AsyncCallback<FileStorageServiceDTO[]> callback);
void setActiveFileStorageService(String serviceName, AsyncCallback<Void> callback);
void setFileStorageServiceProperties(String serviceName, Map<String, String> properties,
AsyncCallback<Void> callback);
void testFileStorageServiceProperties(String serviceName,
AsyncCallback<FileStorageServicePropertyErrorsDTO> callback);
}
@@ -1,4 +1,4 @@
package com.sap.sailing.gwt.ui.shared;
package com.sap.sse.gwt.shared.filestorage;
import java.io.Serializable;
@@ -1,4 +1,4 @@
package com.sap.sailing.gwt.ui.shared;
package com.sap.sse.gwt.shared.filestorage;
import java.io.Serializable;
@@ -1,4 +1,4 @@
package com.sap.sailing.gwt.ui.shared;
package com.sap.sse.gwt.shared.filestorage;
import java.io.Serializable;
import java.util.Map;
-7
View File
@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="output" path="bin"/>
</classpath>
-2
View File
@@ -1,2 +0,0 @@
bin
.gwt
-28
View File
@@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.sap.sse.osgi</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
@@ -1,12 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
@@ -1,3 +0,0 @@
eclipse.preferences.version=1
pluginProject.extensions=false
resolve.requirebundle=false
@@ -1,12 +0,0 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: SSE OSGi
Bundle-SymbolicName: com.sap.sse.osgi
Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: SAP
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Export-Package: com.sap.sse.osgi
Require-Bundle: com.sap.sse.common;bundle-version="1.0.0"
Import-Package: org.osgi.framework;version="1.8.0",
org.osgi.util.tracker;version="1.5.1"
-4
View File
@@ -1,4 +0,0 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.
-12
View File
@@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>root</artifactId>
<groupId>com.sap.sailing</groupId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>com.sap.sse.osgi</artifactId>
<packaging>eclipse-plugin</packaging>
</project>
@@ -11,8 +11,7 @@ Export-Package: com.sap.sse.replication,
com.sap.sse.replication.impl
Require-Bundle: com.sap.sse.common,
com.sap.sse.operationaltransformation,
com.sap.sse,
com.sap.sse.gateway
com.sap.sse
Bundle-ClassPath: .
Web-ContextPath: /replication
Import-Package: com.rabbitmq.client;version="2.8.4",
@@ -42,7 +42,7 @@
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.DevMode"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-superDevMode -incremental -war &quot;${project_loc:com.sap.sse.security.ui}&quot; -noserver -remoteUI &quot;${gwt_remote_ui_server_port}:${unique_id}&quot; -logLevel INFO -codeServerPort 9875 -startupUrl /security/ui/Login.html com.sap.sse.security.ui.Login -startupUrl /security/ui/EditProfile.html com.sap.sse.security.ui.EditProfile -startupUrl /security/ui/EmailValidation.html com.sap.sse.security.ui.EmailValidation"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-superDevMode -incremental -war &quot;${project_loc:com.sap.sse.security.ui}&quot; -noserver -remoteUI &quot;${gwt_remote_ui_server_port}:${unique_id}&quot; -logLevel INFO -codeServerPort 9997 -startupUrl /gwt/Home.html com.sap.sse.security.ui.Login -startupUrl /security/ui/EditProfile.html com.sap.sse.security.ui.EditProfile -startupUrl /security/ui/EmailValidation.html com.sap.sse.security.ui.EmailValidation com.sap.sse.security.ui.Login com.sap.sse.security.ui.EditProfile"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="com.sap.sse.security.ui"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms1024m -Xmx3072m"/>
</launchConfiguration>
+6
View File
@@ -6,9 +6,15 @@ Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: SAP
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: com.sap.sse,
com.sap.sse.gateway,
com.sap.sse.osgi,
com.sap.sse.util,
com.sap.sse.util.impl,
com.sap.sse.util.kmeans
Bundle-ActivationPolicy: lazy
Require-Bundle: com.sap.sse.common,
com.sap.sse.shared.android
Import-Package: javax.servlet;version="3.1.0",
javax.servlet.http;version="3.1.0",
org.osgi.framework;version="1.8.0",
org.osgi.util.tracker;version="1.5.1"
-2
View File
@@ -18,7 +18,6 @@
<module>com.sap.sse.common</module>
<module>com.sap.sse.shared.android</module>
<module>com.sap.sse.mongodb</module>
<module>com.sap.sse.gateway</module>
<module>com.sap.sse.gwt</module>
<module>com.sap.sse.gwt.adminconsole</module>
<module>com.sap.sse.datamining</module>
@@ -37,7 +36,6 @@
<module>com.sap.sse.common.test</module>
<module>com.sap.sse.filestorage</module>
<module>com.sap.sse.filestorage.test</module>
<module>com.sap.sse.osgi</module>
<module>com.sap.sailing.domain.common</module>
<module>com.sap.sailing.domain.shared.android</module>
<module>com.sap.sailing.domain</module>