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.AsyncCallback;
|
|
|
|
|
2021-06-14 17:39:44 +02:00
|
|
|
/**
|
|
|
|
* The Interface CkanContentModeratorServiceAsync.
|
|
|
|
*
|
|
|
|
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
|
|
|
*
|
2022-02-18 14:17:19 +01:00
|
|
|
* Jan 11, 2022
|
2021-06-14 17:39:44 +02:00
|
|
|
*/
|
2021-05-07 16:55:35 +02:00
|
|
|
public interface CkanContentModeratorServiceAsync {
|
|
|
|
|
2022-02-08 15:41:30 +01:00
|
|
|
/**
|
|
|
|
* Reject item.
|
|
|
|
*
|
2022-02-18 14:17:19 +01:00
|
|
|
* @param itemNames the item names
|
2022-02-08 15:41:30 +01:00
|
|
|
* @param permanentlyDelete the permanently delete
|
2022-02-18 14:17:19 +01:00
|
|
|
* @param reasonMsg the reason msg
|
|
|
|
* @param callback the callback
|
2022-02-08 15:41:30 +01:00
|
|
|
*/
|
|
|
|
void rejectItem(List<String> itemNames, boolean permanentlyDelete, String reasonMsg,
|
|
|
|
AsyncCallback<OperationReport> callback);
|
2021-05-07 16:55:35 +02:00
|
|
|
|
2021-06-14 17:39:44 +02:00
|
|
|
/**
|
2021-06-24 15:02:49 +02:00
|
|
|
* Gets the list items for status.
|
2021-06-14 17:39:44 +02:00
|
|
|
*
|
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
|
|
|
|
* @param callback the callback
|
2021-06-24 15:02:49 +02:00
|
|
|
* @return the list items for status
|
2021-06-14 17:39:44 +02:00
|
|
|
*/
|
2022-04-07 15:31:48 +02:00
|
|
|
void getListItemsForStatus(ItemStatus theStatus, int offset, int limit, boolean restrictedToLoggedInUser,
|
2021-06-24 15:02:49 +02:00
|
|
|
AsyncCallback<List<CatalogueDataset>> callback);
|
2021-05-07 16:55:35 +02:00
|
|
|
|
2021-06-14 17:39:44 +02:00
|
|
|
/**
|
2021-06-24 15:02:49 +02:00
|
|
|
* Gets the data for status.
|
2021-06-14 17:39:44 +02:00
|
|
|
*
|
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
|
|
|
|
* @param asyncCallback the async callback
|
2021-06-24 15:02:49 +02:00
|
|
|
* @return the data for status
|
|
|
|
*/
|
2022-04-07 15:31:48 +02:00
|
|
|
void getDataForStatus(ItemStatus status, int offset, int limit, int serverStartIndex,
|
|
|
|
boolean restrictedToLoggedInUser, AsyncCallback<SearchedData> asyncCallback);
|
2021-06-24 15:02:49 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Approve item.
|
|
|
|
*
|
2022-02-18 14:17:19 +01:00
|
|
|
* @param itemNames the item names
|
2022-02-08 15:41:30 +01:00
|
|
|
* @param moderatorMessage the moderator message
|
2022-02-18 14:17:19 +01:00
|
|
|
* @param callback the callback
|
2021-06-14 17:39:44 +02:00
|
|
|
*/
|
2022-02-08 15:41:30 +01:00
|
|
|
void approveItem(List<String> itemNames, String moderatorMessage, AsyncCallback<OperationReport> callback);
|
2021-05-07 16:55:35 +02:00
|
|
|
|
2021-06-14 17:39:44 +02:00
|
|
|
/**
|
2021-06-24 15:02:49 +02:00
|
|
|
* Permanently delete.
|
2021-06-14 17:39:44 +02:00
|
|
|
*
|
2021-06-24 15:02:49 +02:00
|
|
|
* @param itemNames the item names
|
2022-02-18 14:17:19 +01:00
|
|
|
* @param callback the callback
|
2021-06-14 17:39:44 +02:00
|
|
|
*/
|
2022-02-08 15:41:30 +01:00
|
|
|
void permanentlyDelete(List<String> itemNames, AsyncCallback<OperationReport> callback);
|
2021-05-07 16:55:35 +02:00
|
|
|
|
2021-06-14 17:39:44 +02:00
|
|
|
/**
|
2021-06-24 15:02:49 +02:00
|
|
|
* Sets the status.
|
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
|
|
|
* @param callback the callback
|
2021-06-14 17:39:44 +02:00
|
|
|
*/
|
2022-02-18 14:17:19 +01:00
|
|
|
void setStatus(ItemStatus theStatus, List<String> itemNames, AsyncCallback<OperationReport> callback);
|
2021-06-16 15:53:06 +02:00
|
|
|
|
2022-02-21 15:59:13 +01:00
|
|
|
/**
|
|
|
|
* Gets the CMS roles for user in the context.
|
|
|
|
*
|
|
|
|
* @param callback the callback
|
|
|
|
* @return the CMS roles for user in the context
|
|
|
|
*/
|
|
|
|
void getCMSRolesForUserInTheContext(AsyncCallback<ModerationUserRole> callback);
|
|
|
|
|
2022-02-23 16:22:50 +01:00
|
|
|
/**
|
|
|
|
* Checks if is moderation enabled.
|
|
|
|
*
|
|
|
|
* @param reloadConfig the reload config
|
|
|
|
* @param callback the callback
|
|
|
|
*/
|
|
|
|
void isModerationEnabled(boolean reloadConfig, AsyncCallback<Boolean> callback);
|
|
|
|
|
2022-02-22 14:48:17 +01:00
|
|
|
/**
|
|
|
|
* Checks if is moderator role assigned.
|
|
|
|
*
|
|
|
|
* @param callback the callback
|
|
|
|
*/
|
|
|
|
void isModeratorRoleAssigned(AsyncCallback<Boolean> callback);
|
|
|
|
|
2022-04-07 15:31:48 +02:00
|
|
|
/**
|
|
|
|
* Exists my item in moderation.
|
|
|
|
*
|
|
|
|
* @param callback the callback
|
|
|
|
* @return true if the user has at least one item moderatorated or in
|
|
|
|
* moderation.
|
|
|
|
*/
|
|
|
|
void existsMyItemInModeration(AsyncCallback<Boolean> callback);
|
|
|
|
|
2021-05-07 16:55:35 +02:00
|
|
|
}
|