Updated Detail Panel
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-map-widget@100835 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
8a3b6288f9
commit
330c49acfe
|
@ -6,9 +6,11 @@ package org.gcube.portlets.user.td.mapwidget.client;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsLockedException;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
|
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.licenses.LicenceData;
|
import org.gcube.portlets.user.td.gwtservice.shared.licenses.LicenceData;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.map.MapCreationSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.map.MapCreationSession;
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
|
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
||||||
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
|
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
|
||||||
|
@ -21,7 +23,6 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
import com.google.gwt.user.client.ui.VerticalPanel;
|
import com.google.gwt.user.client.ui.VerticalPanel;
|
||||||
import com.sencha.gxt.data.shared.loader.ListLoadConfig;
|
import com.sencha.gxt.data.shared.loader.ListLoadConfig;
|
||||||
import com.sencha.gxt.data.shared.loader.ListLoadResult;
|
import com.sencha.gxt.data.shared.loader.ListLoadResult;
|
||||||
import com.sencha.gxt.data.shared.loader.ListLoadResultBean;
|
|
||||||
import com.sencha.gxt.data.shared.loader.ListLoader;
|
import com.sencha.gxt.data.shared.loader.ListLoader;
|
||||||
import com.sencha.gxt.widget.core.client.FramedPanel;
|
import com.sencha.gxt.widget.core.client.FramedPanel;
|
||||||
import com.sencha.gxt.widget.core.client.box.AlertMessageBox;
|
import com.sencha.gxt.widget.core.client.box.AlertMessageBox;
|
||||||
|
@ -99,6 +100,7 @@ public class MapWidgetDetailCard extends WizardCard {
|
||||||
userName.setValue(mapCreationSession.getUsername());
|
userName.setValue(mapCreationSession.getUsername());
|
||||||
p.add(new FieldLabel(userName, "User Name"), new VerticalLayoutData(1,
|
p.add(new FieldLabel(userName, "User Name"), new VerticalLayoutData(1,
|
||||||
-1));
|
-1));
|
||||||
|
userName.setReadOnly(true);
|
||||||
|
|
||||||
metaAbstract = new TextField();
|
metaAbstract = new TextField();
|
||||||
metaAbstract.setAllowBlank(false);
|
metaAbstract.setAllowBlank(false);
|
||||||
|
@ -132,8 +134,11 @@ public class MapWidgetDetailCard extends WizardCard {
|
||||||
|
|
||||||
setContent(tableDetailPanel);
|
setContent(tableDetailPanel);
|
||||||
|
|
||||||
|
retrieveInfo();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
protected void loadData(ListLoadConfig loadConfig,
|
protected void loadData(ListLoadConfig loadConfig,
|
||||||
final AsyncCallback<ListLoadResult<LicenceData>> callback) {
|
final AsyncCallback<ListLoadResult<LicenceData>> callback) {
|
||||||
TDGWTServiceAsync.INSTANCE
|
TDGWTServiceAsync.INSTANCE
|
||||||
|
@ -164,6 +169,49 @@ public class MapWidgetDetailCard extends WizardCard {
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
protected void updateInfo(TabResource tabResource){
|
||||||
|
name.setValue(tabResource.getName());
|
||||||
|
metaAbstract.setValue(tabResource.getDescription());
|
||||||
|
forceLayout();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void retrieveInfo() {
|
||||||
|
|
||||||
|
TDGWTServiceAsync.INSTANCE.getTabResourceInformation(mapCreationSession.getTrId(), new AsyncCallback<TabResource>() {
|
||||||
|
|
||||||
|
public void onFailure(Throwable caught) {
|
||||||
|
if (caught instanceof TDGWTSessionExpiredException) {
|
||||||
|
getEventBus()
|
||||||
|
.fireEvent(
|
||||||
|
new SessionExpiredEvent(
|
||||||
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
|
} else {
|
||||||
|
if (caught instanceof TDGWTIsLockedException) {
|
||||||
|
Log.error("Error: "
|
||||||
|
+ caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3.alert("Error",
|
||||||
|
caught.getLocalizedMessage());
|
||||||
|
} else {
|
||||||
|
Log.error("Error retrieving tabular resource information:"
|
||||||
|
+ caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3.alert("Error",
|
||||||
|
"Error retrieving tabular resource information");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onSuccess(TabResource result) {
|
||||||
|
Log.debug("Retrieved: "+result);
|
||||||
|
updateInfo(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setup() {
|
public void setup() {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<ReleaseNotes>
|
<ReleaseNotes>
|
||||||
<Changeset component="${groupId}.${artifactId}.1-0-0"
|
<Changeset component="${groupId}.${artifactId}.1-0-0"
|
||||||
date="2014-02-01">
|
date="2014-10-31">
|
||||||
<Change>First Release</Change>
|
<Change>First Release</Change>
|
||||||
</Changeset>
|
</Changeset>
|
||||||
</ReleaseNotes>
|
</ReleaseNotes>
|
Loading…
Reference in New Issue