mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-25 06:58:39 +00:00
move DTOs for file storage to gwt.ui
This commit is contained in:
+4
-4
@@ -55,6 +55,8 @@ 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.FileStoragePropertyErrors;
|
||||
import com.sap.sailing.gwt.ui.shared.GPSFixDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.LeaderboardGroupDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.LeaderboardSearchResultDTO;
|
||||
@@ -88,8 +90,6 @@ 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.filestorage.dto.FileStorageServiceDTO;
|
||||
import com.sap.sse.filestorage.dto.PropertyErrors;
|
||||
|
||||
/**
|
||||
* The client side stub for the RPC service. Usually, when a <code>null</code> date is passed to
|
||||
@@ -583,13 +583,13 @@ public interface SailingService extends RemoteService {
|
||||
* @throws NoCorrespondingServiceRegisteredException service may have disappeared from registry in the meantime
|
||||
* @return only a service with valid properties can be selected for usage
|
||||
*/
|
||||
PropertyErrors testFileStorageServiceProperties(String serviceName) throws NoCorrespondingServiceRegisteredException;
|
||||
FileStoragePropertyErrors testFileStorageServiceProperties(String serviceName) throws NoCorrespondingServiceRegisteredException;
|
||||
|
||||
/**
|
||||
* @throws NoCorrespondingServiceRegisteredException service may have disappeared from registry in the meantime
|
||||
* @return only a service with valid properties can be selected for usage
|
||||
*/
|
||||
PropertyErrors setActiveFileStorageService(String serviceName) throws NoCorrespondingServiceRegisteredException;
|
||||
FileStoragePropertyErrors setActiveFileStorageService(String serviceName) throws NoCorrespondingServiceRegisteredException;
|
||||
|
||||
/**
|
||||
* @return may be {@code null}
|
||||
|
||||
+4
-4
@@ -45,6 +45,8 @@ 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.FileStoragePropertyErrors;
|
||||
import com.sap.sailing.gwt.ui.shared.GPSFixDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.LeaderboardGroupDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.LeaderboardSearchResultDTO;
|
||||
@@ -76,8 +78,6 @@ import com.sap.sailing.gwt.ui.shared.WindDTO;
|
||||
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.filestorage.dto.FileStorageServiceDTO;
|
||||
import com.sap.sse.filestorage.dto.PropertyErrors;
|
||||
import com.sap.sse.gwt.client.BuildVersionRetriever;
|
||||
|
||||
/**
|
||||
@@ -692,9 +692,9 @@ public interface SailingServiceAsync extends BuildVersionRetriever {
|
||||
|
||||
void getAvailableFileStorageServices(AsyncCallback<FileStorageServiceDTO[]> callback);
|
||||
|
||||
void testFileStorageServiceProperties(String serviceName, AsyncCallback<PropertyErrors> callback);
|
||||
void testFileStorageServiceProperties(String serviceName, AsyncCallback<FileStoragePropertyErrors> callback);
|
||||
|
||||
void setActiveFileStorageService(String serviceName, AsyncCallback<PropertyErrors> callback);
|
||||
void setActiveFileStorageService(String serviceName, AsyncCallback<FileStoragePropertyErrors> callback);
|
||||
|
||||
void getActiveFileStorageServiceName(AsyncCallback<String> callback);
|
||||
|
||||
|
||||
+22
-22
@@ -27,9 +27,9 @@ import com.google.gwt.user.client.ui.ListBox;
|
||||
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.sse.filestorage.dto.FileStorageServiceDTO;
|
||||
import com.sap.sse.filestorage.dto.PropertyDTO;
|
||||
import com.sap.sse.filestorage.dto.PropertyErrors;
|
||||
import com.sap.sailing.gwt.ui.shared.FileStoragePropertyDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.FileStorageServiceDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.FileStoragePropertyErrors;
|
||||
import com.sap.sse.gwt.client.ErrorReporter;
|
||||
|
||||
public class FileStoragePanel extends FlowPanel {
|
||||
@@ -38,12 +38,12 @@ public class FileStoragePanel extends FlowPanel {
|
||||
|
||||
private final Label activeServiceLabel;
|
||||
private final ListBox servicesListBox;
|
||||
private CellTable<PropertyDTO> propertiesTable;
|
||||
private CellTable<FileStoragePropertyDTO> propertiesTable;
|
||||
private final Label serviceDescriptionLabel;
|
||||
|
||||
private final List<PropertyDTO> properties = new ArrayList<>();
|
||||
private final List<FileStoragePropertyDTO> properties = new ArrayList<>();
|
||||
private final Map<String, FileStorageServiceDTO> availableServices = new HashMap<>();
|
||||
private final Map<PropertyDTO, String> perPropertyErros = new HashMap<>();
|
||||
private final Map<FileStoragePropertyDTO, String> perPropertyErros = new HashMap<>();
|
||||
|
||||
public FileStoragePanel(SailingServiceAsync sailingService, ErrorReporter errorReporter,
|
||||
StringMessages stringMessages) {
|
||||
@@ -78,42 +78,42 @@ public class FileStoragePanel extends FlowPanel {
|
||||
editServicePanel.add(serviceDescriptionLabel);
|
||||
|
||||
propertiesTable = new CellTable<>();
|
||||
ListDataProvider<PropertyDTO> propertiesListDataProvider = new ListDataProvider<>(properties);
|
||||
ListDataProvider<FileStoragePropertyDTO> propertiesListDataProvider = new ListDataProvider<>(properties);
|
||||
propertiesListDataProvider.addDataDisplay(propertiesTable);
|
||||
|
||||
TextColumn<PropertyDTO> nameColumn = new TextColumn<PropertyDTO>() {
|
||||
TextColumn<FileStoragePropertyDTO> nameColumn = new TextColumn<FileStoragePropertyDTO>() {
|
||||
@Override
|
||||
public String getValue(PropertyDTO p) {
|
||||
public String getValue(FileStoragePropertyDTO p) {
|
||||
return p.name;
|
||||
}
|
||||
};
|
||||
propertiesTable.addColumn(nameColumn, stringMessages.name());
|
||||
|
||||
Column<PropertyDTO, String> inputColumn = new Column<PropertyDTO, String>(new TextInputCell()) {
|
||||
Column<FileStoragePropertyDTO, String> inputColumn = new Column<FileStoragePropertyDTO, String>(new TextInputCell()) {
|
||||
@Override
|
||||
public String getValue(PropertyDTO object) {
|
||||
public String getValue(FileStoragePropertyDTO object) {
|
||||
return object.value;
|
||||
}
|
||||
};
|
||||
inputColumn.setFieldUpdater(new FieldUpdater<PropertyDTO, String>() {
|
||||
inputColumn.setFieldUpdater(new FieldUpdater<FileStoragePropertyDTO, String>() {
|
||||
@Override
|
||||
public void update(int index, PropertyDTO object, String value) {
|
||||
public void update(int index, FileStoragePropertyDTO object, String value) {
|
||||
object.value = value;
|
||||
}
|
||||
});
|
||||
propertiesTable.addColumn(inputColumn, stringMessages.value());
|
||||
|
||||
TextColumn<PropertyDTO> descriptionColumn = new TextColumn<PropertyDTO>() {
|
||||
TextColumn<FileStoragePropertyDTO> descriptionColumn = new TextColumn<FileStoragePropertyDTO>() {
|
||||
@Override
|
||||
public String getValue(PropertyDTO p) {
|
||||
public String getValue(FileStoragePropertyDTO p) {
|
||||
return p.description;
|
||||
}
|
||||
};
|
||||
propertiesTable.addColumn(descriptionColumn, stringMessages.description());
|
||||
|
||||
TextColumn<PropertyDTO> errorColumn = new TextColumn<PropertyDTO>() {
|
||||
TextColumn<FileStoragePropertyDTO> errorColumn = new TextColumn<FileStoragePropertyDTO>() {
|
||||
@Override
|
||||
public String getValue(PropertyDTO p) {
|
||||
public String getValue(FileStoragePropertyDTO p) {
|
||||
String error = perPropertyErros.get(p);
|
||||
return error == null ? "" : error;
|
||||
}
|
||||
@@ -153,7 +153,7 @@ public class FileStoragePanel extends FlowPanel {
|
||||
|
||||
private void saveAndTestProperties(final Callback<Void, Void> callback) {
|
||||
Map<String, String> values = new HashMap<String, String>();
|
||||
for (PropertyDTO p : properties) {
|
||||
for (FileStoragePropertyDTO p : properties) {
|
||||
values.put(p.name, p.value);
|
||||
}
|
||||
perPropertyErros.clear();
|
||||
@@ -161,9 +161,9 @@ public class FileStoragePanel extends FlowPanel {
|
||||
@Override
|
||||
public void onSuccess(Void result) {
|
||||
sailingService.testFileStorageServiceProperties(getSelectedServiceName(),
|
||||
new AsyncCallback<PropertyErrors>() {
|
||||
new AsyncCallback<FileStoragePropertyErrors>() {
|
||||
@Override
|
||||
public void onSuccess(PropertyErrors result) {
|
||||
public void onSuccess(FileStoragePropertyErrors result) {
|
||||
if (result != null) {
|
||||
perPropertyErros.putAll(result.perPropertyMessages);
|
||||
}
|
||||
@@ -191,9 +191,9 @@ public class FileStoragePanel extends FlowPanel {
|
||||
saveAndTestProperties(new Callback<Void, Void>() {
|
||||
@Override
|
||||
public void onSuccess(Void result) {
|
||||
sailingService.setActiveFileStorageService(getSelectedServiceName(), new AsyncCallback<PropertyErrors>() {
|
||||
sailingService.setActiveFileStorageService(getSelectedServiceName(), new AsyncCallback<FileStoragePropertyErrors>() {
|
||||
@Override
|
||||
public void onSuccess(PropertyErrors result) {
|
||||
public void onSuccess(FileStoragePropertyErrors result) {
|
||||
refresh();
|
||||
}
|
||||
|
||||
|
||||
+11
-11
@@ -1,4 +1,4 @@
|
||||
package com.sap.sse.filestorage.impl;
|
||||
package com.sap.sailing.gwt.ui.server;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -6,31 +6,31 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.sap.sailing.gwt.ui.shared.FileStoragePropertyDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.FileStoragePropertyErrors;
|
||||
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.Property;
|
||||
import com.sap.sse.filestorage.dto.FileStorageServiceDTO;
|
||||
import com.sap.sse.filestorage.dto.PropertyDTO;
|
||||
import com.sap.sse.filestorage.dto.PropertyErrors;
|
||||
|
||||
public class FileStorageServiceDTOUtils {
|
||||
public static PropertyDTO convert(Property p) {
|
||||
return new PropertyDTO(p.isRequired(), p.getName(), p.getValue(), p.getDescription());
|
||||
public static FileStoragePropertyDTO convert(Property p) {
|
||||
return new FileStoragePropertyDTO(p.isRequired(), p.getName(), p.getValue(), p.getDescription());
|
||||
}
|
||||
|
||||
public static PropertyErrors convert(InvalidPropertiesException e) {
|
||||
Map<PropertyDTO, String> msgs = new HashMap<>();
|
||||
public static FileStoragePropertyErrors convert(InvalidPropertiesException e) {
|
||||
Map<FileStoragePropertyDTO, String> msgs = new HashMap<>();
|
||||
for (Entry<Property, String> entry : e.getPerPropertyMessage().entrySet()) {
|
||||
msgs.put(convert(entry.getKey()), entry.getValue());
|
||||
}
|
||||
return new PropertyErrors(e.getMessage(), msgs);
|
||||
return new FileStoragePropertyErrors(e.getMessage(), msgs);
|
||||
}
|
||||
|
||||
public static FileStorageServiceDTO convert(FileStorageService s) {
|
||||
List<PropertyDTO> pDtos = new ArrayList<>();
|
||||
List<FileStoragePropertyDTO> pDtos = new ArrayList<>();
|
||||
for (Property p : s.getProperties()) {
|
||||
pDtos.add(convert(p));
|
||||
}
|
||||
return new FileStorageServiceDTO(s.getName(), s.getDescription(), pDtos.toArray(new PropertyDTO[0]));
|
||||
return new FileStorageServiceDTO(s.getName(), s.getDescription(), pDtos.toArray(new FileStoragePropertyDTO[0]));
|
||||
}
|
||||
}
|
||||
+4
-5
@@ -305,6 +305,8 @@ import com.sap.sailing.gwt.ui.shared.RegattaDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.RegattaOverviewEntryDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.RegattaScoreCorrectionDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.RegattaScoreCorrectionDTO.ScoreCorrectionEntryDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.FileStorageServiceDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.FileStoragePropertyErrors;
|
||||
import com.sap.sailing.gwt.ui.shared.RemoteSailingServerReferenceDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.ReplicaDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.ReplicationMasterDTO;
|
||||
@@ -421,9 +423,6 @@ 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.filestorage.dto.FileStorageServiceDTO;
|
||||
import com.sap.sse.filestorage.dto.PropertyErrors;
|
||||
import com.sap.sse.filestorage.impl.FileStorageServiceDTOUtils;
|
||||
import com.sap.sse.replication.OperationWithResult;
|
||||
import com.sap.sse.replication.ReplicationFactory;
|
||||
import com.sap.sse.replication.ReplicationMasterDescriptor;
|
||||
@@ -5448,7 +5447,7 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
|
||||
}
|
||||
|
||||
@Override
|
||||
public PropertyErrors testFileStorageServiceProperties(String serviceName) {
|
||||
public FileStoragePropertyErrors testFileStorageServiceProperties(String serviceName) {
|
||||
try {
|
||||
getFileStorageService(serviceName).testProperties();
|
||||
} catch (InvalidPropertiesException e) {
|
||||
@@ -5458,7 +5457,7 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
|
||||
}
|
||||
|
||||
@Override
|
||||
public PropertyErrors setActiveFileStorageService(String serviceName) {
|
||||
public FileStoragePropertyErrors setActiveFileStorageService(String serviceName) {
|
||||
try {
|
||||
getService().getFileStorageManagementService().setActiveFileStorageService(getFileStorageService(serviceName));
|
||||
} catch (InvalidPropertiesException e) {
|
||||
|
||||
+4
-4
@@ -1,8 +1,8 @@
|
||||
package com.sap.sse.filestorage.dto;
|
||||
package com.sap.sailing.gwt.ui.shared;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class PropertyDTO implements Serializable {
|
||||
public class FileStoragePropertyDTO implements Serializable {
|
||||
private static final long serialVersionUID = -2721807793068803143L;
|
||||
public boolean isRequired;
|
||||
public String name;
|
||||
@@ -10,10 +10,10 @@ public class PropertyDTO implements Serializable {
|
||||
public String description;
|
||||
|
||||
// for GWT
|
||||
PropertyDTO() {
|
||||
FileStoragePropertyDTO() {
|
||||
}
|
||||
|
||||
public PropertyDTO(boolean isRequired, String name, String value, String description) {
|
||||
public FileStoragePropertyDTO(boolean isRequired, String name, String value, String description) {
|
||||
this.isRequired = isRequired;
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package com.sap.sailing.gwt.ui.shared;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
public class FileStoragePropertyErrors implements Serializable {
|
||||
private static final long serialVersionUID = -7328897153875728802L;
|
||||
public Map<FileStoragePropertyDTO, String> perPropertyMessages;
|
||||
public String message;
|
||||
|
||||
// for GWT
|
||||
FileStoragePropertyErrors() {
|
||||
}
|
||||
|
||||
public FileStoragePropertyErrors(String message, Map<FileStoragePropertyDTO, String> perPropertyMessages) {
|
||||
this.message = message;
|
||||
this.perPropertyMessages = perPropertyMessages;
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
package com.sap.sse.filestorage.dto;
|
||||
package com.sap.sailing.gwt.ui.shared;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@@ -6,13 +6,13 @@ public class FileStorageServiceDTO implements Serializable {
|
||||
private static final long serialVersionUID = 6101940297792100418L;
|
||||
public String name;
|
||||
public String description;
|
||||
public PropertyDTO[] properties;
|
||||
public FileStoragePropertyDTO[] properties;
|
||||
|
||||
// for GWT
|
||||
FileStorageServiceDTO() {
|
||||
}
|
||||
|
||||
public FileStorageServiceDTO(String name, String description, PropertyDTO... properties) {
|
||||
public FileStorageServiceDTO(String name, String description, FileStoragePropertyDTO... properties) {
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
this.properties = properties;
|
||||
-2
@@ -34,8 +34,6 @@
|
||||
<inherits name="com.sap.sse.security.ui.LoginPanel" />
|
||||
<inherits name="com.sap.sse.Security" />
|
||||
|
||||
<inherits name="com.sap.sse.filestorage.FileStorage" />
|
||||
|
||||
<!-- Fancy DateTimePicker (without the rest of Bootstrap!) -->
|
||||
<!-- GWT-Bootstrap License: Apache License, Version 2.0 -->
|
||||
<inherits name="com.github.gwtbootstrap.BootstrapNoResources" />
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="src" path="resources"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
||||
@@ -6,7 +6,6 @@ Bundle-Version: 1.0.0.qualifier
|
||||
Bundle-Vendor: SAP
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
|
||||
Export-Package: com.sap.sse.filestorage,
|
||||
com.sap.sse.filestorage.dto,
|
||||
com.sap.sse.filestorage.impl,
|
||||
com.sap.sse.filestorage.testsupport
|
||||
Import-Package: com.sap.sse.osgi,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
source.. = src/,\
|
||||
resources/
|
||||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.4.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.4.0/distro-source/core/src/gwt-module.dtd">
|
||||
<module>
|
||||
<source path='dto'/>
|
||||
</module>
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.sap.sse.filestorage.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
public class PropertyErrors implements Serializable {
|
||||
private static final long serialVersionUID = -7328897153875728802L;
|
||||
public Map<PropertyDTO, String> perPropertyMessages;
|
||||
public String message;
|
||||
|
||||
// for GWT
|
||||
PropertyErrors() {
|
||||
}
|
||||
|
||||
public PropertyErrors(String message, Map<PropertyDTO, String> perPropertyMessages) {
|
||||
this.message = message;
|
||||
this.perPropertyMessages = perPropertyMessages;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user