ckan-content-moderator-widget/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/client/CkanContentModeratorService...

96 lines
2.8 KiB
Java
Raw Normal View History

2021-05-07 16:55:35 +02:00
package org.gcube.portlets.widgets.ckancontentmoderator.client;
2021-06-01 18:36:18 +02:00
import java.util.List;
2021-06-14 17:39:44 +02:00
import org.gcube.datacatalogue.utillibrary.shared.ItemStatus;
2021-06-14 11:27:53 +02:00
import org.gcube.portlets.widgets.ckancontentmoderator.shared.CatalogueDataset;
2022-02-08 15:41:30 +01:00
import org.gcube.portlets.widgets.ckancontentmoderator.shared.OperationReport;
import org.gcube.portlets.widgets.ckancontentmoderator.shared.SearchedData;
2021-05-07 16:55:35 +02:00
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
/**
2022-02-08 15:41:30 +01:00
* The Interface CkanContentModeratorService.
2021-06-14 17:39:44 +02:00
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
2022-02-08 15:41:30 +01:00
* Jan 11, 2022
2021-05-07 16:55:35 +02:00
*/
2022-02-17 16:43:43 +01:00
@RemoteServiceRelativePath("ckanContentModeratorService")
2021-05-07 16:55:35 +02:00
public interface CkanContentModeratorService extends RemoteService {
2021-06-14 17:39:44 +02:00
/**
* Checks if is content moderator enabled.
*
* @return true, if is content moderator enabled
*/
2021-05-07 16:55:35 +02:00
public boolean isContentModeratorEnabled();
2021-06-14 17:39:44 +02:00
/**
* Sets the status.
2022-02-18 14:17:19 +01:00
* Currently, this only used to change the status from Rejected to Pending
*
2021-06-14 17:39:44 +02:00
* @param theStatus the the status
2021-06-24 15:02:49 +02:00
* @param itemNames the item names
2022-02-18 14:17:19 +01:00
* @return the operation report
* @throws Exception
2021-06-14 17:39:44 +02:00
*/
2022-02-18 14:17:19 +01:00
public OperationReport setStatus(ItemStatus theStatus, List<String> itemNames) throws Exception;
2021-06-24 15:02:49 +02:00
2021-06-14 17:39:44 +02:00
/**
* Reject item.
*
2022-02-08 15:41:30 +01:00
* @param itemNames the item names
2021-06-14 17:39:44 +02:00
* @param permanentlyDelete the permanently delete
2022-02-08 15:41:30 +01:00
* @param reasonMsg the reason msg
* @return the operation report
* @throws Exception the exception
2021-06-14 17:39:44 +02:00
*/
2022-02-08 15:41:30 +01:00
public OperationReport rejectItem(List<String> itemNames, boolean permanentlyDelete, String reasonMsg)
throws Exception;
2021-05-07 16:55:35 +02:00
2021-06-14 17:39:44 +02:00
/**
* Permanently delete.
*
2021-06-24 15:02:49 +02:00
* @param itemNames the item names
2022-02-08 15:41:30 +01:00
* @return the operation report
* @throws Exception the exception
2021-06-14 17:39:44 +02:00
*/
2022-02-08 15:41:30 +01:00
public OperationReport permanentlyDelete(List<String> itemNames) throws Exception;
2021-05-07 16:55:35 +02:00
2021-06-14 17:39:44 +02:00
/**
* Gets the list items for status.
*
* @param theStatus the the status
2022-02-08 15:41:30 +01:00
* @param limit the limit
* @param offset the offset
2021-06-14 17:39:44 +02:00
* @return the list items for status
* @throws Exception the exception
2021-06-14 17:39:44 +02:00
*/
public List<CatalogueDataset> getListItemsForStatus(ItemStatus theStatus, int limit, int offset) throws Exception;
/**
* Gets the data for status.
*
2022-02-08 15:41:30 +01:00
* @param status the status
* @param startIndex the start index
* @param lenght the lenght
* @param serverIndex the server index
* @return the data for status
2021-06-24 15:02:49 +02:00
* @throws Exception the exception
*/
SearchedData getDataForStatus(ItemStatus status, int startIndex, int lenght, int serverIndex) throws Exception;
2022-02-08 15:41:30 +01:00
/**
* Approve item.
*
* @param itemNames the item names
* @param moderatorMessage the moderator message
* @return the operation report
* @throws Exception the exception
*/
OperationReport approveItem(List<String> itemNames, String moderatorMessage) throws Exception;
2021-05-07 16:55:35 +02:00
}