ensure that the ckan connector add the user to the organizations first, then call the utility library

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/gcube-ckan-datacatalog@130672 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2016-07-22 07:55:35 +00:00
parent 1409810969
commit 5e0467a79a
1 changed files with 71 additions and 66 deletions

View File

@ -63,6 +63,7 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
Window.Location.getParameter(GCubeCkanDataCatalog.GET_PATH_PARAMETER); Window.Location.getParameter(GCubeCkanDataCatalog.GET_PATH_PARAMETER);
String queryParameter = String queryParameter =
Window.Location.getParameter(GCubeCkanDataCatalog.GET_QUERY_PARAMETER); Window.Location.getParameter(GCubeCkanDataCatalog.GET_QUERY_PARAMETER);
GCubeCkanDataCatalog.service.getCKanConnector( GCubeCkanDataCatalog.service.getCKanConnector(
pathParameter, queryParameter, pathParameter, queryParameter,
new AsyncCallback<CkanConnectorAccessPoint>() { new AsyncCallback<CkanConnectorAccessPoint>() {
@ -73,15 +74,8 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
ckanAccessPoint = ckan; ckanAccessPoint = ckan;
instanceCkanFrame(ckan.buildURI()); instanceCkanFrame(ckan.buildURI());
GCubeCkanDataCatalogPanel.this.rootPanel.remove(loading); GCubeCkanDataCatalogPanel.this.rootPanel.remove(loading);
}
@Override // now perform the other requests
public void onFailure(Throwable caught) {
GCubeCkanDataCatalogPanel.this.rootPanel.remove(loading);
Window.alert("Sorry, An error occurred during contacting Gcube Ckan Data Catalogue!");
}
});
GCubeCkanDataCatalog.service.outsidePortal(new AsyncCallback<Boolean>() { GCubeCkanDataCatalog.service.outsidePortal(new AsyncCallback<Boolean>() {
@Override @Override
@ -96,6 +90,7 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
else { else {
// polling for session expired check // polling for session expired check
CheckSession.getInstance().startPolling(); CheckSession.getInstance().startPolling();
// RETRIEVE USER'S ORGANIZATIONS // RETRIEVE USER'S ORGANIZATIONS
GCubeCkanDataCatalog.service.getCkanOrganizationsNamesAndUrlsForUser(new AsyncCallback<Map<String, String>>() { GCubeCkanDataCatalog.service.getCkanOrganizationsNamesAndUrlsForUser(new AsyncCallback<Map<String, String>>() {
@ -111,12 +106,13 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
} }
}); });
// MANAGE CKAN MANAGEMENT PANEL ACCORDING TO MY ROLE // MANAGE CKAN MANAGEMENT PANEL ACCORDING TO MY ROLE
GCubeCkanDataCatalog.service.getMyRole(new AsyncCallback<CkanRole>() { GCubeCkanDataCatalog.service.getMyRole(new AsyncCallback<CkanRole>() {
@Override @Override
public void onFailure(Throwable caught) { public void onFailure(Throwable caught) {
showEditInsertButtons(false);
} }
@Override @Override
@ -148,6 +144,15 @@ public class GCubeCkanDataCatalogPanel extends BaseViewTemplate {
managementPanel.doNotShowUserRelatedInfo(); managementPanel.doNotShowUserRelatedInfo();
} }
}); });
}
@Override
public void onFailure(Throwable caught) {
GCubeCkanDataCatalogPanel.this.rootPanel.remove(loading);
Window.alert("Sorry, An error occurred during contacting Gcube Ckan Data Catalogue!");
}
});
Window.addResizeHandler(new ResizeHandler() { Window.addResizeHandler(new ResizeHandler() {
@Override @Override