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 Button addResourceButton;
|
||||||
@UiField AlertBlock infoBlock;
|
@UiField AlertBlock infoBlock;
|
||||||
@UiField Button goToDatasetButton;
|
@UiField Button goToDatasetButton;
|
||||||
|
|
||||||
public AddResourceToDataset(HandlerManager eventBus, String datasetId, String owner, final String datasetUrl) {
|
public AddResourceToDataset(HandlerManager eventBus, String datasetId, String owner, final String datasetUrl) {
|
||||||
initWidget(uiBinder.createAndBindUi(this));
|
initWidget(uiBinder.createAndBindUi(this));
|
||||||
|
|
||||||
|
@ -71,14 +71,14 @@ public class AddResourceToDataset extends Composite{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(ClickEvent event) {
|
public void onClick(ClickEvent event) {
|
||||||
String currentPath = Window.Location.getHref();
|
// String currentPath = Window.Location.getHref();
|
||||||
int datasetIndex = datasetUrl.indexOf("/dataset");
|
// int datasetIndex = datasetUrl.indexOf("/dataset");
|
||||||
if(datasetIndex == -1)
|
// if(datasetIndex == -1)
|
||||||
return;
|
// return;
|
||||||
|
//
|
||||||
String finalPart = datasetUrl.substring(datasetIndex);
|
// String finalPart = datasetUrl.substring(datasetIndex);
|
||||||
String finalPath = currentPath + "?" + "path" + "=" + finalPart;
|
// String finalPath = currentPath + "?" + "path" + "=" + finalPart;
|
||||||
Window.Location.assign(finalPath);
|
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();
|
UserManager liferUserManager = new LiferayUserManager();
|
||||||
GCubeUser userOwner = liferUserManager.getUserByUsername(owner);
|
GCubeUser userOwner = liferUserManager.getUserByUsername(owner);
|
||||||
|
|
||||||
|
|
||||||
// build bean
|
// build bean
|
||||||
logger.debug("Building bean");
|
logger.debug("Building bean");
|
||||||
bean = new DatasetMetadataBean();
|
bean = new DatasetMetadataBean();
|
||||||
|
@ -466,6 +465,7 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
|
||||||
|
|
||||||
ASLSession aslSession = getASLSession();
|
ASLSession aslSession = getASLSession();
|
||||||
String user = aslSession.getUsername();
|
String user = aslSession.getUsername();
|
||||||
|
CKanUtilsImpl utils = getCkanUtilsObj();
|
||||||
|
|
||||||
try{
|
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,
|
authorMail, maintainer, maintainerMail, version, description, licenseId,
|
||||||
listOfTags, customFields, resources, setPublic);
|
listOfTags, customFields, resources, setPublic);
|
||||||
|
|
||||||
|
@ -540,7 +540,7 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
|
||||||
toCreate.setId(datasetId);
|
toCreate.setId(datasetId);
|
||||||
|
|
||||||
// retrieve the url
|
// retrieve the url
|
||||||
String datasetUrl = getCkanUtilsObj().getUrlFromDatasetIdOrName(getUserCKanTokenFromSession(), datasetId);
|
String datasetUrl = utils.getPortletUrl() + "?path=" + utils.getUrlFromDatasetIdOrName(getUserCKanTokenFromSession(), datasetId, true);
|
||||||
|
|
||||||
toCreate.setSource(datasetUrl);
|
toCreate.setSource(datasetUrl);
|
||||||
return toCreate;
|
return toCreate;
|
||||||
|
|
Loading…
Reference in New Issue