minor fix
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/widgets/ckan-metadata-publisher-widget@129109 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
053daea14a
commit
e248cf0685
|
@ -321,11 +321,11 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DatasetMetadataBean createCKanDataset(DatasetMetadataBean toCreate, boolean isWorkspaceRequest) {
|
public DatasetMetadataBean createCKanDataset(DatasetMetadataBean toCreate, boolean isWorkspaceRequest) {
|
||||||
|
|
||||||
logger.debug("Request for creating a dataset with these information " + toCreate);
|
logger.debug("Request for creating a dataset with these information " + toCreate);
|
||||||
|
|
||||||
try{
|
try{
|
||||||
|
|
||||||
String currentScope = ScopeProvider.instance.get();
|
String currentScope = ScopeProvider.instance.get();
|
||||||
|
|
||||||
// get the owner
|
// get the owner
|
||||||
|
@ -383,42 +383,33 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
String datasetId = utilityInstance.createCKanDataset(username, withId, title, organizationNameOrId, author,
|
String datasetId = utilityInstance.createCKanDataset(username, withId, title, organizationNameOrId, author,
|
||||||
authorMail, maintainer, maintainerMail, version, description, licenseId,
|
authorMail, maintainer, maintainerMail, version, description, licenseId,
|
||||||
listOfTags, customFields, resources, setPublic);
|
listOfTags, customFields, resources, setPublic);
|
||||||
|
|
||||||
if(datasetId != null){
|
if(datasetId != null){
|
||||||
|
|
||||||
logger.debug("Dataset created!");
|
logger.debug("Dataset created!");
|
||||||
toCreate.setId(datasetId);
|
toCreate.setId(datasetId);
|
||||||
|
|
||||||
// retrieve the url
|
// retrieve the url
|
||||||
String datasetUrl = utilityInstance.getUrlFromDatasetIdOrName(username, datasetId);
|
String datasetUrl = utilityInstance.getUrlFromDatasetIdOrName(username, datasetId);
|
||||||
|
|
||||||
toCreate.setSource(datasetUrl);
|
toCreate.setSource(datasetUrl);
|
||||||
return toCreate;
|
return toCreate;
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
logger.error("Failed to create the dataset");
|
logger.error("Failed to create the dataset");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
logger.error("Unable to create the dataset", e);
|
logger.error("Unable to create the dataset", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
return null;
|
||||||
* Ckan username has _ instead of . (that is, costantino.perciante -> costantino_perciante)
|
|
||||||
* @param owner
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private String fromOwnerToCKanOwner(String owner){
|
|
||||||
return owner.replaceAll("\\.", "_");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -489,4 +480,13 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
|
||||||
return deleted;
|
return deleted;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ckan username has _ instead of . (that is, costantino.perciante -> costantino_perciante)
|
||||||
|
* @param owner
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private String fromOwnerToCKanOwner(String owner){
|
||||||
|
return owner.replaceAll("\\.", "_");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue