2016-05-26 18:12:53 +02:00
|
|
|
package org.gcube.portlets.widgets.ckandatapublisherwidget.client;
|
|
|
|
|
2016-07-20 19:14:20 +02:00
|
|
|
import java.util.List;
|
|
|
|
|
2017-04-25 15:41:27 +02:00
|
|
|
import org.gcube.portlets.widgets.ckandatapublisherwidget.shared.DatasetBean;
|
|
|
|
import org.gcube.portlets.widgets.ckandatapublisherwidget.shared.OrganizationBean;
|
2016-11-09 19:13:39 +01:00
|
|
|
import org.gcube.portlets.widgets.ckandatapublisherwidget.shared.ResourceElementBean;
|
2024-02-02 17:09:09 +01:00
|
|
|
import org.gcube.portlets.widgets.mpformbuilder.shared.license.LicenseBean;
|
|
|
|
import org.gcube.portlets.widgets.mpformbuilder.shared.metadata.MetaDataProfileBean;
|
2016-05-26 18:12:53 +02:00
|
|
|
|
|
|
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* CKAN publisher services RPC.
|
2024-02-08 14:09:56 +01:00
|
|
|
*
|
2016-11-14 18:37:45 +01:00
|
|
|
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
|
2016-05-26 18:12:53 +02:00
|
|
|
*/
|
|
|
|
public interface CKanPublisherServiceAsync {
|
|
|
|
|
2016-06-06 17:24:52 +02:00
|
|
|
/**
|
|
|
|
* Retrieve the list of licenses to show to the user.
|
2024-02-08 14:09:56 +01:00
|
|
|
*
|
|
|
|
* @param callback the callback
|
2016-06-06 17:24:52 +02:00
|
|
|
* @return a LicenseBean on success, <b>null</b> on error.
|
|
|
|
*/
|
2017-04-25 15:41:27 +02:00
|
|
|
void getLicenses(AsyncCallback<List<LicenseBean>> callback);
|
2016-05-26 18:12:53 +02:00
|
|
|
|
2016-06-06 17:24:52 +02:00
|
|
|
/**
|
2017-02-22 17:40:16 +01:00
|
|
|
* Retrieve a partially filled bean given a folder id/file id and its owner.
|
2024-02-08 14:09:56 +01:00
|
|
|
*
|
2017-02-22 17:40:16 +01:00
|
|
|
* @param folderIdOrFileId the id of the folder of file to publish
|
2024-02-08 14:09:56 +01:00
|
|
|
* @param callback the callback
|
2016-06-06 17:24:52 +02:00
|
|
|
* @return @return a DatasetMetadataBean on success, <b>null</b> on error.
|
|
|
|
*/
|
2024-02-08 14:09:56 +01:00
|
|
|
void getDatasetBean(String folderIdOrFileId, AsyncCallback<DatasetBean> callback);
|
2016-05-27 19:08:03 +02:00
|
|
|
|
2016-06-06 17:24:52 +02:00
|
|
|
/**
|
2024-02-08 14:09:56 +01:00
|
|
|
* Try to create such dataset starting from the information contained into the
|
|
|
|
* toCreate bean.
|
|
|
|
*
|
|
|
|
* @param toCreate the to create
|
|
|
|
* @param callback the callback
|
2016-06-10 12:10:18 +02:00
|
|
|
* @return the sent bean full filled with the needed information
|
2016-06-06 17:24:52 +02:00
|
|
|
*/
|
2024-02-08 14:09:56 +01:00
|
|
|
void createCKanDataset(DatasetBean toCreate, AsyncCallback<DatasetBean> callback);
|
2016-06-07 17:50:33 +02:00
|
|
|
|
|
|
|
/**
|
2024-02-08 14:09:56 +01:00
|
|
|
* Add this resource to the dataset whose id is datasetId.
|
|
|
|
*
|
|
|
|
* @param resource the resource
|
|
|
|
* @param datasetId the dataset id
|
|
|
|
* @param callback the callback
|
2016-06-07 17:50:33 +02:00
|
|
|
*/
|
2016-11-09 19:13:39 +01:00
|
|
|
void addResourceToDataset(ResourceElementBean resource, String datasetId,
|
|
|
|
AsyncCallback<ResourceElementBean> callback);
|
2016-06-08 18:31:54 +02:00
|
|
|
|
|
|
|
/**
|
2024-02-08 14:09:56 +01:00
|
|
|
* Delete this resource from the dataset with id datasetId.
|
|
|
|
*
|
|
|
|
* @param resource the resource
|
|
|
|
* @param callback the callback
|
2016-06-08 18:31:54 +02:00
|
|
|
* @return <b>true</b> on success, false otherwise
|
|
|
|
*/
|
2016-11-09 19:13:39 +01:00
|
|
|
void deleteResourceFromDataset(ResourceElementBean resource, AsyncCallback<Boolean> callback);
|
2016-06-06 17:24:52 +02:00
|
|
|
|
2016-07-20 19:14:20 +02:00
|
|
|
/**
|
|
|
|
* Retrieve the list of profiles for a given organization name .
|
2024-02-08 14:09:56 +01:00
|
|
|
*
|
|
|
|
* @param orgName the org name
|
|
|
|
* @param callback the callback
|
2016-07-20 19:14:20 +02:00
|
|
|
* @return a List<MetaDataProfileBean> on success, <b>null</b> on error.
|
|
|
|
*/
|
|
|
|
void getProfiles(String orgName, AsyncCallback<List<MetaDataProfileBean>> callback);
|
|
|
|
|
2016-09-23 18:50:16 +02:00
|
|
|
/**
|
2024-02-08 14:09:56 +01:00
|
|
|
* Given the title the user wants to give to the new product to create, a check
|
|
|
|
* is performed to understand if a dataset with the proposed title (and so the
|
|
|
|
* id generated at server side) already exists.
|
|
|
|
*
|
|
|
|
* @param title the title
|
|
|
|
* @param orgName the org name
|
|
|
|
* @param callback the callback
|
2016-09-23 18:50:16 +02:00
|
|
|
* @return true if it exists, false otherwise
|
|
|
|
*/
|
2017-04-25 16:14:59 +02:00
|
|
|
void datasetIdAlreadyExists(String title, String orgName, AsyncCallback<Boolean> callback);
|
2016-09-23 18:50:16 +02:00
|
|
|
|
2024-02-08 14:09:56 +01:00
|
|
|
// /**
|
|
|
|
// * Return a tree object representing the whole folder hierarchy
|
|
|
|
// * @param folderId
|
|
|
|
// * @return ResourceElementBean
|
|
|
|
// */
|
|
|
|
// void getTreeFolder(String folderId,
|
|
|
|
// AsyncCallback<ResourceElementBean> callback);
|
2016-11-09 19:13:39 +01:00
|
|
|
|
2016-11-14 18:37:45 +01:00
|
|
|
/**
|
2024-02-08 14:09:56 +01:00
|
|
|
* Retrieve the list of groups the user can choose to associate this product
|
|
|
|
* with.
|
|
|
|
*
|
|
|
|
* @param orgName retrieve the groups in the context linked to this name. If
|
|
|
|
* null, returns the one in the current context.
|
|
|
|
* @param callback the callback
|
2016-11-14 18:37:45 +01:00
|
|
|
* @return a list of groups' beans
|
|
|
|
*/
|
2017-04-25 15:41:27 +02:00
|
|
|
void getUserGroups(String orgName, AsyncCallback<List<OrganizationBean>> callback);
|
2017-01-25 18:29:47 +01:00
|
|
|
|
|
|
|
/**
|
2024-02-08 14:09:56 +01:00
|
|
|
* Checks if is publisher user.
|
|
|
|
*
|
|
|
|
* @param callback the callback
|
2017-01-25 18:29:47 +01:00
|
|
|
*/
|
2024-02-08 14:09:56 +01:00
|
|
|
void isPublisherUser(AsyncCallback<Boolean> callback);
|
2017-04-25 15:41:27 +02:00
|
|
|
|
2017-04-25 15:52:37 +02:00
|
|
|
/**
|
2024-02-08 14:09:56 +01:00
|
|
|
* Get the list of vocabulary tags for this scope.
|
|
|
|
*
|
|
|
|
* @param orgName the org name
|
|
|
|
* @param callback the callback
|
|
|
|
* @return the tags for organization
|
2017-04-25 15:52:37 +02:00
|
|
|
*/
|
2024-02-08 14:09:56 +01:00
|
|
|
void getTagsForOrganization(String orgName, AsyncCallback<List<String>> callback);
|
2017-04-25 15:41:27 +02:00
|
|
|
|
2017-04-25 15:52:37 +02:00
|
|
|
/**
|
2024-02-08 14:09:56 +01:00
|
|
|
* Validate a geo json field.
|
|
|
|
*
|
|
|
|
* @param json the json
|
|
|
|
* @param callback the callback
|
2017-04-25 15:52:37 +02:00
|
|
|
*/
|
2017-04-25 15:41:27 +02:00
|
|
|
void isGeoJSONValid(String json, AsyncCallback<Boolean> callback);
|
2024-02-08 14:09:56 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Checks if is owner or admin user.
|
|
|
|
*
|
|
|
|
* @param datasetIdOrName the dataset id or name
|
|
|
|
* @param callback the callback
|
|
|
|
* @return true, if is owner or admin user
|
|
|
|
*/
|
|
|
|
void isPublisherOwnerOrAdminUser(String datasetIdOrName, AsyncCallback<Boolean> callback);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the dataset bean.
|
|
|
|
*
|
|
|
|
* @param itemID the item ID
|
|
|
|
* @return the dataset bean
|
|
|
|
* @throws Exception the exception
|
|
|
|
*/
|
|
|
|
void getDatasetBeanForUpdate(String itemID, AsyncCallback<DatasetBean> callback);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the profile for update.
|
|
|
|
*
|
|
|
|
* @param orgName the org name
|
|
|
|
* @param datasetType the dataset type
|
|
|
|
* @param datasedIdOrName the datased id or name
|
|
|
|
* @param callaback the callaback
|
|
|
|
* @return the profile for update
|
|
|
|
*/
|
|
|
|
void getProfileForUpdate(String orgName, String datasetType, String datasedIdOrName, AsyncCallback<List<MetaDataProfileBean>> callaback);
|
2016-05-26 18:12:53 +02:00
|
|
|
}
|