Fixed redirection after product creation
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/widgets/ckan-metadata-publisher-widget@129632 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
d1c9c4e133
commit
418d7cb11a
|
@ -54,7 +54,7 @@ public class AddResourceToDataset extends Composite{
|
|||
@UiField Button addResourceButton;
|
||||
@UiField AlertBlock infoBlock;
|
||||
@UiField Button goToDatasetButton;
|
||||
|
||||
|
||||
public AddResourceToDataset(HandlerManager eventBus, String datasetId, String owner, final String datasetUrl) {
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
|
||||
|
@ -71,14 +71,14 @@ public class AddResourceToDataset extends Composite{
|
|||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
String currentPath = Window.Location.getHref();
|
||||
int datasetIndex = datasetUrl.indexOf("/dataset");
|
||||
if(datasetIndex == -1)
|
||||
return;
|
||||
|
||||
String finalPart = datasetUrl.substring(datasetIndex);
|
||||
String finalPath = currentPath + "?" + "path" + "=" + finalPart;
|
||||
Window.Location.assign(finalPath);
|
||||
// String currentPath = Window.Location.getHref();
|
||||
// int datasetIndex = datasetUrl.indexOf("/dataset");
|
||||
// if(datasetIndex == -1)
|
||||
// return;
|
||||
//
|
||||
// String finalPart = datasetUrl.substring(datasetIndex);
|
||||
// String finalPath = currentPath + "?" + "path" + "=" + finalPart;
|
||||
Window.Location.assign(datasetUrl);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -330,7 +330,6 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
|
|||
UserManager liferUserManager = new LiferayUserManager();
|
||||
GCubeUser userOwner = liferUserManager.getUserByUsername(owner);
|
||||
|
||||
|
||||
// build bean
|
||||
logger.debug("Building bean");
|
||||
bean = new DatasetMetadataBean();
|
||||
|
@ -466,6 +465,7 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
|
|||
|
||||
ASLSession aslSession = getASLSession();
|
||||
String user = aslSession.getUsername();
|
||||
CKanUtilsImpl utils = getCkanUtilsObj();
|
||||
|
||||
try{
|
||||
|
||||
|
@ -530,7 +530,7 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
|
|||
}
|
||||
|
||||
|
||||
String datasetId = getCkanUtilsObj().createCKanDataset(getUserCKanTokenFromSession(), withId, title, organizationNameOrId, author,
|
||||
String datasetId = utils.createCKanDataset(getUserCKanTokenFromSession(), withId, title, organizationNameOrId, author,
|
||||
authorMail, maintainer, maintainerMail, version, description, licenseId,
|
||||
listOfTags, customFields, resources, setPublic);
|
||||
|
||||
|
@ -540,7 +540,7 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
|
|||
toCreate.setId(datasetId);
|
||||
|
||||
// retrieve the url
|
||||
String datasetUrl = getCkanUtilsObj().getUrlFromDatasetIdOrName(getUserCKanTokenFromSession(), datasetId);
|
||||
String datasetUrl = utils.getPortletUrl() + "?path=" + utils.getUrlFromDatasetIdOrName(getUserCKanTokenFromSession(), datasetId, true);
|
||||
|
||||
toCreate.setSource(datasetUrl);
|
||||
return toCreate;
|
||||
|
|
Loading…
Reference in New Issue