removed rpc call to check who's the current user

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/gcube-ckan-datacatalog@131734 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2016-09-23 10:41:40 +00:00
parent 4d14d83409
commit 3c0f371ef2
5 changed files with 16 additions and 54 deletions

View File

@ -4,6 +4,9 @@
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<dependent-module archiveName="ckan-metadata-publisher-widget-1.1.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/ckan-metadata-publisher-widget/ckan-metadata-publisher-widget">
<dependency-type>uses</dependency-type>
</dependent-module>
<property name="context-root" value="gcube-ckan-datacatalog"/>
<property name="java-output-path" value="/gcube-ckan-datacatalog/target/gcube-ckan-datacatalog-1.0.0-SNAPSHOT/WEB-INF/classes"/>
</wb-module>

View File

@ -28,8 +28,6 @@ import com.github.gwtbootstrap.client.ui.Modal;
import com.github.gwtbootstrap.client.ui.event.HideEvent;
import com.github.gwtbootstrap.client.ui.event.HideHandler;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
/**
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
@ -72,43 +70,25 @@ public class CkanEventHandlerManager {
eventBus.addHandler(InsertMetadataEvent.TYPE, new InsertMetadataEventHandler() {
@Override
public void onInsertMetadata(
InsertMetadataEvent loadSelecteReleaseEvent) {
public void onInsertMetadata(InsertMetadataEvent loadSelecteReleaseEvent) {
final Modal modal = new Modal(true, true);
// request who's doing the insert
GCubeCkanDataCatalog.service.getUser(new AsyncCallback<String>() {
modal.setTitle("Publish Product");
modal.addStyleName("insert-metadata-modal-style");
modal.add(new CreateDatasetForm(eventBus));
modal.setCloseVisible(true);
modal.show();
// hide any popup panel opened
modal.addHideHandler(new HideHandler() {
@Override
public void onSuccess(String username) {
if (username != null) {
modal.setTitle("Publish Product");
modal.addStyleName("insert-metadata-modal-style");
modal.add(new CreateDatasetForm(username, eventBus));
modal.setCloseVisible(true);
modal.show();
// hide any popup panel opened
modal.addHideHandler(new HideHandler() {
@Override
public void onHide(HideEvent hideEvent) {
eventBus.fireEvent(new CloseCreationFormEvent());
}
});
}
else
Window.alert("Please, logout and login again then retry.");
}
@Override
public void onFailure(Throwable caught) {
Window.alert("Please, logout and login again then retry.");
public void onHide(HideEvent hideEvent) {
eventBus.fireEvent(new CloseCreationFormEvent());
}
});
}
}
});
// bind on edit (TODO)
eventBus.addHandler(

View File

@ -35,12 +35,6 @@ public interface GcubeCkanDataCatalogService extends RemoteService {
* @throws Exception
*/
CkanRole getMyRole() throws Exception;
/**
* Get the current user's username
* @return
*/
String getUser();
/**
* Retrieve the list of organizations to whom the user belongs and their urls

View File

@ -21,8 +21,6 @@ public interface GcubeCkanDataCatalogServiceAsync {
void getMyRole(AsyncCallback<CkanRole> callback);
void getUser(AsyncCallback<String> callback);
void getCKanConnector(
String pathInfoParameters, String queryStringParameters, String currentUrl,
AsyncCallback<CkanConnectorAccessPoint> callback);

View File

@ -323,19 +323,6 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
return toReturn;
}
/* (non-Javadoc)
* @see org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.GcubeCkanDataCatalogService#getUser()
*/
@Override
public String getUser() {
HttpSession httpSession = this.getThreadLocalRequest().getSession();
String username = getASLSession(httpSession).getUsername();
logger.debug("User in session is " + username);
return username;
}
@Override
public String logoutURIFromCkan() {
HttpSession httpSession = this.getThreadLocalRequest().getSession();