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:
Giancarlo Panichi 2014-10-22 08:26:35 +00:00 committed by Giancarlo Panichi
parent 8a3b6288f9
commit 330c49acfe
2 changed files with 52 additions and 4 deletions

View File

@ -6,9 +6,11 @@ package org.gcube.portlets.user.td.mapwidget.client;
import java.util.ArrayList;
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.licenses.LicenceData;
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.type.SessionExpiredType;
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.sencha.gxt.data.shared.loader.ListLoadConfig;
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.widget.core.client.FramedPanel;
import com.sencha.gxt.widget.core.client.box.AlertMessageBox;
@ -99,6 +100,7 @@ public class MapWidgetDetailCard extends WizardCard {
userName.setValue(mapCreationSession.getUsername());
p.add(new FieldLabel(userName, "User Name"), new VerticalLayoutData(1,
-1));
userName.setReadOnly(true);
metaAbstract = new TextField();
metaAbstract.setAllowBlank(false);
@ -129,11 +131,14 @@ public class MapWidgetDetailCard extends WizardCard {
1, -1));
tableDetailPanel.add(form);
setContent(tableDetailPanel);
retrieveInfo();
}
/*
protected void loadData(ListLoadConfig loadConfig,
final AsyncCallback<ListLoadResult<LicenceData>> callback) {
TDGWTServiceAsync.INSTANCE
@ -164,7 +169,50 @@ 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
public void setup() {
Command sayNextCard = new Command() {

View File

@ -1,6 +1,6 @@
<ReleaseNotes>
<Changeset component="${groupId}.${artifactId}.1-0-0"
date="2014-02-01">
date="2014-10-31">
<Change>First Release</Change>
</Changeset>
</ReleaseNotes>