This repository has been archived by the owner on Feb 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #462 from ggalmazor/issue_461_backport_460
Issue 461 backport 460
- Loading branch information
Showing
5 changed files
with
172 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 49 additions & 47 deletions
96
src/main/java/org/opendatakit/aggregate/client/preferences/PreferenceService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,49 @@ | ||
/* | ||
* Copyright (C) 2011 University of Washington | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
* use this file except in compliance with the License. You may obtain a copy of | ||
* the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations under | ||
* the License. | ||
*/ | ||
|
||
package org.opendatakit.aggregate.client.preferences; | ||
|
||
import com.google.gwt.user.client.rpc.RemoteService; | ||
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath; | ||
import com.google.gwt.user.server.rpc.XsrfProtect; | ||
import org.opendatakit.aggregate.client.exception.RequestFailureException; | ||
import org.opendatakit.common.persistence.client.exception.DatastoreFailureException; | ||
import org.opendatakit.common.security.client.exception.AccessDeniedException; | ||
|
||
/** | ||
* These actions require the ROLE_USER privilege, which is the least capable | ||
* privilege (granted to all authorized users of the system). | ||
* | ||
* @author [email protected] | ||
*/ | ||
@RemoteServiceRelativePath("preferenceservice") | ||
public interface PreferenceService extends RemoteService { | ||
PreferenceSummary getPreferences() throws AccessDeniedException, RequestFailureException, DatastoreFailureException; | ||
|
||
@XsrfProtect | ||
void setSkipMalformedSubmissions(Boolean skipMalformedSubmissions) throws AccessDeniedException, RequestFailureException, DatastoreFailureException; | ||
|
||
@XsrfProtect | ||
void setFasterBackgroundActionsDisabled(Boolean disabled) throws AccessDeniedException, RequestFailureException, DatastoreFailureException; | ||
|
||
@XsrfProtect | ||
void setOdkTablesEnabled(Boolean enabled) throws AccessDeniedException, RequestFailureException, DatastoreFailureException; | ||
|
||
@XsrfProtect | ||
void setOdkAppName(String appName) throws AccessDeniedException, RequestFailureException, DatastoreFailureException; | ||
} | ||
/* | ||
* Copyright (C) 2011 University of Washington | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
* use this file except in compliance with the License. You may obtain a copy of | ||
* the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations under | ||
* the License. | ||
*/ | ||
|
||
package org.opendatakit.aggregate.client.preferences; | ||
|
||
import com.google.gwt.user.client.rpc.RemoteService; | ||
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath; | ||
import com.google.gwt.user.server.rpc.XsrfProtect; | ||
import org.opendatakit.aggregate.client.exception.RequestFailureException; | ||
import org.opendatakit.common.persistence.client.exception.DatastoreFailureException; | ||
import org.opendatakit.common.security.client.exception.AccessDeniedException; | ||
|
||
/** | ||
* These actions require the ROLE_USER privilege, which is the least capable | ||
* privilege (granted to all authorized users of the system). | ||
* | ||
* @author [email protected] | ||
*/ | ||
@RemoteServiceRelativePath("preferenceservice") | ||
public interface PreferenceService extends RemoteService { | ||
PreferenceSummary getPreferences() throws AccessDeniedException, RequestFailureException, DatastoreFailureException; | ||
|
||
@XsrfProtect | ||
void setSkipMalformedSubmissions(Boolean skipMalformedSubmissions) throws AccessDeniedException, RequestFailureException, DatastoreFailureException; | ||
|
||
@XsrfProtect | ||
void setFasterBackgroundActionsDisabled(Boolean disabled) throws AccessDeniedException, RequestFailureException, DatastoreFailureException; | ||
|
||
@XsrfProtect | ||
void setOdkTablesEnabled(Boolean enabled) throws AccessDeniedException, RequestFailureException, DatastoreFailureException; | ||
|
||
@XsrfProtect | ||
void setOdkAppName(String appName) throws AccessDeniedException, RequestFailureException, DatastoreFailureException; | ||
|
||
String getVersioNote(); | ||
} |
68 changes: 35 additions & 33 deletions
68
src/main/java/org/opendatakit/aggregate/client/preferences/PreferenceServiceAsync.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,35 @@ | ||
/* | ||
* Copyright (C) 2011 University of Washington | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
* use this file except in compliance with the License. You may obtain a copy of | ||
* the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations under | ||
* the License. | ||
*/ | ||
|
||
package org.opendatakit.aggregate.client.preferences; | ||
|
||
import com.google.gwt.user.client.rpc.AsyncCallback; | ||
|
||
public interface PreferenceServiceAsync { | ||
|
||
void getPreferences(AsyncCallback<PreferenceSummary> callback); | ||
|
||
void setOdkTablesEnabled(Boolean enabled, AsyncCallback<Void> callback); | ||
|
||
void setFasterBackgroundActionsDisabled(Boolean disabled, AsyncCallback<Void> callback); | ||
|
||
void setOdkAppName(String appName, AsyncCallback<Void> callback); | ||
|
||
void setSkipMalformedSubmissions(Boolean skipMalformedSubmissions, AsyncCallback<Void> callback); | ||
|
||
} | ||
/* | ||
* Copyright (C) 2011 University of Washington | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
* use this file except in compliance with the License. You may obtain a copy of | ||
* the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations under | ||
* the License. | ||
*/ | ||
|
||
package org.opendatakit.aggregate.client.preferences; | ||
|
||
import com.google.gwt.user.client.rpc.AsyncCallback; | ||
|
||
public interface PreferenceServiceAsync { | ||
|
||
void getPreferences(AsyncCallback<PreferenceSummary> callback); | ||
|
||
void setOdkTablesEnabled(Boolean enabled, AsyncCallback<Void> callback); | ||
|
||
void setFasterBackgroundActionsDisabled(Boolean disabled, AsyncCallback<Void> callback); | ||
|
||
void setOdkAppName(String appName, AsyncCallback<Void> callback); | ||
|
||
void setSkipMalformedSubmissions(Boolean skipMalformedSubmissions, AsyncCallback<Void> callback); | ||
|
||
void getVersioNote(AsyncCallback<String> callback); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters