mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-16 07:10:48 +00:00
Merge branch 'master' into permission-vertical
Conflicts: java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/ui/server/DataMiningServiceImpl.java java/com.sap.sse.gwt/src/com/sap/sse/gwt/client/StringMessages.java java/com.sap.sse.gwt/src/com/sap/sse/gwt/client/StringMessages.properties java/com.sap.sse.gwt/src/com/sap/sse/gwt/client/StringMessages_de.properties
This commit is contained in:
commit
2bd2a2a0b7
23 files changed
+827
-16
No files matched your search
+10
-6
@@ -554,16 +554,20 @@ public class CandidateFinderImpl implements CandidateFinder {
|
||||
new ArrayList<Candidate>(), new ArrayList<Candidate>());
|
||||
TreeSet<GPSFix> affectedFixes = new TreeSet<GPSFix>(comp);
|
||||
GPSFixTrack<Competitor, GPSFixMoving> track = race.getTrack(c);
|
||||
for (GPSFix fix : fixes) {
|
||||
for (GPSFixMoving fix : fixes) {
|
||||
if (timeRangeForValidCandidates.getTimeRangeOrNull() != null && timeRangeForValidCandidates.getTimeRangeOrNull().includes(fix.getTimePoint())) {
|
||||
affectedFixes.add(fix);
|
||||
GPSFix fixBefore;
|
||||
GPSFix fixAfter;
|
||||
GPSFix fixBefore = null;
|
||||
GPSFix fixAfter = null;
|
||||
final boolean fixIsValid;
|
||||
track.lockForRead();
|
||||
try {
|
||||
TimePoint timePoint = fix.getTimePoint();
|
||||
fixBefore = track.getLastFixBefore(timePoint);
|
||||
fixAfter = track.getFirstFixAfter(timePoint);
|
||||
fixIsValid = track.isValid(fix);
|
||||
if (fixIsValid) {
|
||||
TimePoint t = fix.getTimePoint();
|
||||
fixBefore = track.getLastFixBefore(t);
|
||||
fixAfter = track.getFirstFixAfter(t);
|
||||
}
|
||||
} finally {
|
||||
track.unlockAfterRead();
|
||||
}
|
||||
|
||||
+7
-6
@@ -8,22 +8,23 @@
|
||||
<ul class="bulletList">
|
||||
<li>Searching for phrases containing whitespace characters with double quotes such as "Tobias Schadewaldt" will now work
|
||||
across a distributed server and event landscape.</li>
|
||||
<li>A column showing the used boat can now be shown for each extended race column in leaderboards with multiple races.
|
||||
This new column is activated per default, if the boats change between races. </li>
|
||||
<li>A column showing the used boat can now be shown for each extended race column in leaderboards with multiple races.
|
||||
This new column is activated per default, if the boats change between races. </li>
|
||||
<li>It is now possible to store and load queries in <tt>DataMining.html</tt>. Such queries are saved per user.</li>
|
||||
</ul>
|
||||
|
||||
<h5 class="articleSubheadline">September 2018</h5>
|
||||
<ul class="bulletList">
|
||||
<li>In <tt>RaceBoard.html</tt> is a new feature available which allows users to create tags consisting of a title
|
||||
and optional comment and/or image per race. These tags can be saved visible only for the creating user or for everbody
|
||||
(requiring special permissions) and can be used to mark interesting situations during a race. Tag buttons allow users to
|
||||
save frequently used tags as a preset which can be used quckily and do not require repeating input of the same tag.
|
||||
and optional comment and/or image per race. These tags can be saved visible only for the creating user or for everybody
|
||||
(requiring special permissions) and can be used to mark interesting situations during a race. Tag buttons allow users to
|
||||
save frequently used tags as a preset which can be used quickly and do not require repeating input of the same tag.
|
||||
Those tags and their comments are also used in order to find the containing leaderboard via the global search.</li>
|
||||
</ul>
|
||||
|
||||
<h5 class="articleSubheadline">August 2018</h5>
|
||||
<ul class="bulletList">
|
||||
<li>The windstreamlets are now colored dynamically according to the wind fields maximum and minimum wind speed.</li>
|
||||
<li>The windstreamlets are now colored dynamically according to the wind fields maximum and minimum wind speed.</li>
|
||||
<li>Changes of <tt>DataMining.html</tt>
|
||||
<ul class="bulletList">
|
||||
<li>The currently selected result tab will be remembered when a query is run. It is now possible
|
||||
|
||||
+3
@@ -90,6 +90,9 @@ public class DataMiningEntryPoint extends AbstractSailingEntryPoint {
|
||||
queryRunner = new SimpleQueryRunner(null, null, session, dataMiningService, DataMiningEntryPoint.this,
|
||||
queryDefinitionProvider, resultsPresenter);
|
||||
queryDefinitionProvider.addControl(queryRunner.getEntryWidget());
|
||||
StoredDataMiningQueryDataProvider dataProvider = new StoredDataMiningQueryDataProvider(
|
||||
queryDefinitionProvider, dataMiningService, queryRunner);
|
||||
queryDefinitionProvider.addControl(new StoredDataMiningQueryPanel(dataProvider));
|
||||
/*
|
||||
* Running queries automatically when they've been changed is currently unnecessary, if not even
|
||||
* counterproductive. This removes the query runner settings to prevent that the user can enable the
|
||||
|
||||
+170
@@ -0,0 +1,170 @@
|
||||
package com.sap.sailing.gwt.ui.datamining;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.google.gwt.core.shared.GWT;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.sap.sse.datamining.shared.dto.StatisticQueryDefinitionDTO;
|
||||
import com.sap.sse.datamining.shared.dto.StoredDataMiningQueryDTO;
|
||||
import com.sap.sse.datamining.shared.impl.dto.StoredDataMiningQueryDTOImpl;
|
||||
import com.sap.sse.datamining.ui.client.DataMiningServiceAsync;
|
||||
import com.sap.sse.datamining.ui.client.QueryRunner;
|
||||
import com.sap.sse.datamining.ui.client.selection.QueryDefinitionProviderWithControls;
|
||||
|
||||
/**
|
||||
* Data provider and presenter for {@link StoredDataMiningQueryPanel}. holds the {@link #queryDefinitions} and handles
|
||||
* the backend calls to find/load/store/remove stored queries.
|
||||
*/
|
||||
public class StoredDataMiningQueryDataProvider {
|
||||
private final Set<StoredDataMiningQueryDTO> queryDefinitions = new HashSet<>();
|
||||
|
||||
private final QueryDefinitionProviderWithControls queryDefinitionProvider;
|
||||
private final DataMiningServiceAsync dataMiningService;
|
||||
private final QueryRunner queryRunner;
|
||||
|
||||
private StoredDataMiningQueryPanel uiPanel;
|
||||
|
||||
public StoredDataMiningQueryDataProvider(QueryDefinitionProviderWithControls queryDefinitionProvider,
|
||||
DataMiningServiceAsync dataMiningService, QueryRunner queryRunner) {
|
||||
this.queryDefinitionProvider = queryDefinitionProvider;
|
||||
this.dataMiningService = dataMiningService;
|
||||
this.queryRunner = queryRunner;
|
||||
}
|
||||
|
||||
/** @return the query currently selected in the query definition provider. */
|
||||
public StatisticQueryDefinitionDTO getCurrentQuery() {
|
||||
return queryDefinitionProvider.getQueryDefinition();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new stored query with the {@link name} or updates the stored query if it already exists with the new
|
||||
* {@link #query}.
|
||||
*
|
||||
* @return true, if stored query was present and this is an update<br/>
|
||||
* false, if a new stored query was created
|
||||
*/
|
||||
public boolean addOrUpdateQuery(String name, StatisticQueryDefinitionDTO query) {
|
||||
Optional<StoredDataMiningQueryDTO> findByName = findByName(name);
|
||||
|
||||
StoredDataMiningQueryDTO storedQuery;
|
||||
boolean update;
|
||||
|
||||
if (findByName.isPresent()) {
|
||||
// update if present
|
||||
StoredDataMiningQueryDTO existingQuery = findByName.get();
|
||||
storedQuery = new StoredDataMiningQueryDTOImpl(name, existingQuery.getId(), query);
|
||||
update = true;
|
||||
} else {
|
||||
// create if new
|
||||
storedQuery = new StoredDataMiningQueryDTOImpl(name, UUID.randomUUID(), query);
|
||||
update = false;
|
||||
}
|
||||
|
||||
dataMiningService.updateOrCreateStoredQuery(storedQuery, new AsyncCallback<StoredDataMiningQueryDTO>() {
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
GWT.log(caught.getMessage(), caught);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(StoredDataMiningQueryDTO result) {
|
||||
queryDefinitions.remove(result);
|
||||
queryDefinitions.add(result);
|
||||
updateUi();
|
||||
}
|
||||
});
|
||||
return update;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a query by {@link #name}.
|
||||
*
|
||||
* @return true, if a stored query with the {@link #name} existed<br/>
|
||||
* false, if no query with the corresponding name could be found
|
||||
*/
|
||||
public boolean removeQuery(String name) {
|
||||
Optional<StoredDataMiningQueryDTO> query = findByName(name);
|
||||
if (query.isPresent()) {
|
||||
dataMiningService.removeStoredQuery(query.get(), new AsyncCallback<StoredDataMiningQueryDTO>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
GWT.log(caught.getMessage(), caught);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(StoredDataMiningQueryDTO result) {
|
||||
queryDefinitions.remove(result);
|
||||
updateUi();
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Applies the stored data mining with the {@link #name} to the query definition provider and the query runner
|
||||
* without executing it.
|
||||
*
|
||||
* @return true, if a stored query with the {@link #name} existed<br/>
|
||||
* false, if no query with the corresponding name could be found
|
||||
*/
|
||||
public boolean applyQuery(String name) {
|
||||
Optional<StoredDataMiningQueryDTO> query = findByName(name);
|
||||
if (query.isPresent()) {
|
||||
queryDefinitionProvider.applyQueryDefinition(query.get().getQuery());
|
||||
queryRunner.queryDefinitionChanged(query.get().getQuery());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Sets the associated {@link StoredDataMiningQueryPanel} and refreshes the stored named queries to present. */
|
||||
public void setUiPanel(StoredDataMiningQueryPanel uiPanel) {
|
||||
this.uiPanel = uiPanel;
|
||||
refreshQueries();
|
||||
}
|
||||
|
||||
/** Update the oracle in the {@link StoredDataMiningQueryPanel}. */
|
||||
private void updateUi() {
|
||||
if (uiPanel != null) {
|
||||
uiPanel.updateOracle(
|
||||
queryDefinitions.stream().map(StoredDataMiningQueryDTO::getName).collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
|
||||
/** Refresh the stored queries and update the {@link StoredDataMiningQueryPanel}. */
|
||||
private void refreshQueries() {
|
||||
dataMiningService.retrieveStoredQueries(new AsyncCallback<ArrayList<StoredDataMiningQueryDTO>>() {
|
||||
@Override
|
||||
public void onSuccess(ArrayList<StoredDataMiningQueryDTO> result) {
|
||||
queryDefinitions.addAll(result);
|
||||
updateUi();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
GWT.log(caught.getMessage(), caught);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** @return the {@link StoredDataMiningQueryDTO} associated with {@link #name} */
|
||||
private Optional<StoredDataMiningQueryDTO> findByName(final String name) {
|
||||
return queryDefinitions.stream().filter(s -> s.getName().equals(name)).findAny();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true: if {@link #text} is a valid name of a stored query<br/>
|
||||
* false: else
|
||||
*/
|
||||
public boolean containsQueryName(String text) {
|
||||
return findByName(text).isPresent();
|
||||
}
|
||||
}
|
||||
+126
@@ -0,0 +1,126 @@
|
||||
package com.sap.sailing.gwt.ui.datamining;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.event.dom.client.ClickEvent;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.uibinder.client.UiHandler;
|
||||
import com.google.gwt.user.client.ui.Button;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.MultiWordSuggestOracle;
|
||||
import com.google.gwt.user.client.ui.SuggestBox;
|
||||
import com.google.gwt.user.client.ui.SuggestBox.DefaultSuggestionDisplay;
|
||||
import com.google.gwt.user.client.ui.TextBox;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sse.datamining.ui.client.StringMessages;
|
||||
import com.sap.sse.gwt.client.Notification;
|
||||
import com.sap.sse.gwt.client.Notification.NotificationType;
|
||||
|
||||
/**
|
||||
* UI Panel with the three buttons to load, store and remove and the suggest box to select a stored data mining query by
|
||||
* name.
|
||||
*/
|
||||
public class StoredDataMiningQueryPanel extends Composite {
|
||||
|
||||
private static PersistDataMiningQueryPanelUiBinder uiBinder = GWT.create(PersistDataMiningQueryPanelUiBinder.class);
|
||||
|
||||
interface PersistDataMiningQueryPanelUiBinder extends UiBinder<Widget, StoredDataMiningQueryPanel> {
|
||||
}
|
||||
|
||||
@UiField
|
||||
Button saveQueryButtonUi;
|
||||
|
||||
@UiField
|
||||
Button loadQueryButtonUi;
|
||||
|
||||
@UiField
|
||||
Button removeQueryButtonUi;
|
||||
|
||||
@UiField(provided = true)
|
||||
SuggestBox suggestBoxUi;
|
||||
|
||||
private final MultiWordSuggestOracle oracle = new MultiWordSuggestOracle();
|
||||
|
||||
private StoredDataMiningQueryDataProvider dataProvider;
|
||||
|
||||
public StoredDataMiningQueryPanel() {
|
||||
suggestBoxUi = new SuggestBox(oracle, new TextBox(), new DefaultSuggestionDisplay() {
|
||||
@Override
|
||||
public void hideSuggestions() {
|
||||
updateSaveLoadButtons();
|
||||
super.hideSuggestions();
|
||||
}
|
||||
});
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
saveQueryButtonUi.setText(StringMessages.INSTANCE.save());
|
||||
loadQueryButtonUi.setText(StringMessages.INSTANCE.load());
|
||||
removeQueryButtonUi.setText(StringMessages.INSTANCE.remove());
|
||||
suggestBoxUi.getValueBox().getElement().setPropertyString("placeholder",
|
||||
StringMessages.INSTANCE.dataMiningStoredQueryPlaceholder());
|
||||
suggestBoxUi.getValueBox().addClickHandler(e -> suggestBoxUi.showSuggestionList());
|
||||
suggestBoxUi.getValueBox().addKeyUpHandler(e -> updateSaveLoadButtons());
|
||||
suggestBoxUi.getValueBox().addBlurHandler(e -> updateSaveLoadButtons());
|
||||
}
|
||||
|
||||
private void updateSaveLoadButtons() {
|
||||
String text = suggestBoxUi.getValueBox().getText();
|
||||
saveQueryButtonUi.setEnabled(text != null && !"".equals(text.trim()));
|
||||
loadQueryButtonUi.setEnabled(dataProvider.containsQueryName(text));
|
||||
removeQueryButtonUi.setEnabled(dataProvider.containsQueryName(text));
|
||||
}
|
||||
|
||||
public StoredDataMiningQueryPanel(StoredDataMiningQueryDataProvider dataProvider) {
|
||||
this();
|
||||
this.dataProvider = dataProvider;
|
||||
dataProvider.setUiPanel(this);
|
||||
}
|
||||
|
||||
@UiHandler("saveQueryButtonUi")
|
||||
void onSaveClick(ClickEvent e) {
|
||||
String value = suggestBoxUi.getValue().trim();
|
||||
if (dataProvider.addOrUpdateQuery(value, dataProvider.getCurrentQuery())) {
|
||||
Notification.notify(StringMessages.INSTANCE.dataMiningStoredQueryUpdateSuccessful(value),
|
||||
NotificationType.SUCCESS);
|
||||
} else {
|
||||
Notification.notify(
|
||||
StringMessages.INSTANCE.dataMiningStoredQueryCreationSuccessful(value),
|
||||
NotificationType.SUCCESS);
|
||||
}
|
||||
}
|
||||
|
||||
@UiHandler("loadQueryButtonUi")
|
||||
void onLoadClick(ClickEvent e) {
|
||||
if (dataProvider.applyQuery(suggestBoxUi.getValue())) {
|
||||
Notification.notify(StringMessages.INSTANCE.dataMiningStoredQueryLoadedSuccessful(suggestBoxUi.getValue()),
|
||||
NotificationType.SUCCESS);
|
||||
} else {
|
||||
Notification.notify(StringMessages.INSTANCE.dataMiningStoredQueryLoadedFailed(suggestBoxUi.getValue()),
|
||||
NotificationType.ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
@UiHandler("removeQueryButtonUi")
|
||||
void onRemoveClick(ClickEvent e) {
|
||||
if (dataProvider.removeQuery(suggestBoxUi.getValue())) {
|
||||
suggestBoxUi.setValue("");
|
||||
Notification.notify(StringMessages.INSTANCE.dataMiningStoredQueryRemovedSuccessful(suggestBoxUi.getValue()),
|
||||
NotificationType.SUCCESS);
|
||||
} else {
|
||||
Notification.notify(StringMessages.INSTANCE.dataMiningStoredQueryRemovedFailed(suggestBoxUi.getValue()),
|
||||
NotificationType.ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
/** Updates the oracle of the suggest box with the names of the stored queries. */
|
||||
public void updateOracle(Collection<String> collection) {
|
||||
oracle.clear();
|
||||
oracle.addAll(collection);
|
||||
oracle.setDefaultSuggestionsFromText(collection);
|
||||
|
||||
loadQueryButtonUi.setEnabled(!collection.isEmpty());
|
||||
removeQueryButtonUi.setEnabled(!collection.isEmpty());
|
||||
updateSaveLoadButtons();
|
||||
}
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder" xmlns:g="urn:import:com.google.gwt.user.client.ui">
|
||||
<ui:with field="i18n" type="com.sap.sse.datamining.ui.client.StringMessages" />
|
||||
<ui:style>
|
||||
.inline {
|
||||
display: inline-block
|
||||
}
|
||||
.seperator {
|
||||
background-color: gray;
|
||||
height: 1.6666666em;
|
||||
width: 1px;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
</ui:style>
|
||||
<g:HTMLPanel addStyleNames="{style.inline}">
|
||||
<div class="{style.seperator}" />
|
||||
<div class="{style.inline}"><ui:text from='{i18n.loadOrSaveQueries}' /></div>
|
||||
<g:SuggestBox ui:field="suggestBoxUi" />
|
||||
<g:Button ui:field="saveQueryButtonUi" />
|
||||
<g:Button ui:field="loadQueryButtonUi" />
|
||||
<g:Button ui:field="removeQueryButtonUi" />
|
||||
</g:HTMLPanel>
|
||||
</ui:UiBinder>
|
||||
+34
@@ -39,6 +39,7 @@ import com.sap.sse.datamining.shared.GroupKey;
|
||||
import com.sap.sse.datamining.shared.SerializationDummy;
|
||||
import com.sap.sse.datamining.shared.data.QueryResultState;
|
||||
import com.sap.sse.datamining.shared.dto.StatisticQueryDefinitionDTO;
|
||||
import com.sap.sse.datamining.shared.dto.StoredDataMiningQueryDTO;
|
||||
import com.sap.sse.datamining.shared.impl.GenericGroupKey;
|
||||
import com.sap.sse.datamining.shared.impl.PredefinedQueryIdentifier;
|
||||
import com.sap.sse.datamining.shared.impl.dto.AggregationProcessorDefinitionDTO;
|
||||
@@ -50,7 +51,10 @@ import com.sap.sse.datamining.shared.impl.dto.QueryResultDTO;
|
||||
import com.sap.sse.datamining.shared.impl.dto.ReducedDimensionsDTO;
|
||||
import com.sap.sse.datamining.ui.client.DataMiningService;
|
||||
import com.sap.sse.i18n.ResourceBundleStringMessages;
|
||||
import com.sap.sse.security.SecurityService;
|
||||
import com.sap.sse.security.UserStore;
|
||||
import com.sap.sse.security.shared.HasPermissions.DefaultActions;
|
||||
import com.sap.sse.util.ServiceTrackerFactory;
|
||||
|
||||
public class DataMiningServiceImpl extends RemoteServiceServlet implements DataMiningService {
|
||||
private static final long serialVersionUID = -7951930891674894528L;
|
||||
@@ -58,12 +62,21 @@ public class DataMiningServiceImpl extends RemoteServiceServlet implements DataM
|
||||
private final BundleContext context;
|
||||
|
||||
private final ServiceTracker<DataMiningServer, DataMiningServer> dataMiningServerTracker;
|
||||
private final ServiceTracker<SecurityService, SecurityService> securityServiceTracker;
|
||||
private final ServiceTracker<UserStore, UserStore> userStoreServiceTracker;
|
||||
|
||||
private final StoredDataMiningQueryPersister storedDataMiningQueryPersistor;
|
||||
|
||||
private final DataMiningDTOFactory dtoFactory;
|
||||
|
||||
public DataMiningServiceImpl() {
|
||||
context = Activator.getDefault();
|
||||
dataMiningServerTracker = createAndOpenDataMiningServerTracker(context);
|
||||
securityServiceTracker = ServiceTrackerFactory.createAndOpen(context, SecurityService.class);
|
||||
userStoreServiceTracker = ServiceTrackerFactory.createAndOpen(context, UserStore.class);
|
||||
|
||||
storedDataMiningQueryPersistor = new StoredDataMiningQueryPersisterImpl(securityServiceTracker.getService(),
|
||||
userStoreServiceTracker.getService());
|
||||
dtoFactory = new DataMiningDTOFactory();
|
||||
}
|
||||
|
||||
@@ -401,4 +414,25 @@ public class DataMiningServiceImpl extends RemoteServiceServlet implements DataM
|
||||
public SerializationDummy pseudoMethodSoThatSomeClassesAreAddedToTheGWTSerializationPolicy() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<StoredDataMiningQueryDTO> retrieveStoredQueries() {
|
||||
return storedDataMiningQueryPersistor.retrieveStoredQueries();
|
||||
}
|
||||
|
||||
@Override
|
||||
public StoredDataMiningQueryDTO updateOrCreateStoredQuery(StoredDataMiningQueryDTO query) {
|
||||
SecurityUtils.getSubject().checkPermission(
|
||||
SecuredDomainType.DATA_MINING.getStringPermissionForObjects(DefaultActions.UPDATE, query.getName()));
|
||||
SecurityUtils.getSubject().checkPermission(
|
||||
SecuredDomainType.DATA_MINING.getStringPermissionForObjects(DefaultActions.CREATE, query.getName()));
|
||||
return storedDataMiningQueryPersistor.updateOrCreateStoredQuery(query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StoredDataMiningQueryDTO removeStoredQuery(StoredDataMiningQueryDTO query) {
|
||||
SecurityUtils.getSubject().checkPermission(
|
||||
SecuredDomainType.DATA_MINING.getStringPermissionForObjects(DefaultActions.DELETE, query.getName()));
|
||||
return storedDataMiningQueryPersistor.removeStoredQuery(query);
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package com.sap.sailing.gwt.ui.server;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.sap.sse.datamining.shared.dto.StoredDataMiningQueryDTO;
|
||||
|
||||
/** Instances of this class can load, update, create and remove stored data mining queries from the user store. */
|
||||
public interface StoredDataMiningQueryPersister {
|
||||
|
||||
/** @return all {@link StoredDataMiningQueryDTO}s the user has stored in his user store. */
|
||||
ArrayList<StoredDataMiningQueryDTO> retrieveStoredQueries();
|
||||
|
||||
/** Updates or creates a new stored query and returns it. */
|
||||
StoredDataMiningQueryDTO updateOrCreateStoredQuery(StoredDataMiningQueryDTO query);
|
||||
|
||||
/** Removes a stored query. */
|
||||
StoredDataMiningQueryDTO removeStoredQuery(StoredDataMiningQueryDTO query);
|
||||
|
||||
}
|
||||
+131
@@ -0,0 +1,131 @@
|
||||
package com.sap.sailing.gwt.ui.server;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.StreamSupport;
|
||||
|
||||
import org.apache.shiro.authz.AuthorizationException;
|
||||
|
||||
import com.sap.sailing.server.impl.preferences.model.SailingPreferences;
|
||||
import com.sap.sailing.server.impl.preferences.model.StoredDataMiningQueryPreference;
|
||||
import com.sap.sailing.server.impl.preferences.model.StoredDataMiningQueryPreferences;
|
||||
import com.sap.sse.common.Util;
|
||||
import com.sap.sse.datamining.shared.DataMiningQuerySerializer;
|
||||
import com.sap.sse.datamining.shared.dto.StatisticQueryDefinitionDTO;
|
||||
import com.sap.sse.datamining.shared.dto.StoredDataMiningQueryDTO;
|
||||
import com.sap.sse.datamining.shared.impl.dto.StoredDataMiningQueryDTOImpl;
|
||||
import com.sap.sse.gwt.dispatch.shared.exceptions.ServerDispatchException;
|
||||
import com.sap.sse.security.SecurityService;
|
||||
import com.sap.sse.security.UserStore;
|
||||
import com.sap.sse.security.shared.User;
|
||||
|
||||
/** Implementation of {@link StoredDataMiningQueryPersister}. */
|
||||
public class StoredDataMiningQueryPersisterImpl implements StoredDataMiningQueryPersister {
|
||||
|
||||
private final SecurityService securityService;
|
||||
private final UserStore userStore;
|
||||
|
||||
public StoredDataMiningQueryPersisterImpl(SecurityService securityService, UserStore userStore) {
|
||||
this.securityService = securityService;
|
||||
this.userStore = userStore;
|
||||
|
||||
}
|
||||
|
||||
/** @return all {@link StoredDataMiningQueryDTO}s the user has stored in his user store. */
|
||||
@Override
|
||||
public ArrayList<StoredDataMiningQueryDTO> retrieveStoredQueries() {
|
||||
|
||||
StoredDataMiningQueryPreferences prefs = getPreferenceForCurrentUser(
|
||||
SailingPreferences.STORED_DATAMINING_QUERY_PREFERENCES);
|
||||
if (prefs == null) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return new ArrayList<>(StreamSupport.stream(prefs.getStoredQueries().spliterator(), false).map(this::transform)
|
||||
.collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
/** Updates or creates a new stored query and returns it. */
|
||||
@Override
|
||||
public StoredDataMiningQueryDTO updateOrCreateStoredQuery(StoredDataMiningQueryDTO query) {
|
||||
StoredDataMiningQueryPreferences prefs = getPreferenceForCurrentUser(
|
||||
SailingPreferences.STORED_DATAMINING_QUERY_PREFERENCES);
|
||||
|
||||
// remove query
|
||||
Collection<StoredDataMiningQueryPreference> updatedQueries = removeQueryFromIterable(query, prefs);
|
||||
|
||||
updatedQueries.add(transform(query));
|
||||
prefs = new StoredDataMiningQueryPreferences();
|
||||
prefs.setStoredQueries(updatedQueries);
|
||||
setPreferenceForCurrentUser(SailingPreferences.STORED_DATAMINING_QUERY_PREFERENCES, prefs);
|
||||
return query;
|
||||
}
|
||||
|
||||
/** Removes a stored query from the user store and returns it. */
|
||||
@Override
|
||||
public StoredDataMiningQueryDTO removeStoredQuery(StoredDataMiningQueryDTO query) {
|
||||
StoredDataMiningQueryPreferences prefs = getPreferenceForCurrentUser(
|
||||
SailingPreferences.STORED_DATAMINING_QUERY_PREFERENCES);
|
||||
|
||||
// remove query
|
||||
Collection<StoredDataMiningQueryPreference> updatedQueries = removeQueryFromIterable(query, prefs);
|
||||
|
||||
// update preferences
|
||||
prefs = new StoredDataMiningQueryPreferences();
|
||||
prefs.setStoredQueries(updatedQueries);
|
||||
setPreferenceForCurrentUser(SailingPreferences.STORED_DATAMINING_QUERY_PREFERENCES, prefs);
|
||||
return query;
|
||||
}
|
||||
|
||||
/** Remove a query from an iterable by filtering the UUIDs of all queries in the iterable. */
|
||||
private Collection<StoredDataMiningQueryPreference> removeQueryFromIterable(StoredDataMiningQueryDTO query,
|
||||
StoredDataMiningQueryPreferences prefs) {
|
||||
if (prefs != null) {
|
||||
// copy existing preferences
|
||||
Iterable<StoredDataMiningQueryPreference> storedPrefs = prefs.getStoredQueries();
|
||||
|
||||
// remove existing preference with the same UUID if it exists
|
||||
storedPrefs = StreamSupport.stream(storedPrefs.spliterator(), false)
|
||||
.filter(q -> !q.getId().equals(query.getId())).collect(Collectors.toList());
|
||||
|
||||
Collection<StoredDataMiningQueryPreference> updatedEntries = new ArrayList<>();
|
||||
Util.addAll(storedPrefs, updatedEntries);
|
||||
return updatedEntries;
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
/** Sets a preference for the current user. */
|
||||
private void setPreferenceForCurrentUser(String preferenceKey, Object preference) {
|
||||
User currentUser = securityService.getCurrentUser();
|
||||
if (currentUser != null) {
|
||||
try {
|
||||
userStore.setPreferenceObject(currentUser.getName(), preferenceKey, preference);
|
||||
} catch (AuthorizationException e) {
|
||||
throw new ServerDispatchException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Converts a {@link StoredDataMiningQueryPreference} to a {@link StoredDataMiningQueryDTO}. */
|
||||
private StoredDataMiningQueryDTO transform(StoredDataMiningQueryPreference pref) {
|
||||
StatisticQueryDefinitionDTO query = DataMiningQuerySerializer.fromBase64String(pref.getSerializedQuery());
|
||||
return new StoredDataMiningQueryDTOImpl(pref.getName(), pref.getId(), query);
|
||||
}
|
||||
|
||||
/** Converts a {@link StoredDataMiningQueryDTO} to a {@link StoredDataMiningQueryPreference}. */
|
||||
private StoredDataMiningQueryPreference transform(StoredDataMiningQueryDTO dto) {
|
||||
String serializedQuery = DataMiningQuerySerializer.toBase64String(dto.getQuery());
|
||||
return new StoredDataMiningQueryPreference(dto.getName(), dto.getId(), serializedQuery);
|
||||
}
|
||||
|
||||
/** @return the preference for the current user associated with {@link preferenceKey} */
|
||||
private <T> T getPreferenceForCurrentUser(String preferenceKey) {
|
||||
User currentUser = securityService.getCurrentUser();
|
||||
if (currentUser != null) {
|
||||
return userStore.getPreferenceObject(currentUser.getName(), preferenceKey);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -41,6 +41,7 @@ import com.sap.sailing.server.RacingEventService;
|
||||
import com.sap.sailing.server.RacingEventServiceMXBean;
|
||||
import com.sap.sailing.server.impl.preferences.model.BoatClassNotificationPreferences;
|
||||
import com.sap.sailing.server.impl.preferences.model.CompetitorNotificationPreferences;
|
||||
import com.sap.sailing.server.impl.preferences.model.StoredDataMiningQueryPreferences;
|
||||
import com.sap.sailing.server.notification.impl.SailingNotificationServiceImpl;
|
||||
import com.sap.sailing.server.statistics.TrackedRaceStatisticsCache;
|
||||
import com.sap.sailing.server.statistics.TrackedRaceStatisticsCacheImpl;
|
||||
@@ -223,6 +224,10 @@ public class Activator implements BundleActivator {
|
||||
registrations.add(context.registerService(PreferenceConverter.class,
|
||||
new GenericJSONPreferenceConverter<>(() -> new BoatClassNotificationPreferences(racingEventService)),
|
||||
properties));
|
||||
|
||||
properties.put(PreferenceConverter.KEY_PARAMETER_NAME, StoredDataMiningQueryPreferences.PREF_NAME);
|
||||
registrations.add(context.registerService(PreferenceConverter.class,
|
||||
new GenericJSONPreferenceConverter<>(() -> new StoredDataMiningQueryPreferences()), properties));
|
||||
}
|
||||
|
||||
public static BundleContext getContext() {
|
||||
|
||||
+1
@@ -6,4 +6,5 @@ package com.sap.sailing.server.impl.preferences.model;
|
||||
*/
|
||||
public interface SailingPreferences {
|
||||
public static final String NOTIFICATION_PREFERENCES_PREFIX = "sailing.notifications.";
|
||||
public static final String STORED_DATAMINING_QUERY_PREFERENCES = "sailing.datamining.storedqueries";
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
package com.sap.sailing.server.impl.preferences.model;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import com.sap.sse.common.settings.generic.AbstractGenericSerializableSettings;
|
||||
import com.sap.sse.common.settings.generic.StringSetting;
|
||||
import com.sap.sse.common.settings.generic.UUIDSetting;
|
||||
|
||||
/** Preference object which contains a stored data mining query with a name and a unique id. */
|
||||
public class StoredDataMiningQueryPreference extends AbstractGenericSerializableSettings {
|
||||
private static final long serialVersionUID = -7100595551754668437L;
|
||||
|
||||
private transient StringSetting name;
|
||||
private transient UUIDSetting id;
|
||||
private transient StringSetting serializedQuery;
|
||||
|
||||
public StoredDataMiningQueryPreference() {
|
||||
}
|
||||
|
||||
public StoredDataMiningQueryPreference(String name, UUID uuid, String serializedQuery) {
|
||||
this.name.setValue(name);
|
||||
this.id.setValue(uuid);
|
||||
this.serializedQuery.setValue(serializedQuery);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addChildSettings() {
|
||||
name = new StringSetting("name", this);
|
||||
id = new UUIDSetting("id", this);
|
||||
serializedQuery = new StringSetting("serializedQuery", this);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name.getValue();
|
||||
}
|
||||
|
||||
public UUID getId() {
|
||||
return id.getValue();
|
||||
}
|
||||
|
||||
public String getSerializedQuery() {
|
||||
return serializedQuery.getValue();
|
||||
}
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package com.sap.sailing.server.impl.preferences.model;
|
||||
|
||||
import com.sap.sse.common.settings.generic.AbstractGenericSerializableSettings;
|
||||
import com.sap.sse.common.settings.generic.SettingsList;
|
||||
|
||||
/** Holds a list of {@link StoredDataMiningQueryPreferences}. */
|
||||
public class StoredDataMiningQueryPreferences extends AbstractGenericSerializableSettings {
|
||||
|
||||
private static final long serialVersionUID = -8088467604778160161L;
|
||||
public static final String PREF_NAME = SailingPreferences.STORED_DATAMINING_QUERY_PREFERENCES;
|
||||
|
||||
private transient SettingsList<StoredDataMiningQueryPreference> storedQueries;
|
||||
|
||||
@Override
|
||||
protected void addChildSettings() {
|
||||
storedQueries = new SettingsList<>("storedQueries", this, () -> new StoredDataMiningQueryPreference());
|
||||
}
|
||||
|
||||
public Iterable<StoredDataMiningQueryPreference> getStoredQueries() {
|
||||
return storedQueries.getValues();
|
||||
}
|
||||
|
||||
public void setStoredQueries(Iterable<StoredDataMiningQueryPreference> storedQueries) {
|
||||
this.storedQueries.setValues(storedQueries);
|
||||
}
|
||||
}
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
package com.sap.sse.datamining.shared;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.sap.sse.common.Base64Utils;
|
||||
import com.sap.sse.datamining.shared.dto.StatisticQueryDefinitionDTO;
|
||||
|
||||
/** This serializer can (de-)serialize a {@link StatisticQueryDefinitionDTO} into a Base64-String. */
|
||||
public final class DataMiningQuerySerializer {
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(DataMiningQuerySerializer.class.getName());
|
||||
private DataMiningQuerySerializer() {
|
||||
}
|
||||
|
||||
/** @return the {@link StatisticQueryDefinitionDTO} as a base 64 string serialized with java serialization */
|
||||
public static String toBase64String(final StatisticQueryDefinitionDTO dto) {
|
||||
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||
try (ObjectOutputStream out = new ObjectOutputStream(stream)) {
|
||||
out.writeObject(dto);
|
||||
byte[] bytes = stream.toByteArray();
|
||||
return Base64Utils.toBase64(bytes);
|
||||
} catch (IOException e) {
|
||||
LOG.warning("Could not store query: " + e.getMessage());
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/** @return the {@link StatisticQueryDefinitionDTO} from a base 64 string deserialized with java serialization */
|
||||
public static StatisticQueryDefinitionDTO fromBase64String(final String string) {
|
||||
byte[] bytes;
|
||||
try {
|
||||
bytes = Base64Utils.fromBase64(string);
|
||||
} catch (IllegalArgumentException e) {
|
||||
return null;
|
||||
}
|
||||
|
||||
try (ByteArrayInputStream stream = new ByteArrayInputStream(bytes)) {
|
||||
ObjectInputStream in;
|
||||
in = new ObjectInputStream(stream);
|
||||
Object o = in.readObject();
|
||||
if (o instanceof StatisticQueryDefinitionDTO) {
|
||||
return (StatisticQueryDefinitionDTO) o;
|
||||
}
|
||||
} catch (IOException | ClassNotFoundException e) {
|
||||
LOG.warning("Could not load query: " + e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.sap.sse.datamining.shared.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.UUID;
|
||||
|
||||
/** Contains a storable data mining query. */
|
||||
public interface StoredDataMiningQueryDTO extends Serializable {
|
||||
|
||||
public String getName();
|
||||
|
||||
public UUID getId();
|
||||
|
||||
public StatisticQueryDefinitionDTO getQuery();
|
||||
|
||||
}
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
package com.sap.sse.datamining.shared.impl.dto;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import com.sap.sse.datamining.shared.dto.StatisticQueryDefinitionDTO;
|
||||
import com.sap.sse.datamining.shared.dto.StoredDataMiningQueryDTO;
|
||||
|
||||
/** Contains a storable data mining query. */
|
||||
public class StoredDataMiningQueryDTOImpl implements StoredDataMiningQueryDTO {
|
||||
|
||||
private static final long serialVersionUID = -5119084914429627047L;
|
||||
|
||||
private String name;
|
||||
|
||||
private UUID id;
|
||||
|
||||
private StatisticQueryDefinitionDTO query;
|
||||
|
||||
public StoredDataMiningQueryDTOImpl() {
|
||||
}
|
||||
|
||||
public StoredDataMiningQueryDTOImpl(String name, UUID id, StatisticQueryDefinitionDTO query) {
|
||||
this.name = name;
|
||||
this.id = id;
|
||||
this.query = query;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UUID getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public StatisticQueryDefinitionDTO getQuery() {
|
||||
return query;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public void setId(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void setSerializedQuery(StatisticQueryDefinitionDTO query) {
|
||||
this.query = query;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((id == null) ? 0 : id.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
StoredDataMiningQueryDTOImpl other = (StoredDataMiningQueryDTOImpl) obj;
|
||||
if (id == null) {
|
||||
if (other.id != null)
|
||||
return false;
|
||||
} else if (!id.equals(other.id))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,7 +8,8 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
Fragment-Host: com.sap.sse.datamining
|
||||
Require-Bundle: org.hamcrest;bundle-version="1.1.0",
|
||||
org.mockito.mockito-core;bundle-version="1.9.5",
|
||||
com.sap.sse.datamining.annotations;bundle-version="1.0.0"
|
||||
com.sap.sse.datamining.annotations;bundle-version="1.0.0",
|
||||
com.sap.sailing.datamining
|
||||
Import-Package: junit.framework;version="4.8.2",
|
||||
org.junit;version="4.8.2",
|
||||
org.junit.runner;version="4.8.2"
|
||||
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.sap.sse.datamining.test.util;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.sap.sailing.datamining.SailingPredefinedQueries;
|
||||
import com.sap.sse.datamining.shared.DataMiningQuerySerializer;
|
||||
import com.sap.sse.datamining.shared.dto.StatisticQueryDefinitionDTO;
|
||||
|
||||
public class DataMiningQuerySerializerTest {
|
||||
|
||||
@Test
|
||||
public void testSerializationAndDeserialization() {
|
||||
|
||||
// test null
|
||||
testSerializationAndDeserialization(null);
|
||||
|
||||
// test all predefined queries
|
||||
for (StatisticQueryDefinitionDTO query : new SailingPredefinedQueries().getQueries().values()) {
|
||||
testSerializationAndDeserialization(query);
|
||||
}
|
||||
}
|
||||
|
||||
private void testSerializationAndDeserialization(final StatisticQueryDefinitionDTO dto) {
|
||||
String base64 = DataMiningQuerySerializer.toBase64String(dto);
|
||||
StatisticQueryDefinitionDTO deserialized = DataMiningQuerySerializer.fromBase64String(base64);
|
||||
Assert.assertEquals(dto, deserialized);
|
||||
}
|
||||
}
|
||||
+7
@@ -11,6 +11,7 @@ import com.sap.sse.common.settings.SerializableSettings;
|
||||
import com.sap.sse.datamining.shared.DataMiningSession;
|
||||
import com.sap.sse.datamining.shared.SerializationDummy;
|
||||
import com.sap.sse.datamining.shared.dto.StatisticQueryDefinitionDTO;
|
||||
import com.sap.sse.datamining.shared.dto.StoredDataMiningQueryDTO;
|
||||
import com.sap.sse.datamining.shared.impl.PredefinedQueryIdentifier;
|
||||
import com.sap.sse.datamining.shared.impl.dto.AggregationProcessorDefinitionDTO;
|
||||
import com.sap.sse.datamining.shared.impl.dto.DataRetrieverChainDefinitionDTO;
|
||||
@@ -64,4 +65,10 @@ public interface DataMiningService extends RemoteService {
|
||||
StatisticQueryDefinitionDTO localize(StatisticQueryDefinitionDTO queryDefinition, String localeInfoName);
|
||||
|
||||
SerializationDummy pseudoMethodSoThatSomeClassesAreAddedToTheGWTSerializationPolicy();
|
||||
|
||||
ArrayList<StoredDataMiningQueryDTO> retrieveStoredQueries();
|
||||
|
||||
StoredDataMiningQueryDTO updateOrCreateStoredQuery(StoredDataMiningQueryDTO query);
|
||||
|
||||
StoredDataMiningQueryDTO removeStoredQuery(StoredDataMiningQueryDTO query);
|
||||
}
|
||||
+10
@@ -11,6 +11,7 @@ import com.sap.sse.common.settings.SerializableSettings;
|
||||
import com.sap.sse.datamining.shared.DataMiningSession;
|
||||
import com.sap.sse.datamining.shared.SerializationDummy;
|
||||
import com.sap.sse.datamining.shared.dto.StatisticQueryDefinitionDTO;
|
||||
import com.sap.sse.datamining.shared.dto.StoredDataMiningQueryDTO;
|
||||
import com.sap.sse.datamining.shared.impl.GenericGroupKey;
|
||||
import com.sap.sse.datamining.shared.impl.PredefinedQueryIdentifier;
|
||||
import com.sap.sse.datamining.shared.impl.dto.AggregationProcessorDefinitionDTO;
|
||||
@@ -76,4 +77,13 @@ public interface DataMiningServiceAsync {
|
||||
* This is necessary, because the type is somehow hidden from GWT. For Further information look at bug 1503.<br />
|
||||
*/
|
||||
void pseudoMethodSoThatSomeClassesAreAddedToTheGWTSerializationPolicy(AsyncCallback<SerializationDummy> callback);
|
||||
|
||||
/** Retrieves the {@link StoredDataMiningQueryDTO}s from the back end. */
|
||||
void retrieveStoredQueries(AsyncCallback<ArrayList<StoredDataMiningQueryDTO>> callback);
|
||||
|
||||
/** Updates or creates a {@link StoredDataMiningQueryDTO} in the back end. */
|
||||
void updateOrCreateStoredQuery(StoredDataMiningQueryDTO query, AsyncCallback<StoredDataMiningQueryDTO> callback);
|
||||
|
||||
/** Removes the {@link StoredDataMiningQueryDTO} if it exists from the back end. */
|
||||
void removeStoredQuery(StoredDataMiningQueryDTO query, AsyncCallback<StoredDataMiningQueryDTO> callback);
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
package com.sap.sse.gwt.client;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.i18n.client.Messages;
|
||||
import com.google.gwt.i18n.client.LocalizableResource.DefaultLocale;
|
||||
import com.google.gwt.i18n.client.Messages;
|
||||
|
||||
/**
|
||||
* Defines the text strings for i18n that are used by the SSE GWT bundle.
|
||||
@@ -87,4 +87,14 @@ public interface StringMessages extends Messages {
|
||||
String centralAngleInRadian();
|
||||
String centralAngleInDegree();
|
||||
String clearSelection();
|
||||
String load();
|
||||
String dataMiningStoredQueryPlaceholder();
|
||||
String dataMiningStoredQueryUpdateSuccessful(String name);
|
||||
String dataMiningStoredQueryCreationSuccessful(String name);
|
||||
String dataMiningStoredQueryLoadedSuccessful(String name);
|
||||
String dataMiningStoredQueryLoadedFailed(String name);
|
||||
String dataMiningStoredQueryRemovedSuccessful(String name);
|
||||
String dataMiningStoredQueryRemovedFailed(String name);
|
||||
String loadOrSaveQueries();
|
||||
|
||||
}
|
||||
@@ -69,4 +69,13 @@ clearSelection=Clear selection
|
||||
pagerStateInfo={0,number,#,###}-{1,number,#,###} of {2,number,#,###}
|
||||
pagerStateInfo[false]={0,number,#,###}-{1,number,#,###} of over {2,number,#,###}
|
||||
yes=Yes
|
||||
no=No
|
||||
no=No
|
||||
load=Load
|
||||
dataMiningStoredQueryPlaceholder=Name of Stored Query
|
||||
dataMiningStoredQueryUpdateSuccessful=Updated Stored Query ''{0}''.
|
||||
dataMiningStoredQueryCreationSuccessful=Created new Stored Query ''{0}''.
|
||||
dataMiningStoredQueryLoadedSuccessful=Loaded Stored Query ''{0}''.
|
||||
dataMiningStoredQueryLoadedFailed=Could not find Stored Query ''{0}''.
|
||||
dataMiningStoredQueryRemovedSuccessful=Removed Stored Query ''{0}''.
|
||||
dataMiningStoredQueryRemovedFailed=Could not remove of Stored Query ''{0}''.
|
||||
loadOrSaveQueries=Load or save query:
|
||||
@@ -69,4 +69,13 @@ clearSelection=Auswahl leeren
|
||||
pagerStateInfo={0,number,#,###}-{1,number,#,###} von {2,number,#,###}
|
||||
pagerStateInfo[false]={0,number,#,###}-{1,number,#,###} von über {2,number,#,###}
|
||||
yes=Ja
|
||||
no=Nein
|
||||
no=Nein
|
||||
load=Laden
|
||||
dataMiningStoredQueryPlaceholder=Name der gespeicherten Anfrage
|
||||
dataMiningStoredQueryUpdateSuccessful=Die gespeicherte Anfrage ''{0}'' wurde erfolgreich aktualisiert.
|
||||
dataMiningStoredQueryCreationSuccessful=Es wurde eine neue Anfrage ''{0}'' erstellt.
|
||||
dataMiningStoredQueryLoadedSuccessful=Die gespeicherte Anfrage ''{0}'' wurde erfolgreich geladen.
|
||||
dataMiningStoredQueryLoadedFailed=Die gespeicherte Anfrage ''{0}'' konnte nicht gefunden werden.
|
||||
dataMiningStoredQueryRemovedSuccessful=Die gespeicherte Anfrage ''{0}'' wurde erfolgreich entfernt.
|
||||
dataMiningStoredQueryRemovedFailed=Die gespeicherte Anfrage ''{0}'' konnte nicht entfernt werden.
|
||||
loadOrSaveQueries=Anfrage laden oder speichern:
|
||||
Reference in new issue
Block a user