use of edu.harvard.iq.dataverse.engine.command.impl.CreatePrivateUrlCommand in project dataverse by IQSS.
the class DatasetPage method createPrivateUrl.
public void createPrivateUrl() {
try {
PrivateUrl createdPrivateUrl = commandEngine.submit(new CreatePrivateUrlCommand(dvRequestService.getDataverseRequest(), dataset));
privateUrl = createdPrivateUrl;
JH.addMessage(FacesMessage.SEVERITY_INFO, BundleUtil.getStringFromBundle("dataset.privateurl.infoMessageAuthor", Arrays.asList(getPrivateUrlLink(privateUrl))));
privateUrlWasJustCreated = true;
} catch (CommandException ex) {
String msg = BundleUtil.getStringFromBundle("dataset.privateurl.noPermToCreate", PrivateUrlUtil.getRequiredPermissions(ex));
logger.info("Unable to create a Private URL for dataset id " + dataset.getId() + ". Message to user: " + msg + " Exception: " + ex);
JH.addErrorMessage(msg);
}
}
use of edu.harvard.iq.dataverse.engine.command.impl.CreatePrivateUrlCommand in project dataverse by IQSS.
the class PrivateUrlUtilTest method testGetRequiredPermissions.
@Test
public void testGetRequiredPermissions() {
CreatePrivateUrlCommand createPrivateUrlCommand = new CreatePrivateUrlCommand(null, null);
CommandException ex = new CommandException(null, createPrivateUrlCommand);
List<String> strings = PrivateUrlUtil.getRequiredPermissions(ex);
assertEquals(Arrays.asList("ManageDatasetPermissions"), strings);
}
Aggregations