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:
parent
9a95392ea1
commit
6cd048cba6
|
@ -542,7 +542,7 @@ public class CreateDatasetForm extends Composite{
|
||||||
|
|
||||||
// disable dataset fields
|
// disable dataset fields
|
||||||
disableDatasetFields();
|
disableDatasetFields();
|
||||||
|
|
||||||
// disable reset
|
// disable reset
|
||||||
resetButton.setEnabled(false);
|
resetButton.setEnabled(false);
|
||||||
|
|
||||||
|
@ -564,10 +564,10 @@ public class CreateDatasetForm extends Composite{
|
||||||
|
|
||||||
// leave to back button, but remove create and add go to dataset
|
// leave to back button, but remove create and add go to dataset
|
||||||
createButton.removeFromParent();
|
createButton.removeFromParent();
|
||||||
|
|
||||||
// set go to dataset as primary
|
// set go to dataset as primary
|
||||||
goToDatasetButton.setType(ButtonType.PRIMARY);
|
goToDatasetButton.setType(ButtonType.PRIMARY);
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
// remove create button
|
// remove create button
|
||||||
|
@ -719,11 +719,11 @@ public class CreateDatasetForm extends Composite{
|
||||||
errorMessage = "Missing title";
|
errorMessage = "Missing title";
|
||||||
return errorMessage;
|
return errorMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
// name reg expression
|
// name reg expression
|
||||||
String regexName = "^[a-zA-Z\\s]+";
|
String regexName = "^[a-zA-Z\\s]+";
|
||||||
if(!validateByRegExpression(maintainerTextbox.getText(), regexName)){
|
if(!validateByRegExpression(maintainerTextbox.getText(), regexName)){
|
||||||
errorMessage = "Not valid maintainer name"; // TODO
|
errorMessage = "Not valid maintainer name";
|
||||||
return errorMessage;
|
return errorMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -852,6 +852,10 @@ public class CreateDatasetForm extends Composite{
|
||||||
if(tagsList.contains(itemBox.getValue()))
|
if(tagsList.contains(itemBox.getValue()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// ckan accepts only alphanumeric values
|
||||||
|
if(!itemBox.getValue().matches("^[a-zA-Z0-9]*$"))
|
||||||
|
return;
|
||||||
|
|
||||||
final String value = itemBox.getValue();
|
final String value = itemBox.getValue();
|
||||||
final ListItem displayItem = new ListItem();
|
final ListItem displayItem = new ListItem();
|
||||||
displayItem.setStyleName("tag-style");
|
displayItem.setStyleName("tag-style");
|
||||||
|
|
|
@ -551,11 +551,12 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
|
||||||
*/
|
*/
|
||||||
private void setVisibility(DatasetMetadataBean created, String orgOwnerId) throws Exception{
|
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)
|
// set its visibility (true means public, false means private)
|
||||||
boolean mustbePrivate = !created.getVisibility();
|
boolean mustbePrivate = !created.getVisibility();
|
||||||
String currentScope = getCurrentScope();
|
String currentScope = getCurrentScope();
|
||||||
CKanUtilsFactory.getInstance().
|
CKanUtilsFactory.getInstance().
|
||||||
getCkanUtilsForScope(currentScope).setDatasetPrivate(mustbePrivate, orgOwnerId, created.getId(), getCKANApikeyFromUser(created.getOwnerIdentifier()));
|
getCkanUtilsForScope(currentScope).setDatasetPrivate(mustbePrivate, orgOwnerId, created.getId(), created.getOwnerIdentifier());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue