catalogue-util-library/src/main/java/org/gcube/datacatalogue/utillibrary/server/cms/CatalogueContentModeratorSy...

83 lines
2.5 KiB
Java

package org.gcube.datacatalogue.utillibrary.server.cms;
import java.io.InvalidObjectException;
import java.net.MalformedURLException;
import java.util.List;
import javax.ws.rs.WebApplicationException;
import javax.xml.ws.WebServiceException;
import org.gcube.datacatalogue.utillibrary.shared.ItemStatus;
import org.gcube.datacatalogue.utillibrary.shared.jackan.model.CkanDataset;
/**
* The Interface CatalogueContentModeratorSystem.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Jan 10, 2022
*/
public interface CatalogueContentModeratorSystem {
/**
* Checks if is content moderator enabled.
*
* @return true, if is content moderator enabled
*/
boolean isContentModeratorEnabled();
/**
* Gets the list items for status.
*
* @param theStatus the the status
* @param limit the limit
* @param offset the offset
* @return the list items for status
* @throws WebApplicationException the web application exception
* @throws MalformedURLException the malformed URL exception
* @throws InvalidObjectException the invalid object exception
*/
public List<CkanDataset> getListItemsForStatus(ItemStatus theStatus, int limit, int offset)
throws WebApplicationException, MalformedURLException, InvalidObjectException;
/**
* Reject item.
*
* @param itemName the item name
* @param permanentlyDelete the permanently delete
* @param reasonMsg the reason msg
* @throws WebServiceException the web service exception
* @throws MalformedURLException the malformed URL exception
*/
void rejectItem(String itemName, boolean permanentlyDelete, String reasonMsg)
throws WebServiceException, MalformedURLException;
/**
* Permanently delete.
*
* @param itemName the item name
* @throws WebServiceException the web service exception
* @throws MalformedURLException the malformed URL exception
*/
void permanentlyDelete(String itemName) throws WebServiceException, MalformedURLException;
/**
* Count list items for status.
*
* @param theStatus the the status
* @return the long
*/
long countListItemsForStatus(ItemStatus theStatus);
/**
* Approve item.
*
* @param itemName the item name
* @param moderatorMessage the moderator message
* @throws WebApplicationException the web application exception
* @throws MalformedURLException the malformed URL exception
*/
void approveItem(String itemName, String moderatorMessage) throws WebApplicationException, MalformedURLException;
}