109 lines
2.0 KiB
Java
109 lines
2.0 KiB
Java
package org.gcube.portlets.widgets.ckancontentmoderator.server;
|
|
|
|
import java.util.List;
|
|
|
|
import org.gcube.datacatalogue.utillibrary.shared.jackan.model.CkanDataset;
|
|
|
|
|
|
// TODO: Auto-generated Javadoc
|
|
/**
|
|
* The Interface ContentModeratorSystem.
|
|
*
|
|
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
|
*
|
|
* May 7, 2021
|
|
*/
|
|
public interface ContentModeratorSystem {
|
|
|
|
/**
|
|
* Checks if is content moderator enabled.
|
|
*
|
|
* @return true, if is content moderator enabled
|
|
*/
|
|
boolean isContentModeratorEnabled();
|
|
|
|
/**
|
|
* Sets the status.
|
|
*
|
|
* @param itemId the item id
|
|
* @param theStatus the the status
|
|
*/
|
|
void setStatus(String itemId, ItemStatus theStatus);
|
|
|
|
|
|
/**
|
|
* Gets the list items for status.
|
|
*
|
|
* @param theStatus the the status
|
|
* @return the list items for status
|
|
*/
|
|
List<CkanDataset> getListItemsForStatus(ItemStatus theStatus);
|
|
|
|
/**
|
|
* Approve item.
|
|
*
|
|
* @param itemId the item id
|
|
*/
|
|
void approveItem(String itemId);
|
|
|
|
/**
|
|
* Reject item.
|
|
*
|
|
* @param itemId the item id
|
|
* @param permanentlyDelete the permanently delete
|
|
* @param reasonMsg the reason msg
|
|
*/
|
|
void rejectItem(String itemId, boolean permanentlyDelete, String reasonMsg);
|
|
|
|
/**
|
|
* Permanently delete.
|
|
*
|
|
* @param itemId the item id
|
|
*/
|
|
void permanentlyDelete(String itemId);
|
|
|
|
/**
|
|
* The Enum ItemStatus.
|
|
*
|
|
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
|
*
|
|
* May 7, 2021
|
|
*/
|
|
static enum ItemStatus {
|
|
PENDING("pending", "Pending"), APPROVED("approved", "Approved"), REJECTED("rejected", "Rejected");
|
|
|
|
private String id;
|
|
private String label;
|
|
|
|
/**
|
|
* Instantiates a new item status.
|
|
*
|
|
* @param id the id
|
|
* @param label the label
|
|
*/
|
|
private ItemStatus(String id, String label) {
|
|
this.id = id;
|
|
this.label = label;
|
|
}
|
|
|
|
/**
|
|
* Gets the id.
|
|
*
|
|
* @return the id
|
|
*/
|
|
public String getId() {
|
|
return id;
|
|
}
|
|
|
|
/**
|
|
* Gets the label.
|
|
*
|
|
* @return the label
|
|
*/
|
|
public String getLabel() {
|
|
return label;
|
|
}
|
|
|
|
}
|
|
}
|