Reorganizing library
This commit is contained in:
parent
04c9a50256
commit
e4d5321e4f
12
pom.xml
12
pom.xml
|
@ -36,5 +36,17 @@
|
|||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.common</groupId>
|
||||
<artifactId>gcube-jackson-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.common</groupId>
|
||||
<artifactId>gcube-jackson-annotations</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.common</groupId>
|
||||
<artifactId>gcube-jackson-databind</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -27,15 +27,4 @@ public class GCatConstants {
|
|||
|
||||
public static final String ORGANIZATION_FILTER_TEMPLATE = ORGANIZATION_PARAMETER + ":%s";
|
||||
|
||||
public static final String CATALOGUE_MEMBER = "Catalogue-Member";
|
||||
public static final String CATALOGUE_EDITOR = "Catalogue-Editor";
|
||||
public static final String CATALOGUE_ADMIN = "Catalogue-Admin";
|
||||
public static final String CATALOGUE_MODERATOR = "Catalogue-Moderator";
|
||||
|
||||
/* Content Moderation fields */
|
||||
public static final String CM_ITEM_STATUS_QUERY_PARAMETER = "status";
|
||||
public static final String SYSTEM_CM_PREFIX = "system:cm_";
|
||||
public static final String SYSTEM_CM_ITEM_STATUS = SYSTEM_CM_PREFIX + "item_status";
|
||||
public static final String SYSTEM_CM_ITEM_VISIBILITY = SYSTEM_CM_PREFIX + "item_visibility";
|
||||
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ import javax.xml.ws.WebServiceException;
|
|||
/**
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
*/
|
||||
public interface Item<C,D> extends CRUD<C,D>, Moderated {
|
||||
public interface Item<C,D> extends CRUD<C,D> {
|
||||
|
||||
public static final String ITEMS = "items";
|
||||
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
package org.gcube.gcat.api.interfaces;
|
||||
|
||||
public interface Moderated {
|
||||
|
||||
public String approve(String moderatorMessage);
|
||||
|
||||
public String reject(String moderatorMessage);
|
||||
|
||||
public void message(String message);
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package org.gcube.gcat.api;
|
||||
package org.gcube.gcat.api.moderation;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
|
@ -1,4 +1,4 @@
|
|||
package org.gcube.gcat.api;
|
||||
package org.gcube.gcat.api.moderation;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
|
@ -0,0 +1,22 @@
|
|||
package org.gcube.gcat.api.moderation;
|
||||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI-CNR)
|
||||
*/
|
||||
public interface Moderated {
|
||||
|
||||
public static final String CATALOGUE_MODERATOR = "Catalogue-Moderator";
|
||||
|
||||
/* Content Moderation fields */
|
||||
public static final String CM_ITEM_STATUS_QUERY_PARAMETER = "status";
|
||||
public static final String SYSTEM_CM_PREFIX = "system:cm_";
|
||||
public static final String SYSTEM_CM_ITEM_STATUS = SYSTEM_CM_PREFIX + "item_status";
|
||||
public static final String SYSTEM_CM_ITEM_VISIBILITY = SYSTEM_CM_PREFIX + "item_visibility";
|
||||
|
||||
public String approve(String moderatorMessage);
|
||||
|
||||
public String reject(String moderatorMessage);
|
||||
|
||||
public void message(String message);
|
||||
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package org.gcube.gcat.api.moderation;
|
||||
|
||||
import org.gcube.com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.gcube.com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import org.gcube.com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class ModerationContent {
|
||||
|
||||
@JsonProperty(value=Moderated.SYSTEM_CM_ITEM_STATUS,required=false)
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||
protected CMItemStatus cmItemStatus;
|
||||
|
||||
@JsonProperty(required=false)
|
||||
protected String message;
|
||||
|
||||
public CMItemStatus getCMItemStatus() {
|
||||
return cmItemStatus;
|
||||
}
|
||||
|
||||
public void setCMItemStatus(CMItemStatus cmItemStatus) {
|
||||
this.cmItemStatus = cmItemStatus;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package org.gcube.gcat.api;
|
||||
package org.gcube.gcat.api.roles;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
@ -8,9 +8,13 @@ import java.util.Map;
|
|||
*/
|
||||
public enum Role {
|
||||
|
||||
MEMBER(GCatConstants.CATALOGUE_MEMBER, "member"),
|
||||
EDITOR(GCatConstants.CATALOGUE_EDITOR, "editor"),
|
||||
ADMIN(GCatConstants.CATALOGUE_ADMIN, "admin");
|
||||
MEMBER(Role.CATALOGUE_MEMBER, "member"),
|
||||
EDITOR(Role.CATALOGUE_EDITOR, "editor"),
|
||||
ADMIN(Role.CATALOGUE_ADMIN, "admin");
|
||||
|
||||
private static final String CATALOGUE_ADMIN = "Catalogue-Admin";
|
||||
private static final String CATALOGUE_EDITOR = "Catalogue-Editor";
|
||||
private static final String CATALOGUE_MEMBER = "Catalogue-Member";
|
||||
|
||||
private final String portalRole;
|
||||
private final String ckanRole;
|
Loading…
Reference in New Issue