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
|
||||
public DatasetMetadataBean createCKanDataset(DatasetMetadataBean toCreate, boolean isWorkspaceRequest) {
|
||||
|
||||
|
||||
logger.debug("Request for creating a dataset with these information " + toCreate);
|
||||
|
||||
try{
|
||||
|
||||
|
||||
String currentScope = ScopeProvider.instance.get();
|
||||
|
||||
// get the owner
|
||||
|
@ -383,42 +383,33 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
String datasetId = utilityInstance.createCKanDataset(username, withId, title, organizationNameOrId, author,
|
||||
authorMail, maintainer, maintainerMail, version, description, licenseId,
|
||||
listOfTags, customFields, resources, setPublic);
|
||||
authorMail, maintainer, maintainerMail, version, description, licenseId,
|
||||
listOfTags, customFields, resources, setPublic);
|
||||
|
||||
if(datasetId != null){
|
||||
|
||||
|
||||
logger.debug("Dataset created!");
|
||||
toCreate.setId(datasetId);
|
||||
|
||||
|
||||
// retrieve the url
|
||||
String datasetUrl = utilityInstance.getUrlFromDatasetIdOrName(username, datasetId);
|
||||
|
||||
|
||||
toCreate.setSource(datasetUrl);
|
||||
return toCreate;
|
||||
|
||||
|
||||
}else{
|
||||
|
||||
|
||||
logger.error("Failed to create the dataset");
|
||||
|
||||
|
||||
}
|
||||
|
||||
}catch(Exception e){
|
||||
logger.error("Unable to create the dataset", e);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ckan username has _ instead of . (that is, costantino.perciante -> costantino_perciante)
|
||||
* @param owner
|
||||
* @return
|
||||
*/
|
||||
private String fromOwnerToCKanOwner(String owner){
|
||||
return owner.replaceAll("\\.", "_");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -489,4 +480,13 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
|
|||
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