aaaa
This commit is contained in:
parent
944d14aaa0
commit
87c06555ca
|
@ -0,0 +1,64 @@
|
||||||
|
package org.gcube.portal.social.networking.ws.inputs;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class UserSetNotificationBean {
|
||||||
|
|
||||||
|
@JsonProperty("username")
|
||||||
|
@NotNull(message="username cannot be null")
|
||||||
|
@Size(message="username cannot be empty", min=1)
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
@JsonProperty("disableNotification")
|
||||||
|
@NotNull(message="disableNotification cannot be null")
|
||||||
|
@Size(message="disableNotification cannot be empty", min=1)
|
||||||
|
private boolean disableNotification;
|
||||||
|
|
||||||
|
public UserSetNotificationBean() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param username
|
||||||
|
* @param disableNotification
|
||||||
|
*/
|
||||||
|
public UserSetNotificationBean(String username, boolean disableNotification) {
|
||||||
|
super();
|
||||||
|
this.username = username;
|
||||||
|
this.disableNotification = disableNotification;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getUsername() {
|
||||||
|
return username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsername(String username) {
|
||||||
|
this.username = username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isDisableNotification() {
|
||||||
|
return disableNotification;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDisableNotification(boolean disableNotification) {
|
||||||
|
this.disableNotification = disableNotification;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "UserSetNotificationBean [username=" + username + ", disableNotification=" + disableNotification + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -47,6 +47,7 @@ import org.gcube.portal.social.networking.liferay.ws.GroupManagerWSBuilder;
|
||||||
import org.gcube.portal.social.networking.liferay.ws.LiferayJSONWsCredentials;
|
import org.gcube.portal.social.networking.liferay.ws.LiferayJSONWsCredentials;
|
||||||
import org.gcube.portal.social.networking.liferay.ws.UserManagerWSBuilder;
|
import org.gcube.portal.social.networking.liferay.ws.UserManagerWSBuilder;
|
||||||
import org.gcube.portal.social.networking.ws.ex.AuthException;
|
import org.gcube.portal.social.networking.ws.ex.AuthException;
|
||||||
|
import org.gcube.portal.social.networking.ws.inputs.UserSetNotificationBean;
|
||||||
import org.gcube.portal.social.networking.ws.mappers.CatalogueEventTypeMapper;
|
import org.gcube.portal.social.networking.ws.mappers.CatalogueEventTypeMapper;
|
||||||
import org.gcube.portal.social.networking.ws.mappers.JobMapper;
|
import org.gcube.portal.social.networking.ws.mappers.JobMapper;
|
||||||
import org.gcube.portal.social.networking.ws.mappers.WorkspaceItemMapper;
|
import org.gcube.portal.social.networking.ws.mappers.WorkspaceItemMapper;
|
||||||
|
@ -200,12 +201,9 @@ public class Notifications {
|
||||||
})
|
})
|
||||||
@AuthorizationControl(allowedRoles={INFRASTRUCTURE_MANAGER_ROLE}, exception=AuthException.class)
|
@AuthorizationControl(allowedRoles={INFRASTRUCTURE_MANAGER_ROLE}, exception=AuthException.class)
|
||||||
public Response setUserNotifications(
|
public Response setUserNotifications(
|
||||||
@NotNull(message="username cannot be null")
|
@NotNull(message="input is missing")
|
||||||
@JsonProperty("username")
|
@Valid
|
||||||
String username,
|
UserSetNotificationBean setting) throws ValidationException{
|
||||||
@NotNull(message="must specify the disable parameter")
|
|
||||||
@JsonProperty("disable")
|
|
||||||
boolean disable) throws ValidationException{
|
|
||||||
|
|
||||||
Caller caller = AuthorizationProvider.instance.get();
|
Caller caller = AuthorizationProvider.instance.get();
|
||||||
String context = ScopeProvider.instance.get();
|
String context = ScopeProvider.instance.get();
|
||||||
|
|
Loading…
Reference in New Issue