Visibility can now be set. Tags can only contain alpha numerical chars

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/widgets/ckan-metadata-publisher-widget@129063 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2016-06-10 15:16:42 +00:00
parent 9a95392ea1
commit 6cd048cba6
2 changed files with 11 additions and 6 deletions

View File

@ -542,7 +542,7 @@ public class CreateDatasetForm extends Composite{
// disable dataset fields
disableDatasetFields();
// disable reset
resetButton.setEnabled(false);
@ -564,10 +564,10 @@ public class CreateDatasetForm extends Composite{
// leave to back button, but remove create and add go to dataset
createButton.removeFromParent();
// set go to dataset as primary
goToDatasetButton.setType(ButtonType.PRIMARY);
}else{
// remove create button
@ -719,11 +719,11 @@ public class CreateDatasetForm extends Composite{
errorMessage = "Missing title";
return errorMessage;
}
// name reg expression
String regexName = "^[a-zA-Z\\s]+";
if(!validateByRegExpression(maintainerTextbox.getText(), regexName)){
errorMessage = "Not valid maintainer name"; // TODO
errorMessage = "Not valid maintainer name";
return errorMessage;
}
@ -852,6 +852,10 @@ public class CreateDatasetForm extends Composite{
if(tagsList.contains(itemBox.getValue()))
return;
// ckan accepts only alphanumeric values
if(!itemBox.getValue().matches("^[a-zA-Z0-9]*$"))
return;
final String value = itemBox.getValue();
final ListItem displayItem = new ListItem();
displayItem.setStyleName("tag-style");

View File

@ -551,11 +551,12 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
*/
private void setVisibility(DatasetMetadataBean created, String orgOwnerId) throws Exception{
logger.debug("Setting visibility of the dataset");
// set its visibility (true means public, false means private)
boolean mustbePrivate = !created.getVisibility();
String currentScope = getCurrentScope();
CKanUtilsFactory.getInstance().
getCkanUtilsForScope(currentScope).setDatasetPrivate(mustbePrivate, orgOwnerId, created.getId(), getCKANApikeyFromUser(created.getOwnerIdentifier()));
getCkanUtilsForScope(currentScope).setDatasetPrivate(mustbePrivate, orgOwnerId, created.getId(), created.getOwnerIdentifier());
}