Interface CKanPublisherService
-
- All Superinterfaces:
com.google.gwt.user.client.rpc.RemoteService
- All Known Implementing Classes:
CKANPublisherServicesImpl
@RemoteServiceRelativePath("ckanservices") public interface CKanPublisherService extends com.google.gwt.user.client.rpc.RemoteServiceCKAN publisher services.- Author:
- Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ResourceElementBeanaddResourceToDataset(ResourceElementBean resource, String organizationName, String datasetId)Add this resource to the dataset whose id is datasetId.DatasetBeanbuildPartialDatasetBean(String folderIdOrFileId)Retrieve a partially filled bean given a folder id/file id and its owner.DatasetBeancreateCKanDataset(DatasetBean toCreate)Try to create such dataset starting from the information contained into the toCreate bean.booleandatasetIdAlreadyExists(String title, String orgName)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.booleandeleteItem(DatasetBean datasetBean)Delete item.booleandeleteResourceFromDataset(ResourceElementBean resource)Delete this resource from the dataset with id datasetId.DatasetBeangetBasicDatasetBean(String datasetIdOrName)Gets the basic dataset bean.DatasetBeangetDatasetBeanForUpdate(String itemID)Gets the dataset bean for update.List<org.gcube.portlets.widgets.mpformbuilder.shared.license.LicenseBean>getLicenses()Retrieve the list of licenses to show to the user.MetadataProfileBeanForUpdategetProfileForUpdate(String orgName, String datasetType, String datasedIdOrName)Gets the profile for update.List<org.gcube.portlets.widgets.mpformbuilder.shared.metadata.MetaDataProfileBean>getProfiles(String orgName)Retrieve the list of profiles for a given organization name .StringgetPublicLinkForFileItemId(String itemId, boolean shortenUrl)Gets the public link for file item id.List<String>getTagsForOrganization(String orgName)Get the list of vocabulary tags for this scope.List<OrganizationBean>getUserGroups(String orgName)Retrieve the list of groups the user can choose to associate this product with.booleanisGeoJSONValid(String json)Validate a geo json field.booleanisPublisherOwnerOrAdminUser(String datasetIdOrName)Checks if is owner or admin user.booleanisPublisherUser()The method checks if the user is a publisher or he/she doesn't have the rights to publish.DatasetBeanupdateCKANDataset(DatasetBean toUpdate)Update CKAN dataset.
-
-
-
Method Detail
-
getLicenses
List<org.gcube.portlets.widgets.mpformbuilder.shared.license.LicenseBean> getLicenses()
Retrieve the list of licenses to show to the user.- Returns:
- a LicenseBean on success, null on error.
-
getProfiles
List<org.gcube.portlets.widgets.mpformbuilder.shared.metadata.MetaDataProfileBean> getProfiles(String orgName) throws Exception
Retrieve the list of profiles for a given organization name .- Parameters:
orgName- the org name- Returns:
- a List
on success, null on error. - Throws:
Exception- the exception
-
buildPartialDatasetBean
DatasetBean buildPartialDatasetBean(String folderIdOrFileId) throws Exception
Retrieve a partially filled bean given a folder id/file id and its owner.- Parameters:
folderIdOrFileId- the id of the folder of file to publish- Returns:
- Throws:
Exception- the exception
-
createCKanDataset
DatasetBean createCKanDataset(DatasetBean toCreate) throws Exception
Try to create such dataset starting from the information contained into the toCreate bean.- Parameters:
toCreate- the to create- Returns:
- the sent bean filled with the needed information
- Throws:
Exception- the exception
-
addResourceToDataset
ResourceElementBean addResourceToDataset(ResourceElementBean resource, String organizationName, String datasetId) throws Exception
Add this resource to the dataset whose id is datasetId.- Parameters:
resource- the resourceorganizationName- the organization namedatasetId- the dataset id- Returns:
- the resource element bean
- Throws:
Exception- the exception
-
deleteResourceFromDataset
boolean deleteResourceFromDataset(ResourceElementBean resource) throws Exception
Delete this resource from the dataset with id datasetId.- Parameters:
resource- the resource- Returns:
- true on success, false otherwise
- Throws:
Exception- the exception
-
datasetIdAlreadyExists
boolean datasetIdAlreadyExists(String title, String orgName) throws Exception
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.- Parameters:
title- the titleorgName- the org name- Returns:
- true if it exists, false otherwise
- Throws:
Exception- the exception
-
getUserGroups
List<OrganizationBean> getUserGroups(String orgName)
Retrieve the list of groups the user can choose to associate this product with.- Parameters:
orgName- retrieve the groups in the context linked to this name. If null, returns the one in the current context.- Returns:
- a list of groups' beans
-
isPublisherUser
boolean isPublisherUser() throws ExceptionThe method checks if the user is a publisher or he/she doesn't have the rights to publish.- Returns:
- true if he/she can publish, false otherwise
- Throws:
Exception- the exception
-
getTagsForOrganization
List<String> getTagsForOrganization(String orgName) throws Exception
Get the list of vocabulary tags for this scope.- Parameters:
orgName- the org name- Returns:
- the tags for organization
- Throws:
Exception- the exception
-
isGeoJSONValid
boolean isGeoJSONValid(String json) throws Exception
Validate a geo json field.- Parameters:
json- the json- Returns:
- true, if is geo JSON valid
- Throws:
Exception- the exception
-
isPublisherOwnerOrAdminUser
boolean isPublisherOwnerOrAdminUser(String datasetIdOrName) throws Exception
Checks if is owner or admin user.- Parameters:
datasetIdOrName- the dataset id or name- Returns:
- true, if is owner or admin user
- Throws:
Exception- the exception
-
getDatasetBeanForUpdate
DatasetBean getDatasetBeanForUpdate(String itemID) throws Exception
Gets the dataset bean for update.- Parameters:
itemID- the item ID- Returns:
- the dataset bean for update
- Throws:
Exception- the exception
-
getProfileForUpdate
MetadataProfileBeanForUpdate getProfileForUpdate(String orgName, String datasetType, String datasedIdOrName) throws Exception
Gets the profile for update.- Parameters:
orgName- the org namedatasetType- the dataset typedatasedIdOrName- the datased id or name- Returns:
- the profile for update
- Throws:
Exception- the exception
-
updateCKANDataset
DatasetBean updateCKANDataset(DatasetBean toUpdate) throws Exception
Update CKAN dataset.- Parameters:
toUpdate- the to create- Returns:
- the dataset bean
- Throws:
Exception- the exception
-
getPublicLinkForFileItemId
String getPublicLinkForFileItemId(String itemId, boolean shortenUrl) throws Exception
Gets the public link for file item id.- Parameters:
itemId- the item idshortenUrl- the shorten url- Returns:
- the public link for file item id
- Throws:
Exception- the exception
-
getBasicDatasetBean
DatasetBean getBasicDatasetBean(String datasetIdOrName) throws Exception
Gets the basic dataset bean.- Parameters:
datasetIdOrName- the dataset id or name- Returns:
- the basic dataset bean
- Throws:
Exception- the exception
-
deleteItem
boolean deleteItem(DatasetBean datasetBean) throws Exception
Delete item.- Parameters:
datasetBean- the dataset bean- Returns:
- true, if successful
- Throws:
Exception- the exception
-
-