ckan-metadata-publisher-widget/src/main/java/org/gcube/portlets/widgets/ckandatapublisherwidget/client/CKanPublisherService.java

49 lines
1.5 KiB
Java

package org.gcube.portlets.widgets.ckandatapublisherwidget.client;
import org.gcube.portlets.widgets.ckandatapublisherwidget.shared.DatasetMetadataBean;
import org.gcube.portlets.widgets.ckandatapublisherwidget.shared.LicensesBean;
import org.gcube.portlets.widgets.ckandatapublisherwidget.shared.ResourceBean;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
/**
* CKAN publisher services.
* @author Costantino Perciante at ISTI-CNR
* (costantino.perciante@isti.cnr.it)
*/
@RemoteServiceRelativePath("ckanservices")
public interface CKanPublisherService extends RemoteService {
/**
* Retrieve the list of licenses to show to the user.
* @return a LicenseBean on success, <b>null</b> on error.
*/
LicensesBean getLicenses();
/**
* Retrieve a partially filled bean given a folder id and its owner.
* @param folderId
* @param owner
* @return @return a DatasetMetadataBean on success, <b>null</b> on error.
*/
DatasetMetadataBean getDatasetBean(String folderId, String owner);
/**
* Try to create such dataset starting from the information contained into the toCreate bean.
* @param toCreate
* @return the identifier of the created dataset or null on error
*/
String createCKanDataset(DatasetMetadataBean toCreate);
/**
* Add this resource to the dataset whose id is datasetId
* @param resource
* @param datasetId
* @param owner of the dataset
* @param callback
*/
boolean addResourceToDataset(ResourceBean resource, String datasetId, String owner);
}