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-21 15:59:13 +01:00
|
|
|
import org.gcube.portlets.widgets.ckancontentmoderator.shared.ModerationUserRole;
|
2022-02-08 15:41:30 +01:00
|
|
|
import org.gcube.portlets.widgets.ckancontentmoderator.shared.OperationReport;
|
2021-06-16 15:53:06 +02:00
|
|
|
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
|
|
|
/**
|
2022-02-21 15:59:13 +01:00
|
|
|
* Sets the status. 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
|
2022-02-21 15:59:13 +01:00
|
|
|
* @throws Exception the 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.
|
|
|
|
*
|
2022-04-07 15:31:48 +02:00
|
|
|
* @param theStatus the the status
|
|
|
|
* @param offset the offset
|
|
|
|
* @param limit the limit
|
|
|
|
* @param restrictedToLoggedInUser the restricted to logged in user
|
2022-05-04 15:15:54 +02:00
|
|
|
* @param sortForField the sort for field
|
2021-06-14 17:39:44 +02:00
|
|
|
* @return the list items for status
|
2021-06-16 15:53:06 +02:00
|
|
|
* @throws Exception the exception
|
2021-06-14 17:39:44 +02:00
|
|
|
*/
|
2022-04-07 15:31:48 +02:00
|
|
|
public List<CatalogueDataset> getListItemsForStatus(ItemStatus theStatus, int offset, int limit,
|
2022-04-22 15:38:57 +02:00
|
|
|
boolean restrictedToLoggedInUser, String sortForField) throws Exception;
|
2021-06-14 17:39:44 +02:00
|
|
|
|
2021-06-16 15:53:06 +02:00
|
|
|
/**
|
|
|
|
* Gets the data for status.
|
|
|
|
*
|
2022-04-07 15:31:48 +02:00
|
|
|
* @param status the status
|
|
|
|
* @param offset the offset
|
|
|
|
* @param limit the limit
|
|
|
|
* @param serverStartIndex the server start index
|
|
|
|
* @param restrictedToLoggedInUser the restricted to logged in user
|
2022-05-04 15:15:54 +02:00
|
|
|
* @param sortForField the sort for field
|
2021-06-16 15:53:06 +02:00
|
|
|
* @return the data for status
|
2021-06-24 15:02:49 +02:00
|
|
|
* @throws Exception the exception
|
2021-06-16 15:53:06 +02:00
|
|
|
*/
|
2022-04-07 15:31:48 +02:00
|
|
|
public SearchedData getDataForStatus(ItemStatus status, int offset, int limit, int serverStartIndex,
|
2022-04-22 15:38:57 +02:00
|
|
|
boolean restrictedToLoggedInUser, String sortForField) throws Exception;
|
2021-06-16 15:53:06 +02:00
|
|
|
|
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
|
|
|
|
*/
|
2022-04-07 15:31:48 +02:00
|
|
|
public OperationReport approveItem(List<String> itemNames, String moderatorMessage) throws Exception;
|
2022-02-08 15:41:30 +01:00
|
|
|
|
2022-02-21 15:59:13 +01:00
|
|
|
/**
|
|
|
|
* Gets the CMS roles for user in the context.
|
|
|
|
*
|
|
|
|
* @return the CMS roles for user in the context
|
|
|
|
* @throws Exception the exception
|
|
|
|
*/
|
2022-04-07 15:31:48 +02:00
|
|
|
public ModerationUserRole getCMSRolesForUserInTheContext() throws Exception;
|
2022-02-22 14:48:17 +01:00
|
|
|
|
2022-02-23 16:22:50 +01:00
|
|
|
/**
|
|
|
|
* Checks if is moderation enabled.
|
|
|
|
*
|
|
|
|
* @param reloadConfig the reload config
|
|
|
|
* @return the boolean
|
|
|
|
*/
|
2022-04-07 15:31:48 +02:00
|
|
|
public Boolean isModerationEnabled(boolean reloadConfig);
|
2022-02-23 16:22:50 +01:00
|
|
|
|
2022-02-22 14:48:17 +01:00
|
|
|
/**
|
|
|
|
* Checks if is moderator role assigned.
|
|
|
|
*
|
2022-04-07 15:31:48 +02:00
|
|
|
* @return true, if is moderat@Override or role assigned
|
|
|
|
* @throws Exception the exception
|
|
|
|
*/
|
|
|
|
public Boolean isModeratorRoleAssigned() throws Exception;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Exists my item in moderation.
|
|
|
|
*
|
|
|
|
* @return true if the user has at least one item moderatorated or in
|
|
|
|
* moderation.
|
|
|
|
* @throws Exception the exception
|
2022-02-22 14:48:17 +01:00
|
|
|
*/
|
2022-04-07 15:31:48 +02:00
|
|
|
public Boolean existsMyItemInModeration() throws Exception;
|
2022-05-04 15:15:54 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the item for name.
|
|
|
|
*
|
|
|
|
* @param itemName the item name
|
|
|
|
* @return the item for name
|
|
|
|
* @throws Exception the exception
|
|
|
|
*/
|
|
|
|
CatalogueDataset getItemForName(String itemName) throws Exception;
|
2021-05-07 16:55:35 +02:00
|
|
|
}
|