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:
parent
4d14d83409
commit
3c0f371ef2
|
@ -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>
|
||||
|
|
|
@ -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,20 +70,13 @@ 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>() {
|
||||
|
||||
@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.add(new CreateDatasetForm(eventBus));
|
||||
modal.setCloseVisible(true);
|
||||
modal.show();
|
||||
|
||||
|
@ -98,17 +89,6 @@ public class CkanEventHandlerManager {
|
|||
}
|
||||
});
|
||||
}
|
||||
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.");
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
// bind on edit (TODO)
|
||||
eventBus.addHandler(
|
||||
|
|
|
@ -36,12 +36,6 @@ public interface GcubeCkanDataCatalogService extends RemoteService {
|
|||
*/
|
||||
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
|
||||
* @return
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue