Updated Share Template
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-portlet@113686 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
9cbe065f21
commit
76e3de370a
|
@ -12,6 +12,7 @@ import org.gcube.portlets.user.td.client.rstudio.RStudio;
|
|||
import org.gcube.portlets.user.td.client.template.TemplateApplyDialog;
|
||||
import org.gcube.portlets.user.td.client.template.TemplateDeleteDialog;
|
||||
import org.gcube.portlets.user.td.client.template.TemplateOpenDialog;
|
||||
import org.gcube.portlets.user.td.client.template.TemplateShareDialog;
|
||||
import org.gcube.portlets.user.td.codelistmappingimportwidget.client.CodelistMappingImportWizardTD;
|
||||
import org.gcube.portlets.user.td.columnwidget.client.batch.ReplaceBatchDialog;
|
||||
import org.gcube.portlets.user.td.columnwidget.client.replace.ReplaceAllDialog;
|
||||
|
@ -833,14 +834,14 @@ public class TabularDataController {
|
|||
case GENERATE_SUMMARY:
|
||||
break;
|
||||
case COLUMN_MULTI_FILTER:
|
||||
//Filter On multicolumn
|
||||
// Filter On multicolumn
|
||||
break;
|
||||
case COLUMN_REPLACE_BATCH:
|
||||
openColumnBatchReplace();
|
||||
break;
|
||||
case COLUMN_REPLACE_BY_EXPRESSION:
|
||||
openColumnReplaceByExpression();
|
||||
break;
|
||||
break;
|
||||
case COLUMN_REPLACE_BY_EXTERNAL_COL:
|
||||
openReplaceByExternalColWizard();
|
||||
break;
|
||||
|
@ -849,10 +850,10 @@ public class TabularDataController {
|
|||
break;
|
||||
case DUPLICATE_DELETE:
|
||||
openDuplicatesRows();
|
||||
break;
|
||||
break;
|
||||
case BYEXPRESSION_DELETE:
|
||||
openRowsDeleteByExpression();
|
||||
break;
|
||||
break;
|
||||
case ROW_ADD:
|
||||
doRowAdd();
|
||||
break;
|
||||
|
@ -894,10 +895,13 @@ public class TabularDataController {
|
|||
break;
|
||||
case TEMPLATE_DELETE:
|
||||
openTemplateDelete();
|
||||
break;
|
||||
break;
|
||||
case TEMPLATE_APPLY:
|
||||
openTemplateApply();
|
||||
break;
|
||||
break;
|
||||
case TEMPLATE_SHARE:
|
||||
openTemplateShare();
|
||||
break;
|
||||
case ANALYSE_TABLE_FILTER:
|
||||
break;
|
||||
case ANALYSE_TABLE_UNION:
|
||||
|
@ -932,7 +936,7 @@ public class TabularDataController {
|
|||
case CREATE_GIS_MAP:
|
||||
openCreateMapWizard();
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -1646,6 +1650,22 @@ public class TabularDataController {
|
|||
|
||||
}
|
||||
|
||||
private void openTemplateShare() {
|
||||
GWT.runAsync(new RunAsyncCallback() {
|
||||
public void onSuccess() {
|
||||
Log.debug("Template Share call");
|
||||
TemplateShareDialog tsDialog = new TemplateShareDialog(eventBus);
|
||||
tsDialog.show();
|
||||
|
||||
}
|
||||
|
||||
public void onFailure(Throwable reason) {
|
||||
asyncCodeLoadingFailed(reason);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void openShareWindow() {
|
||||
GWT.runAsync(new RunAsyncCallback() {
|
||||
public void onSuccess() {
|
||||
|
@ -1704,14 +1724,10 @@ public class TabularDataController {
|
|||
UtilsGXT3.alert("Error", "No current tabular resource present");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void openColumnFilter(){
|
||||
openColumnFilter(null,null);
|
||||
|
||||
private void openColumnFilter() {
|
||||
openColumnFilter(null, null);
|
||||
}
|
||||
|
||||
|
||||
private void openColumnFilter(String columnLocalId, String columnName) {
|
||||
Log.debug("Request Open Column Filter Dialog");
|
||||
|
@ -1725,30 +1741,27 @@ public class TabularDataController {
|
|||
}
|
||||
}
|
||||
|
||||
private void openRowsDeleteByExpression(){
|
||||
openRowsDeleteByExpression(null,null);
|
||||
private void openRowsDeleteByExpression() {
|
||||
openRowsDeleteByExpression(null, null);
|
||||
}
|
||||
|
||||
|
||||
private void openRowsDeleteByExpression(String columnLocalId, String columnName) {
|
||||
private void openRowsDeleteByExpression(String columnLocalId,
|
||||
String columnName) {
|
||||
Log.debug("Request Open Row Delete By Expression Dialog");
|
||||
if (trId != null) {
|
||||
RowsDeleteByExpressionDialog cfDialog = new RowsDeleteByExpressionDialog(trId,
|
||||
columnLocalId, eventBus);
|
||||
RowsDeleteByExpressionDialog cfDialog = new RowsDeleteByExpressionDialog(
|
||||
trId, columnLocalId, eventBus);
|
||||
cfDialog.show();
|
||||
} else {
|
||||
Log.error("TRId is null");
|
||||
UtilsGXT3.alert("Error", "No current tabular resource present");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void openColumnReplaceByExpression(){
|
||||
openColumnReplaceByExpression(null,null);
|
||||
|
||||
private void openColumnReplaceByExpression() {
|
||||
openColumnReplaceByExpression(null, null);
|
||||
}
|
||||
|
||||
|
||||
private void openColumnReplaceByExpression(String columnLocalId,
|
||||
String columnName) {
|
||||
Log.debug("Request Open Replace Column By Expression Dialog");
|
||||
|
@ -1822,7 +1835,6 @@ public class TabularDataController {
|
|||
cloneTR.cloneTR();
|
||||
}
|
||||
|
||||
|
||||
private void openColumnBatchReplace() {
|
||||
openColumnBatchReplace(null, null);
|
||||
}
|
||||
|
@ -2219,8 +2231,8 @@ public class TabularDataController {
|
|||
if (cellData == null) {
|
||||
UtilsGXT3.alert("No cell selected", "No cell selected");
|
||||
} else {
|
||||
ReplaceAllDialog replaceDialog = new ReplaceAllDialog(cellData, trId,
|
||||
eventBus);
|
||||
ReplaceAllDialog replaceDialog = new ReplaceAllDialog(cellData,
|
||||
trId, eventBus);
|
||||
replaceDialog.show();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@ public class TemplateToolBar {
|
|||
private TextButton templateOpenButton;
|
||||
private TextButton templateDeleteButton;
|
||||
private TextButton templateApplyButton;
|
||||
private TextButton templateShareButton;
|
||||
|
||||
|
||||
public TemplateToolBar(EventBus eventBus) {
|
||||
|
@ -139,6 +140,24 @@ public class TemplateToolBar {
|
|||
|
||||
templateLayout.setWidget(0, 3, templateApplyButton);
|
||||
templateLayout.getFlexCellFormatter().setRowSpan(0, 3, 2);
|
||||
|
||||
|
||||
templateShareButton = new TextButton("Share",
|
||||
TabularDataResources.INSTANCE.templateShare32());
|
||||
templateShareButton.enable();
|
||||
templateShareButton.setScale(ButtonScale.LARGE);
|
||||
templateShareButton.setIconAlign(IconAlign.TOP);
|
||||
templateShareButton.setToolTip("Share Template");
|
||||
templateShareButton.setArrowAlign(ButtonArrowAlign.BOTTOM);
|
||||
templateShareButton.addSelectHandler(new SelectHandler() {
|
||||
|
||||
public void onSelect(SelectEvent event) {
|
||||
eventBus.fireEvent(new RibbonEvent(RibbonType.TEMPLATE_SHARE));
|
||||
}
|
||||
});
|
||||
|
||||
templateLayout.setWidget(0, 4, templateShareButton);
|
||||
templateLayout.getFlexCellFormatter().setRowSpan(0, 4, 2);
|
||||
|
||||
cleanCells(templateLayout.getElement());
|
||||
|
||||
|
@ -173,6 +192,7 @@ public class TemplateToolBar {
|
|||
templateNewButton.enable();
|
||||
templateDeleteButton.enable();
|
||||
templateApplyButton.disable();
|
||||
templateShareButton.enable();
|
||||
break;
|
||||
case TR_CLOSE:
|
||||
case TR_READONLY:
|
||||
|
@ -180,6 +200,7 @@ public class TemplateToolBar {
|
|||
templateNewButton.enable();
|
||||
templateDeleteButton.enable();
|
||||
templateApplyButton.disable();
|
||||
templateShareButton.enable();
|
||||
break;
|
||||
case TR_OPEN:
|
||||
case TABLEUPDATE:
|
||||
|
@ -188,12 +209,14 @@ public class TemplateToolBar {
|
|||
templateNewButton.enable();
|
||||
templateDeleteButton.enable();
|
||||
templateApplyButton.enable();
|
||||
templateShareButton.enable();
|
||||
break;
|
||||
case WIZARD_OPEN:
|
||||
templateOpenButton.disable();
|
||||
templateNewButton.disable();
|
||||
templateDeleteButton.disable();
|
||||
templateApplyButton.disable();
|
||||
templateShareButton.disable();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
@ -32,14 +32,11 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
|||
*/
|
||||
public class TemplateApplyDialog extends Window implements
|
||||
MonitorDialogListener {
|
||||
protected String WIDTH = "720px";
|
||||
protected String HEIGHT = "530px";
|
||||
protected TemplateApplySession templateApplySession;
|
||||
protected TRId trId;
|
||||
protected EventBus eventBus;
|
||||
private static final String WIDTH = "720px";
|
||||
private static final String HEIGHT = "530px";
|
||||
private EventBus eventBus;
|
||||
|
||||
public TemplateApplyDialog(TRId trId, EventBus eventBus) {
|
||||
this.trId = trId;
|
||||
this.eventBus = eventBus;
|
||||
initWindow();
|
||||
|
||||
|
@ -82,7 +79,7 @@ public class TemplateApplyDialog extends Window implements
|
|||
}
|
||||
|
||||
protected void applyTemplate(final TemplateApplySession templateApplySession) {
|
||||
this.templateApplySession = templateApplySession;
|
||||
|
||||
|
||||
TDGWTServiceAsync.INSTANCE.startTemplateApply(templateApplySession,
|
||||
new AsyncCallback<String>() {
|
||||
|
|
|
@ -5,9 +5,12 @@ import java.util.List;
|
|||
|
||||
import org.gcube.portlets.user.td.client.resource.TabularDataResources;
|
||||
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.template.TemplateApplySession;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.template.TemplateData;
|
||||
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
|
||||
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.shared.TRId;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
|
@ -53,24 +56,24 @@ import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
|
|||
|
||||
/**
|
||||
*
|
||||
* @author giancarlo
|
||||
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
* @author giancarlo email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class TemplateApplyPanel extends FramedPanel {
|
||||
protected String WIDTH = "630px";
|
||||
protected String HEIGHT = "520px";
|
||||
protected EventBus eventBus;
|
||||
protected TemplateApplyDialog parent;
|
||||
protected TRId trId;
|
||||
protected TemplateApplySession templateApplySession;
|
||||
private static final String WIDTH = "630px";
|
||||
private static final String HEIGHT = "520px";
|
||||
private EventBus eventBus;
|
||||
private TemplateApplyDialog parent;
|
||||
private TRId trId;
|
||||
private TemplateApplySession templateApplySession;
|
||||
|
||||
private TextButton btnApply;
|
||||
private TextButton btnClose;
|
||||
|
||||
protected ListLoader<ListLoadConfig, ListLoadResult<TemplateData>> loader;
|
||||
protected Grid<TemplateData> grid;
|
||||
protected ExtendedListStore<TemplateData> store;
|
||||
private ListLoader<ListLoadConfig, ListLoadResult<TemplateData>> loader;
|
||||
private Grid<TemplateData> grid;
|
||||
private ExtendedListStore<TemplateData> store;
|
||||
|
||||
public TemplateApplyPanel(TemplateApplyDialog parent, TRId trId,
|
||||
EventBus eventBus) {
|
||||
|
@ -92,14 +95,13 @@ public class TemplateApplyPanel extends FramedPanel {
|
|||
toolBarHead.add(new LabelToolItem("Search: "));
|
||||
final TextField searchField = new TextField();
|
||||
toolBarHead.add(searchField);
|
||||
|
||||
|
||||
TextButton btnReload = new TextButton();
|
||||
//btnReload.setText("Reload");
|
||||
// btnReload.setText("Reload");
|
||||
btnReload.setIcon(TabularDataResources.INSTANCE.refresh());
|
||||
btnReload.setToolTip("Reload");
|
||||
toolBarHead.add(btnReload);
|
||||
|
||||
|
||||
|
||||
IdentityValueProvider<TemplateData> identity = new IdentityValueProvider<TemplateData>();
|
||||
CheckBoxSelectionModel<TemplateData> sm = new CheckBoxSelectionModel<TemplateData>(
|
||||
identity);
|
||||
|
@ -110,10 +112,10 @@ public class TemplateApplyPanel extends FramedPanel {
|
|||
props.name(), 120, "Name");
|
||||
ColumnConfig<TemplateData, String> categoryCol = new ColumnConfig<TemplateData, String>(
|
||||
props.category(), 60, "Category");
|
||||
|
||||
|
||||
ColumnConfig<TemplateData, String> ownerCol = new ColumnConfig<TemplateData, String>(
|
||||
props.ownerLogin(), 70, "Owner");
|
||||
|
||||
|
||||
ColumnConfig<TemplateData, String> agencyCol = new ColumnConfig<TemplateData, String>(
|
||||
props.agency(), 100, "Agency");
|
||||
|
||||
|
@ -134,24 +136,24 @@ public class TemplateApplyPanel extends FramedPanel {
|
|||
searchField.addKeyUpHandler(new KeyUpHandler() {
|
||||
|
||||
public void onKeyUp(KeyUpEvent event) {
|
||||
Log.trace("searchTerm: "+searchField.getCurrentValue());
|
||||
store.applyFilters();
|
||||
Log.trace("searchTerm: " + searchField.getCurrentValue());
|
||||
store.applyFilters();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
store.addFilter(new StoreFilter<TemplateData>() {
|
||||
|
||||
@Override
|
||||
public boolean select(Store<TemplateData> store,
|
||||
TemplateData parent, TemplateData item) {
|
||||
String searchTerm = searchField.getCurrentValue();
|
||||
if (searchTerm == null) return true;
|
||||
if (searchTerm == null)
|
||||
return true;
|
||||
return TemplateApplyPanel.this.select(item, searchTerm);
|
||||
}
|
||||
});
|
||||
|
||||
store.setEnableFilters(true);
|
||||
|
||||
|
||||
RpcProxy<ListLoadConfig, ListLoadResult<TemplateData>> proxy = new RpcProxy<ListLoadConfig, ListLoadResult<TemplateData>>() {
|
||||
|
||||
|
@ -167,16 +169,15 @@ public class TemplateApplyPanel extends FramedPanel {
|
|||
loader.addLoadHandler(new LoadResultListStoreBinding<ListLoadConfig, TemplateData, ListLoadResult<TemplateData>>(
|
||||
store) {
|
||||
});
|
||||
|
||||
|
||||
|
||||
SelectHandler sh = new SelectHandler() {
|
||||
public void onSelect(SelectEvent event) {
|
||||
loader.load();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
btnReload.addSelectHandler(sh);
|
||||
|
||||
|
||||
grid = new Grid<TemplateData>(store, cm) {
|
||||
@Override
|
||||
protected void onAfterFirstAttach() {
|
||||
|
@ -202,10 +203,7 @@ public class TemplateApplyPanel extends FramedPanel {
|
|||
grid.setColumnReordering(true);
|
||||
grid.setColumnResize(true);
|
||||
grid.getView().setAutoExpandColumn(descriptionCol);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ToolBar toolBar = new ToolBar();
|
||||
toolBar.add(grid);
|
||||
toolBar.addStyleName(ThemeStyles.get().style().borderTop());
|
||||
|
@ -247,8 +245,8 @@ public class TemplateApplyPanel extends FramedPanel {
|
|||
v.add(toolBarHead, new VerticalLayoutData(1, -1, new Margins(0)));
|
||||
v.add(grid, new VerticalLayoutData(-1, -1, new Margins(0)));
|
||||
v.add(toolBar, new VerticalLayoutData(1, 25, new Margins(0)));
|
||||
v.add(flowButton, new VerticalLayoutData(1, 36,
|
||||
new Margins(5, 2, 5, 2)));
|
||||
v.add(flowButton,
|
||||
new VerticalLayoutData(1, 36, new Margins(5, 2, 5, 2)));
|
||||
add(v);
|
||||
|
||||
}
|
||||
|
@ -260,10 +258,15 @@ public class TemplateApplyPanel extends FramedPanel {
|
|||
.getTemplates(new AsyncCallback<ArrayList<TemplateData>>() {
|
||||
|
||||
public void onFailure(Throwable caught) {
|
||||
Log.error("load templates failure:"
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error retrieving templates",
|
||||
"Error retrieving templates");
|
||||
if (caught instanceof TDGWTSessionExpiredException) {
|
||||
eventBus.fireEvent(new SessionExpiredEvent(
|
||||
SessionExpiredType.EXPIREDONSERVER));
|
||||
} else {
|
||||
Log.error("Load templates failure:"
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error retrieving templates",
|
||||
"Error retrieving templates");
|
||||
}
|
||||
callback.onFailure(caught);
|
||||
}
|
||||
|
||||
|
@ -277,25 +280,7 @@ public class TemplateApplyPanel extends FramedPanel {
|
|||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* protected void setMenu() { Menu contextMenu = new Menu();
|
||||
*
|
||||
* MenuItem deleteTemplateItem = new MenuItem("Delete");
|
||||
* deleteTemplateItem.setId("DeleteTemplate");
|
||||
* deleteTemplateItem.setIcon(TabularDataResources.INSTANCE.removeTemplate());
|
||||
* deleteTemplateItem.addSelectionHandler(new SelectionHandler<Item>() {
|
||||
*
|
||||
* @Override public void onSelection(SelectionEvent<Item> event) {
|
||||
* Log.debug("Delete Template"); TemplateData templateDesc =
|
||||
* getSelectedItem();
|
||||
*
|
||||
* } });
|
||||
*
|
||||
* grid.setContextMenu(contextMenu); }
|
||||
*/
|
||||
|
||||
|
||||
protected TemplateData getSelectedItem() {
|
||||
return grid.getSelectionModel().getSelectedItem();
|
||||
|
@ -317,29 +302,40 @@ public class TemplateApplyPanel extends FramedPanel {
|
|||
protected void close() {
|
||||
parent.close();
|
||||
}
|
||||
|
||||
|
||||
protected class ExtendedListStore<M> extends ListStore<M> {
|
||||
|
||||
public ExtendedListStore(ModelKeyProvider<? super M> keyProvider) {
|
||||
super(keyProvider);
|
||||
}
|
||||
|
||||
public void applyFilters()
|
||||
{
|
||||
public void applyFilters() {
|
||||
super.applyFilters();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void gridReload(){
|
||||
|
||||
public void gridReload() {
|
||||
grid.getLoader().load();
|
||||
}
|
||||
|
||||
|
||||
protected boolean select(TemplateData item, String searchTerm) {
|
||||
if (item.getName()!=null && item.getName().toLowerCase().contains(searchTerm.toLowerCase())) return true;
|
||||
if (item.getCategory()!=null &&item.getCategory().toLowerCase().contains(searchTerm.toLowerCase())) return true;
|
||||
if (item.getAgency()!=null &&item.getAgency().toLowerCase().contains(searchTerm.toLowerCase())) return true;
|
||||
if (item.getDescription()!=null && item.getDescription().toLowerCase().contains(searchTerm.toLowerCase())) return true;
|
||||
if (item.getName() != null
|
||||
&& item.getName().toLowerCase()
|
||||
.contains(searchTerm.toLowerCase()))
|
||||
return true;
|
||||
if (item.getCategory() != null
|
||||
&& item.getCategory().toLowerCase()
|
||||
.contains(searchTerm.toLowerCase()))
|
||||
return true;
|
||||
if (item.getAgency() != null
|
||||
&& item.getAgency().toLowerCase()
|
||||
.contains(searchTerm.toLowerCase()))
|
||||
return true;
|
||||
if (item.getDescription() != null
|
||||
&& item.getDescription().toLowerCase()
|
||||
.contains(searchTerm.toLowerCase()))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -23,10 +23,9 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
|||
*
|
||||
*/
|
||||
public class TemplateDeleteDialog extends Window {
|
||||
protected String WIDTH = "720px";
|
||||
protected String HEIGHT = "530px";
|
||||
protected TemplateDeleteSession templateDeleteSession;
|
||||
protected EventBus eventBus;
|
||||
private static final String WIDTH = "720px";
|
||||
private static final String HEIGHT = "530px";
|
||||
private EventBus eventBus;
|
||||
|
||||
public TemplateDeleteDialog(EventBus eventBus) {
|
||||
this.eventBus = eventBus;
|
||||
|
@ -72,7 +71,7 @@ public class TemplateDeleteDialog extends Window {
|
|||
|
||||
protected void templatesDelete(
|
||||
final TemplateDeleteSession templateDeleteSession) {
|
||||
this.templateDeleteSession = templateDeleteSession;
|
||||
|
||||
|
||||
TDGWTServiceAsync.INSTANCE.templateDelete(templateDeleteSession,
|
||||
new AsyncCallback<Void>() {
|
||||
|
|
|
@ -5,9 +5,12 @@ import java.util.List;
|
|||
|
||||
import org.gcube.portlets.user.td.client.resource.TabularDataResources;
|
||||
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.template.TemplateData;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.template.TemplateDeleteSession;
|
||||
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
|
@ -51,21 +54,20 @@ import com.sencha.gxt.widget.core.client.toolbar.LabelToolItem;
|
|||
import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
|
||||
|
||||
public class TemplateDeletePanel extends FramedPanel {
|
||||
protected String WIDTH = "630px";
|
||||
protected String HEIGHT = "520px";
|
||||
protected EventBus eventBus;
|
||||
protected TemplateDeleteDialog parent;
|
||||
protected TemplateDeleteSession templateDeleteSession;
|
||||
private static final String WIDTH = "630px";
|
||||
private static final String HEIGHT = "520px";
|
||||
private EventBus eventBus;
|
||||
private TemplateDeleteDialog parent;
|
||||
private TemplateDeleteSession templateDeleteSession;
|
||||
|
||||
private TextButton btnDelete;
|
||||
private TextButton btnClose;
|
||||
|
||||
protected ListLoader<ListLoadConfig, ListLoadResult<TemplateData>> loader;
|
||||
protected Grid<TemplateData> grid;
|
||||
protected ExtendedListStore<TemplateData> store;
|
||||
|
||||
public TemplateDeletePanel(TemplateDeleteDialog parent,
|
||||
EventBus eventBus) {
|
||||
private ListLoader<ListLoadConfig, ListLoadResult<TemplateData>> loader;
|
||||
private Grid<TemplateData> grid;
|
||||
private ExtendedListStore<TemplateData> store;
|
||||
|
||||
public TemplateDeletePanel(TemplateDeleteDialog parent, EventBus eventBus) {
|
||||
this.parent = parent;
|
||||
Log.debug("TemplateDeletePanel");
|
||||
setWidth(WIDTH);
|
||||
|
@ -83,15 +85,13 @@ public class TemplateDeletePanel extends FramedPanel {
|
|||
toolBarHead.add(new LabelToolItem("Search: "));
|
||||
final TextField searchField = new TextField();
|
||||
toolBarHead.add(searchField);
|
||||
|
||||
|
||||
TextButton btnReload = new TextButton();
|
||||
//btnReload.setText("Reload");
|
||||
// btnReload.setText("Reload");
|
||||
btnReload.setIcon(TabularDataResources.INSTANCE.refresh());
|
||||
btnReload.setToolTip("Reload");
|
||||
toolBarHead.add(btnReload);
|
||||
|
||||
|
||||
|
||||
|
||||
IdentityValueProvider<TemplateData> identity = new IdentityValueProvider<TemplateData>();
|
||||
CheckBoxSelectionModel<TemplateData> sm = new CheckBoxSelectionModel<TemplateData>(
|
||||
identity);
|
||||
|
@ -102,10 +102,10 @@ public class TemplateDeletePanel extends FramedPanel {
|
|||
props.name(), 120, "Name");
|
||||
ColumnConfig<TemplateData, String> categoryCol = new ColumnConfig<TemplateData, String>(
|
||||
props.category(), 60, "Category");
|
||||
|
||||
|
||||
ColumnConfig<TemplateData, String> ownerCol = new ColumnConfig<TemplateData, String>(
|
||||
props.ownerLogin(), 70, "Owner");
|
||||
|
||||
|
||||
ColumnConfig<TemplateData, String> agencyCol = new ColumnConfig<TemplateData, String>(
|
||||
props.agency(), 100, "Agency");
|
||||
|
||||
|
@ -120,30 +120,30 @@ public class TemplateDeletePanel extends FramedPanel {
|
|||
l.add(descriptionCol);
|
||||
|
||||
ColumnModel<TemplateData> cm = new ColumnModel<TemplateData>(l);
|
||||
|
||||
|
||||
store = new ExtendedListStore<TemplateData>(props.id());
|
||||
|
||||
searchField.addKeyUpHandler(new KeyUpHandler() {
|
||||
|
||||
public void onKeyUp(KeyUpEvent event) {
|
||||
Log.trace("searchTerm: "+searchField.getCurrentValue());
|
||||
store.applyFilters();
|
||||
Log.trace("searchTerm: " + searchField.getCurrentValue());
|
||||
store.applyFilters();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
store.addFilter(new StoreFilter<TemplateData>() {
|
||||
|
||||
@Override
|
||||
public boolean select(Store<TemplateData> store,
|
||||
TemplateData parent, TemplateData item) {
|
||||
String searchTerm = searchField.getCurrentValue();
|
||||
if (searchTerm == null) return true;
|
||||
if (searchTerm == null)
|
||||
return true;
|
||||
return TemplateDeletePanel.this.select(item, searchTerm);
|
||||
}
|
||||
});
|
||||
|
||||
store.setEnableFilters(true);
|
||||
|
||||
|
||||
RpcProxy<ListLoadConfig, ListLoadResult<TemplateData>> proxy = new RpcProxy<ListLoadConfig, ListLoadResult<TemplateData>>() {
|
||||
|
||||
|
@ -159,15 +159,15 @@ public class TemplateDeletePanel extends FramedPanel {
|
|||
loader.addLoadHandler(new LoadResultListStoreBinding<ListLoadConfig, TemplateData, ListLoadResult<TemplateData>>(
|
||||
store) {
|
||||
});
|
||||
|
||||
|
||||
SelectHandler sh = new SelectHandler() {
|
||||
public void onSelect(SelectEvent event) {
|
||||
loader.load();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
btnReload.addSelectHandler(sh);
|
||||
|
||||
|
||||
grid = new Grid<TemplateData>(store, cm) {
|
||||
@Override
|
||||
protected void onAfterFirstAttach() {
|
||||
|
@ -227,8 +227,8 @@ public class TemplateDeletePanel extends FramedPanel {
|
|||
HBoxLayoutContainer flowButton = new HBoxLayoutContainer();
|
||||
flowButton.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
|
||||
flowButton.setPack(BoxLayoutPack.CENTER);
|
||||
|
||||
BoxLayoutData boxLayoutData=new BoxLayoutData(new Margins(2, 4, 2, 4));
|
||||
|
||||
BoxLayoutData boxLayoutData = new BoxLayoutData(new Margins(2, 4, 2, 4));
|
||||
flowButton.add(btnDelete, boxLayoutData);
|
||||
flowButton.add(btnClose, boxLayoutData);
|
||||
|
||||
|
@ -236,8 +236,8 @@ public class TemplateDeletePanel extends FramedPanel {
|
|||
v.add(toolBarHead, new VerticalLayoutData(1, -1, new Margins(0)));
|
||||
v.add(grid, new VerticalLayoutData(1, -1, new Margins(0)));
|
||||
v.add(toolBar, new VerticalLayoutData(1, 25, new Margins(0)));
|
||||
v.add(flowButton, new VerticalLayoutData(1, 36,
|
||||
new Margins(5, 2, 5, 2)));
|
||||
v.add(flowButton,
|
||||
new VerticalLayoutData(1, 36, new Margins(5, 2, 5, 2)));
|
||||
add(v);
|
||||
|
||||
}
|
||||
|
@ -249,10 +249,15 @@ public class TemplateDeletePanel extends FramedPanel {
|
|||
.getTemplates(new AsyncCallback<ArrayList<TemplateData>>() {
|
||||
|
||||
public void onFailure(Throwable caught) {
|
||||
Log.error("load templates failure:"
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error retrieving templates",
|
||||
"Error retrieving templates");
|
||||
if (caught instanceof TDGWTSessionExpiredException) {
|
||||
eventBus.fireEvent(new SessionExpiredEvent(
|
||||
SessionExpiredType.EXPIREDONSERVER));
|
||||
} else {
|
||||
Log.error("Load templates failure:"
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error retrieving templates",
|
||||
"Error retrieving templates");
|
||||
}
|
||||
callback.onFailure(caught);
|
||||
}
|
||||
|
||||
|
@ -267,32 +272,27 @@ public class TemplateDeletePanel extends FramedPanel {
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*protected void setMenu() {
|
||||
Menu contextMenu = new Menu();
|
||||
|
||||
MenuItem deleteTemplateItem = new MenuItem("Delete");
|
||||
deleteTemplateItem.setId("DeleteTemplate");
|
||||
deleteTemplateItem.setIcon(ResourceBundle.INSTANCE.removeTemplate());
|
||||
deleteTemplateItem.addSelectionHandler(new SelectionHandler<Item>() {
|
||||
|
||||
@Override
|
||||
public void onSelection(SelectionEvent<Item> event) {
|
||||
Log.debug("Delete Template");
|
||||
TemplateData templateDesc = getSelectedItem();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
grid.setContextMenu(contextMenu);
|
||||
}*/
|
||||
/*
|
||||
* protected void setMenu() { Menu contextMenu = new Menu();
|
||||
*
|
||||
* MenuItem deleteTemplateItem = new MenuItem("Delete");
|
||||
* deleteTemplateItem.setId("DeleteTemplate");
|
||||
* deleteTemplateItem.setIcon(ResourceBundle.INSTANCE.removeTemplate());
|
||||
* deleteTemplateItem.addSelectionHandler(new SelectionHandler<Item>() {
|
||||
*
|
||||
* @Override public void onSelection(SelectionEvent<Item> event) {
|
||||
* Log.debug("Delete Template"); TemplateData templateDesc =
|
||||
* getSelectedItem();
|
||||
*
|
||||
* } });
|
||||
*
|
||||
* grid.setContextMenu(contextMenu); }
|
||||
*/
|
||||
|
||||
protected ArrayList<TemplateData> getSelectedItem() {
|
||||
ArrayList<TemplateData> templates=new ArrayList<TemplateData>();
|
||||
for(TemplateData template:grid.getSelectionModel().getSelectedItems()){
|
||||
ArrayList<TemplateData> templates = new ArrayList<TemplateData>();
|
||||
for (TemplateData template : grid.getSelectionModel()
|
||||
.getSelectedItems()) {
|
||||
templates.add(template);
|
||||
}
|
||||
return templates;
|
||||
|
@ -300,45 +300,55 @@ public class TemplateDeletePanel extends FramedPanel {
|
|||
|
||||
protected void delete() {
|
||||
templateDeleteSession = new TemplateDeleteSession();
|
||||
ArrayList<TemplateData> templates=getSelectedItem();
|
||||
if(templates==null|| templates.size()==0){
|
||||
UtilsGXT3.info("Attention",
|
||||
"Select the template to be deleted");
|
||||
ArrayList<TemplateData> templates = getSelectedItem();
|
||||
if (templates == null || templates.size() == 0) {
|
||||
UtilsGXT3.info("Attention", "Select the template to be deleted");
|
||||
} else {
|
||||
templateDeleteSession.setTemplates(getSelectedItem());
|
||||
Log.debug("templateDeleteSession: " + templateDeleteSession);
|
||||
parent.templatesDelete(templateDeleteSession);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected void close() {
|
||||
parent.close();
|
||||
}
|
||||
|
||||
|
||||
protected class ExtendedListStore<M> extends ListStore<M> {
|
||||
|
||||
public ExtendedListStore(ModelKeyProvider<? super M> keyProvider) {
|
||||
super(keyProvider);
|
||||
}
|
||||
|
||||
public void applyFilters()
|
||||
{
|
||||
public void applyFilters() {
|
||||
super.applyFilters();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void gridReload(){
|
||||
|
||||
public void gridReload() {
|
||||
grid.getLoader().load();
|
||||
}
|
||||
|
||||
|
||||
protected boolean select(TemplateData item, String searchTerm) {
|
||||
if (item.getName()!=null && item.getName().toLowerCase().contains(searchTerm.toLowerCase())) return true;
|
||||
if (item.getCategory()!=null &&item.getCategory().toLowerCase().contains(searchTerm.toLowerCase())) return true;
|
||||
if (item.getAgency()!=null &&item.getAgency().toLowerCase().contains(searchTerm.toLowerCase())) return true;
|
||||
if (item.getDescription()!=null && item.getDescription().toLowerCase().contains(searchTerm.toLowerCase())) return true;
|
||||
if (item.getName() != null
|
||||
&& item.getName().toLowerCase()
|
||||
.contains(searchTerm.toLowerCase()))
|
||||
return true;
|
||||
if (item.getCategory() != null
|
||||
&& item.getCategory().toLowerCase()
|
||||
.contains(searchTerm.toLowerCase()))
|
||||
return true;
|
||||
if (item.getAgency() != null
|
||||
&& item.getAgency().toLowerCase()
|
||||
.contains(searchTerm.toLowerCase()))
|
||||
return true;
|
||||
if (item.getDescription() != null
|
||||
&& item.getDescription().toLowerCase()
|
||||
.contains(searchTerm.toLowerCase()))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,12 +2,9 @@ package org.gcube.portlets.user.td.client.template;
|
|||
|
||||
import org.gcube.portlets.user.td.client.resource.TabularDataResources;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.template.TemplateData;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.template.TemplateDeleteSession;
|
||||
import org.gcube.portlets.user.td.sharewidget.client.TemplateShare;
|
||||
import org.gcube.portlets.user.tdtemplate.client.TdTemplateController;
|
||||
import org.gcube.portlets.user.tdtemplate.client.TdTemplateControllerUpdater;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.google.web.bindery.event.shared.EventBus;
|
||||
import com.sencha.gxt.widget.core.client.Window;
|
||||
import com.sencha.gxt.widget.core.client.event.SelectEvent;
|
||||
|
@ -20,10 +17,9 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
|||
*
|
||||
*/
|
||||
public class TemplateOpenDialog extends Window {
|
||||
protected String WIDTH = "720px";
|
||||
protected String HEIGHT = "530px";
|
||||
protected TemplateDeleteSession templateDeleteSession;
|
||||
protected EventBus eventBus;
|
||||
private static final String WIDTH = "720px";
|
||||
private static final String HEIGHT = "530px";
|
||||
private EventBus eventBus;
|
||||
|
||||
public TemplateOpenDialog(EventBus eventBus) {
|
||||
this.eventBus = eventBus;
|
||||
|
@ -76,12 +72,6 @@ public class TemplateOpenDialog extends Window {
|
|||
|
||||
}
|
||||
|
||||
public void templateShare(TemplateData templateData) {
|
||||
Log.debug("Open Share Window");
|
||||
@SuppressWarnings("unused")
|
||||
TemplateShare templateShare = new TemplateShare(templateData, eventBus);
|
||||
close();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -5,8 +5,11 @@ import java.util.List;
|
|||
|
||||
import org.gcube.portlets.user.td.client.resource.TabularDataResources;
|
||||
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.template.TemplateData;
|
||||
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
|
@ -51,29 +54,27 @@ import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
|
|||
|
||||
/**
|
||||
*
|
||||
* @author giancarlo
|
||||
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
* @author giancarlo email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class TemplateOpenPanel extends FramedPanel {
|
||||
protected String WIDTH = "630px";
|
||||
protected String HEIGHT = "520px";
|
||||
protected EventBus eventBus;
|
||||
protected TemplateOpenDialog parent;
|
||||
|
||||
private static final String WIDTH = "630px";
|
||||
private static final String HEIGHT = "520px";
|
||||
private EventBus eventBus;
|
||||
private TemplateOpenDialog parent;
|
||||
|
||||
private TextButton btnOpen;
|
||||
private TextButton btnClose;
|
||||
private TextButton btnShare;
|
||||
|
||||
protected ListLoader<ListLoadConfig, ListLoadResult<TemplateData>> loader;
|
||||
protected Grid<TemplateData> grid;
|
||||
protected ExtendedListStore<TemplateData> store;
|
||||
|
||||
public TemplateOpenPanel(TemplateOpenDialog parent,
|
||||
EventBus eventBus) {
|
||||
|
||||
private ListLoader<ListLoadConfig, ListLoadResult<TemplateData>> loader;
|
||||
private Grid<TemplateData> grid;
|
||||
private ExtendedListStore<TemplateData> store;
|
||||
|
||||
public TemplateOpenPanel(TemplateOpenDialog parent, EventBus eventBus) {
|
||||
this.parent = parent;
|
||||
Log.debug("TemplateDeletePanel");
|
||||
Log.debug("TemplateOpenPanel");
|
||||
setWidth(WIDTH);
|
||||
setHeight(HEIGHT);
|
||||
setHeaderVisible(false);
|
||||
|
@ -89,15 +90,13 @@ public class TemplateOpenPanel extends FramedPanel {
|
|||
toolBarHead.add(new LabelToolItem("Search: "));
|
||||
final TextField searchField = new TextField();
|
||||
toolBarHead.add(searchField);
|
||||
|
||||
|
||||
TextButton btnReload = new TextButton();
|
||||
//btnReload.setText("Reload");
|
||||
// btnReload.setText("Reload");
|
||||
btnReload.setIcon(TabularDataResources.INSTANCE.refresh());
|
||||
btnReload.setToolTip("Reload");
|
||||
toolBarHead.add(btnReload);
|
||||
|
||||
|
||||
|
||||
|
||||
IdentityValueProvider<TemplateData> identity = new IdentityValueProvider<TemplateData>();
|
||||
CheckBoxSelectionModel<TemplateData> sm = new CheckBoxSelectionModel<TemplateData>(
|
||||
identity);
|
||||
|
@ -108,10 +107,10 @@ public class TemplateOpenPanel extends FramedPanel {
|
|||
props.name(), 120, "Name");
|
||||
ColumnConfig<TemplateData, String> categoryCol = new ColumnConfig<TemplateData, String>(
|
||||
props.category(), 60, "Category");
|
||||
|
||||
|
||||
ColumnConfig<TemplateData, String> ownerCol = new ColumnConfig<TemplateData, String>(
|
||||
props.ownerLogin(), 70, "Owner");
|
||||
|
||||
|
||||
ColumnConfig<TemplateData, String> agencyCol = new ColumnConfig<TemplateData, String>(
|
||||
props.agency(), 100, "Agency");
|
||||
|
||||
|
@ -126,30 +125,30 @@ public class TemplateOpenPanel extends FramedPanel {
|
|||
l.add(descriptionCol);
|
||||
|
||||
ColumnModel<TemplateData> cm = new ColumnModel<TemplateData>(l);
|
||||
|
||||
|
||||
store = new ExtendedListStore<TemplateData>(props.id());
|
||||
|
||||
searchField.addKeyUpHandler(new KeyUpHandler() {
|
||||
|
||||
public void onKeyUp(KeyUpEvent event) {
|
||||
Log.trace("searchTerm: "+searchField.getCurrentValue());
|
||||
store.applyFilters();
|
||||
Log.trace("searchTerm: " + searchField.getCurrentValue());
|
||||
store.applyFilters();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
store.addFilter(new StoreFilter<TemplateData>() {
|
||||
|
||||
@Override
|
||||
public boolean select(Store<TemplateData> store,
|
||||
TemplateData parent, TemplateData item) {
|
||||
String searchTerm = searchField.getCurrentValue();
|
||||
if (searchTerm == null) return true;
|
||||
if (searchTerm == null)
|
||||
return true;
|
||||
return TemplateOpenPanel.this.select(item, searchTerm);
|
||||
}
|
||||
});
|
||||
|
||||
store.setEnableFilters(true);
|
||||
|
||||
|
||||
RpcProxy<ListLoadConfig, ListLoadResult<TemplateData>> proxy = new RpcProxy<ListLoadConfig, ListLoadResult<TemplateData>>() {
|
||||
|
||||
|
@ -165,15 +164,15 @@ public class TemplateOpenPanel extends FramedPanel {
|
|||
loader.addLoadHandler(new LoadResultListStoreBinding<ListLoadConfig, TemplateData, ListLoadResult<TemplateData>>(
|
||||
store) {
|
||||
});
|
||||
|
||||
|
||||
SelectHandler sh = new SelectHandler() {
|
||||
public void onSelect(SelectEvent event) {
|
||||
loader.load();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
btnReload.addSelectHandler(sh);
|
||||
|
||||
|
||||
grid = new Grid<TemplateData>(store, cm) {
|
||||
@Override
|
||||
protected void onAfterFirstAttach() {
|
||||
|
@ -229,34 +228,24 @@ public class TemplateOpenPanel extends FramedPanel {
|
|||
close();
|
||||
}
|
||||
});
|
||||
|
||||
btnShare = new TextButton("Share");
|
||||
btnShare.setIcon(TabularDataResources.INSTANCE.share());
|
||||
btnShare.setIconAlign(IconAlign.RIGHT);
|
||||
btnShare.setTitle("Share");
|
||||
btnShare.addSelectHandler(new SelectHandler() {
|
||||
|
||||
public void onSelect(SelectEvent event) {
|
||||
Log.debug("Pressed Share");
|
||||
share();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
HBoxLayoutContainer flowButton = new HBoxLayoutContainer();
|
||||
flowButton.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
|
||||
flowButton.setPack(BoxLayoutPack.CENTER);
|
||||
|
||||
BoxLayoutData boxLayoutData= new BoxLayoutData(new Margins(2, 4, 2, 4));
|
||||
BoxLayoutData boxLayoutData = new BoxLayoutData(new Margins(2, 4, 2, 4));
|
||||
flowButton.add(btnOpen, boxLayoutData);
|
||||
flowButton.add(btnClose, boxLayoutData);
|
||||
flowButton.add(btnShare, boxLayoutData);
|
||||
flowButton.add(btnClose, boxLayoutData);
|
||||
|
||||
|
||||
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
||||
v.add(toolBarHead, new VerticalLayoutData(1, -1, new Margins(0)));
|
||||
v.add(grid, new VerticalLayoutData(1, -1, new Margins(0)));
|
||||
v.add(toolBar, new VerticalLayoutData(1, 25, new Margins(0)));
|
||||
v.add(flowButton, new VerticalLayoutData(1, 36,
|
||||
new Margins(5, 2, 5, 2)));
|
||||
v.add(flowButton,
|
||||
new VerticalLayoutData(1, 36, new Margins(5, 2, 5, 2)));
|
||||
add(v);
|
||||
|
||||
}
|
||||
|
@ -268,10 +257,15 @@ public class TemplateOpenPanel extends FramedPanel {
|
|||
.getTemplates(new AsyncCallback<ArrayList<TemplateData>>() {
|
||||
|
||||
public void onFailure(Throwable caught) {
|
||||
Log.error("load templates failure:"
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error retrieving templates",
|
||||
"Error retrieving templates");
|
||||
if (caught instanceof TDGWTSessionExpiredException) {
|
||||
eventBus.fireEvent(new SessionExpiredEvent(
|
||||
SessionExpiredType.EXPIREDONSERVER));
|
||||
} else {
|
||||
Log.error("Load templates failure:"
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error retrieving templates",
|
||||
"Error retrieving templates");
|
||||
}
|
||||
callback.onFailure(caught);
|
||||
}
|
||||
|
||||
|
@ -286,95 +280,68 @@ public class TemplateOpenPanel extends FramedPanel {
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*protected void setMenu() {
|
||||
Menu contextMenu = new Menu();
|
||||
|
||||
MenuItem deleteTemplateItem = new MenuItem("Delete");
|
||||
deleteTemplateItem.setId("DeleteTemplate");
|
||||
deleteTemplateItem.setIcon(ResourceBundle.INSTANCE.removeTemplate());
|
||||
deleteTemplateItem.addSelectionHandler(new SelectionHandler<Item>() {
|
||||
|
||||
@Override
|
||||
public void onSelection(SelectionEvent<Item> event) {
|
||||
Log.debug("Delete Template");
|
||||
TemplateData templateDesc = getSelectedItem();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
grid.setContextMenu(contextMenu);
|
||||
}*/
|
||||
|
||||
protected ArrayList<TemplateData> getSelectedItem() {
|
||||
ArrayList<TemplateData> templates=new ArrayList<TemplateData>();
|
||||
for(TemplateData template:grid.getSelectionModel().getSelectedItems()){
|
||||
ArrayList<TemplateData> templates = new ArrayList<TemplateData>();
|
||||
for (TemplateData template : grid.getSelectionModel()
|
||||
.getSelectedItems()) {
|
||||
templates.add(template);
|
||||
}
|
||||
return templates;
|
||||
}
|
||||
|
||||
protected void open() {
|
||||
|
||||
ArrayList<TemplateData> templates=getSelectedItem();
|
||||
if(templates==null|| templates.size()==0){
|
||||
UtilsGXT3.info("Attention",
|
||||
"Select the template");
|
||||
|
||||
ArrayList<TemplateData> templates = getSelectedItem();
|
||||
if (templates == null || templates.size() == 0) {
|
||||
UtilsGXT3.info("Attention", "Select the template");
|
||||
} else {
|
||||
TemplateData template=templates.get(0);
|
||||
TemplateData template = templates.get(0);
|
||||
Log.debug("templateOpenSession: " + template);
|
||||
parent.templateOpen(template);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void share() {
|
||||
|
||||
ArrayList<TemplateData> templates=getSelectedItem();
|
||||
if(templates==null|| templates.size()==0){
|
||||
UtilsGXT3.info("Attention",
|
||||
"Select the template");
|
||||
} else {
|
||||
TemplateData template=templates.get(0);
|
||||
Log.debug("templateShare: " + template);
|
||||
parent.templateShare(template);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
protected void close() {
|
||||
parent.close();
|
||||
}
|
||||
|
||||
|
||||
protected class ExtendedListStore<M> extends ListStore<M> {
|
||||
|
||||
public ExtendedListStore(ModelKeyProvider<? super M> keyProvider) {
|
||||
super(keyProvider);
|
||||
}
|
||||
|
||||
public void applyFilters()
|
||||
{
|
||||
public void applyFilters() {
|
||||
super.applyFilters();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void gridReload(){
|
||||
|
||||
public void gridReload() {
|
||||
grid.getLoader().load();
|
||||
}
|
||||
|
||||
|
||||
protected boolean select(TemplateData item, String searchTerm) {
|
||||
if (item.getName()!=null && item.getName().toLowerCase().contains(searchTerm.toLowerCase())) return true;
|
||||
if (item.getCategory()!=null &&item.getCategory().toLowerCase().contains(searchTerm.toLowerCase())) return true;
|
||||
if (item.getAgency()!=null &&item.getAgency().toLowerCase().contains(searchTerm.toLowerCase())) return true;
|
||||
if (item.getDescription()!=null && item.getDescription().toLowerCase().contains(searchTerm.toLowerCase())) return true;
|
||||
if (item.getName() != null
|
||||
&& item.getName().toLowerCase()
|
||||
.contains(searchTerm.toLowerCase()))
|
||||
return true;
|
||||
if (item.getCategory() != null
|
||||
&& item.getCategory().toLowerCase()
|
||||
.contains(searchTerm.toLowerCase()))
|
||||
return true;
|
||||
if (item.getAgency() != null
|
||||
&& item.getAgency().toLowerCase()
|
||||
.contains(searchTerm.toLowerCase()))
|
||||
return true;
|
||||
if (item.getDescription() != null
|
||||
&& item.getDescription().toLowerCase()
|
||||
.contains(searchTerm.toLowerCase()))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,76 @@
|
|||
package org.gcube.portlets.user.td.client.template;
|
||||
|
||||
import org.gcube.portlets.user.td.client.resource.TabularDataResources;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.template.TemplateData;
|
||||
import org.gcube.portlets.user.td.sharewidget.client.TemplateShare;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.google.web.bindery.event.shared.EventBus;
|
||||
import com.sencha.gxt.widget.core.client.Window;
|
||||
import com.sencha.gxt.widget.core.client.event.SelectEvent;
|
||||
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author "Giancarlo Panichi" <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class TemplateShareDialog extends Window {
|
||||
private static final String WIDTH = "720px";
|
||||
private static final String HEIGHT = "530px";
|
||||
|
||||
private EventBus eventBus;
|
||||
|
||||
public TemplateShareDialog(EventBus eventBus) {
|
||||
this.eventBus = eventBus;
|
||||
initWindow();
|
||||
|
||||
TemplateSharePanel templateDeletePanel = new TemplateSharePanel(this,
|
||||
eventBus);
|
||||
add(templateDeletePanel);
|
||||
}
|
||||
|
||||
protected void initWindow() {
|
||||
setWidth(WIDTH);
|
||||
setHeight(HEIGHT);
|
||||
setBodyBorder(false);
|
||||
setResizable(false);
|
||||
setHeadingText("Share Template");
|
||||
setClosable(true);
|
||||
setModal(true);
|
||||
forceLayoutOnResize = true;
|
||||
getHeader().setIcon(TabularDataResources.INSTANCE.templateShare());
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
protected void initTools() {
|
||||
super.initTools();
|
||||
|
||||
closeBtn.addSelectHandler(new SelectHandler() {
|
||||
|
||||
public void onSelect(SelectEvent event) {
|
||||
close();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
protected void close() {
|
||||
hide();
|
||||
}
|
||||
|
||||
|
||||
public void templateShare(TemplateData templateData) {
|
||||
Log.debug("Share Window");
|
||||
@SuppressWarnings("unused")
|
||||
TemplateShare templateShare = new TemplateShare(templateData, eventBus);
|
||||
close();
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,346 @@
|
|||
package org.gcube.portlets.user.td.client.template;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.portlets.user.td.client.resource.TabularDataResources;
|
||||
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.template.TemplateData;
|
||||
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.core.client.Scheduler;
|
||||
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
|
||||
import com.google.gwt.event.dom.client.KeyUpEvent;
|
||||
import com.google.gwt.event.dom.client.KeyUpHandler;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.google.web.bindery.event.shared.EventBus;
|
||||
import com.sencha.gxt.cell.core.client.ButtonCell.IconAlign;
|
||||
import com.sencha.gxt.core.client.IdentityValueProvider;
|
||||
import com.sencha.gxt.core.client.Style.SelectionMode;
|
||||
import com.sencha.gxt.core.client.resources.ThemeStyles;
|
||||
import com.sencha.gxt.core.client.util.Margins;
|
||||
import com.sencha.gxt.data.client.loader.RpcProxy;
|
||||
import com.sencha.gxt.data.shared.ListStore;
|
||||
import com.sencha.gxt.data.shared.ModelKeyProvider;
|
||||
import com.sencha.gxt.data.shared.Store;
|
||||
import com.sencha.gxt.data.shared.Store.StoreFilter;
|
||||
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.data.shared.loader.LoadResultListStoreBinding;
|
||||
import com.sencha.gxt.widget.core.client.FramedPanel;
|
||||
import com.sencha.gxt.widget.core.client.button.TextButton;
|
||||
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData;
|
||||
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutPack;
|
||||
import com.sencha.gxt.widget.core.client.container.HBoxLayoutContainer;
|
||||
import com.sencha.gxt.widget.core.client.container.HBoxLayoutContainer.HBoxLayoutAlign;
|
||||
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
|
||||
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;
|
||||
import com.sencha.gxt.widget.core.client.event.SelectEvent;
|
||||
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
||||
import com.sencha.gxt.widget.core.client.form.TextField;
|
||||
import com.sencha.gxt.widget.core.client.grid.CheckBoxSelectionModel;
|
||||
import com.sencha.gxt.widget.core.client.grid.ColumnConfig;
|
||||
import com.sencha.gxt.widget.core.client.grid.ColumnModel;
|
||||
import com.sencha.gxt.widget.core.client.grid.Grid;
|
||||
import com.sencha.gxt.widget.core.client.toolbar.LabelToolItem;
|
||||
import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author giancarlo email: <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class TemplateSharePanel extends FramedPanel {
|
||||
private static final String WIDTH = "630px";
|
||||
private static final String HEIGHT = "520px";
|
||||
private EventBus eventBus;
|
||||
private TemplateShareDialog parent;
|
||||
|
||||
private TextButton btnClose;
|
||||
private TextButton btnShare;
|
||||
|
||||
private ListLoader<ListLoadConfig, ListLoadResult<TemplateData>> loader;
|
||||
private Grid<TemplateData> grid;
|
||||
private ExtendedListStore<TemplateData> store;
|
||||
|
||||
public TemplateSharePanel(TemplateShareDialog parent, EventBus eventBus) {
|
||||
this.parent = parent;
|
||||
Log.debug("TemplateSharePanel");
|
||||
setWidth(WIDTH);
|
||||
setHeight(HEIGHT);
|
||||
setHeaderVisible(false);
|
||||
setBodyBorder(false);
|
||||
this.eventBus = eventBus;
|
||||
|
||||
create();
|
||||
|
||||
}
|
||||
|
||||
protected void create() {
|
||||
ToolBar toolBarHead = new ToolBar();
|
||||
toolBarHead.add(new LabelToolItem("Search: "));
|
||||
final TextField searchField = new TextField();
|
||||
toolBarHead.add(searchField);
|
||||
|
||||
TextButton btnReload = new TextButton();
|
||||
// btnReload.setText("Reload");
|
||||
btnReload.setIcon(TabularDataResources.INSTANCE.refresh());
|
||||
btnReload.setToolTip("Reload");
|
||||
toolBarHead.add(btnReload);
|
||||
|
||||
IdentityValueProvider<TemplateData> identity = new IdentityValueProvider<TemplateData>();
|
||||
CheckBoxSelectionModel<TemplateData> sm = new CheckBoxSelectionModel<TemplateData>(
|
||||
identity);
|
||||
|
||||
TemplateDataProperties props = GWT.create(TemplateDataProperties.class);
|
||||
|
||||
ColumnConfig<TemplateData, String> nameCol = new ColumnConfig<TemplateData, String>(
|
||||
props.name(), 120, "Name");
|
||||
ColumnConfig<TemplateData, String> categoryCol = new ColumnConfig<TemplateData, String>(
|
||||
props.category(), 60, "Category");
|
||||
|
||||
ColumnConfig<TemplateData, String> ownerCol = new ColumnConfig<TemplateData, String>(
|
||||
props.ownerLogin(), 70, "Owner");
|
||||
|
||||
ColumnConfig<TemplateData, String> agencyCol = new ColumnConfig<TemplateData, String>(
|
||||
props.agency(), 100, "Agency");
|
||||
|
||||
ColumnConfig<TemplateData, String> descriptionCol = new ColumnConfig<TemplateData, String>(
|
||||
props.description(), 120, "Description");
|
||||
|
||||
List<ColumnConfig<TemplateData, ?>> l = new ArrayList<ColumnConfig<TemplateData, ?>>();
|
||||
l.add(nameCol);
|
||||
l.add(categoryCol);
|
||||
l.add(ownerCol);
|
||||
l.add(agencyCol);
|
||||
l.add(descriptionCol);
|
||||
|
||||
ColumnModel<TemplateData> cm = new ColumnModel<TemplateData>(l);
|
||||
|
||||
store = new ExtendedListStore<TemplateData>(props.id());
|
||||
|
||||
searchField.addKeyUpHandler(new KeyUpHandler() {
|
||||
|
||||
public void onKeyUp(KeyUpEvent event) {
|
||||
Log.trace("searchTerm: " + searchField.getCurrentValue());
|
||||
store.applyFilters();
|
||||
}
|
||||
});
|
||||
|
||||
store.addFilter(new StoreFilter<TemplateData>() {
|
||||
|
||||
@Override
|
||||
public boolean select(Store<TemplateData> store,
|
||||
TemplateData parent, TemplateData item) {
|
||||
String searchTerm = searchField.getCurrentValue();
|
||||
if (searchTerm == null)
|
||||
return true;
|
||||
return TemplateSharePanel.this.select(item, searchTerm);
|
||||
}
|
||||
});
|
||||
|
||||
store.setEnableFilters(true);
|
||||
|
||||
RpcProxy<ListLoadConfig, ListLoadResult<TemplateData>> proxy = new RpcProxy<ListLoadConfig, ListLoadResult<TemplateData>>() {
|
||||
|
||||
public void load(ListLoadConfig loadConfig,
|
||||
final AsyncCallback<ListLoadResult<TemplateData>> callback) {
|
||||
loadData(loadConfig, callback);
|
||||
}
|
||||
};
|
||||
loader = new ListLoader<ListLoadConfig, ListLoadResult<TemplateData>>(
|
||||
proxy);
|
||||
|
||||
loader.setRemoteSort(false);
|
||||
loader.addLoadHandler(new LoadResultListStoreBinding<ListLoadConfig, TemplateData, ListLoadResult<TemplateData>>(
|
||||
store) {
|
||||
});
|
||||
|
||||
SelectHandler sh = new SelectHandler() {
|
||||
public void onSelect(SelectEvent event) {
|
||||
loader.load();
|
||||
}
|
||||
};
|
||||
|
||||
btnReload.addSelectHandler(sh);
|
||||
|
||||
grid = new Grid<TemplateData>(store, cm) {
|
||||
@Override
|
||||
protected void onAfterFirstAttach() {
|
||||
super.onAfterFirstAttach();
|
||||
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
||||
|
||||
public void execute() {
|
||||
loader.load();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
sm.setSelectionMode(SelectionMode.SINGLE);
|
||||
grid.setLoader(loader);
|
||||
grid.setSelectionModel(sm);
|
||||
grid.setHeight("384px");
|
||||
grid.getView().setStripeRows(true);
|
||||
grid.getView().setColumnLines(true);
|
||||
grid.getView().setAutoFill(true);
|
||||
grid.setBorders(false);
|
||||
grid.setLoadMask(true);
|
||||
grid.setColumnReordering(true);
|
||||
grid.setColumnResize(true);
|
||||
grid.getView().setAutoExpandColumn(descriptionCol);
|
||||
|
||||
ToolBar toolBar = new ToolBar();
|
||||
toolBar.add(grid);
|
||||
toolBar.addStyleName(ThemeStyles.get().style().borderTop());
|
||||
toolBar.getElement().getStyle().setProperty("borderBottom", "none");
|
||||
|
||||
|
||||
|
||||
btnClose = new TextButton("Close");
|
||||
btnClose.setIcon(TabularDataResources.INSTANCE.close());
|
||||
btnClose.setIconAlign(IconAlign.RIGHT);
|
||||
btnClose.setTitle("Close");
|
||||
btnClose.addSelectHandler(new SelectHandler() {
|
||||
|
||||
public void onSelect(SelectEvent event) {
|
||||
Log.debug("Pressed Close");
|
||||
close();
|
||||
}
|
||||
});
|
||||
|
||||
btnShare = new TextButton("Share");
|
||||
btnShare.setIcon(TabularDataResources.INSTANCE.share());
|
||||
btnShare.setIconAlign(IconAlign.RIGHT);
|
||||
btnShare.setTitle("Share");
|
||||
btnShare.addSelectHandler(new SelectHandler() {
|
||||
|
||||
public void onSelect(SelectEvent event) {
|
||||
Log.debug("Pressed Share");
|
||||
share();
|
||||
}
|
||||
});
|
||||
|
||||
HBoxLayoutContainer flowButton = new HBoxLayoutContainer();
|
||||
flowButton.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
|
||||
flowButton.setPack(BoxLayoutPack.CENTER);
|
||||
|
||||
BoxLayoutData boxLayoutData = new BoxLayoutData(new Margins(2, 4, 2, 4));
|
||||
flowButton.add(btnShare, boxLayoutData);
|
||||
flowButton.add(btnClose, boxLayoutData);
|
||||
|
||||
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
||||
v.add(toolBarHead, new VerticalLayoutData(1, -1, new Margins(0)));
|
||||
v.add(grid, new VerticalLayoutData(1, -1, new Margins(0)));
|
||||
v.add(toolBar, new VerticalLayoutData(1, 25, new Margins(0)));
|
||||
v.add(flowButton,
|
||||
new VerticalLayoutData(1, 36, new Margins(5, 2, 5, 2)));
|
||||
add(v);
|
||||
|
||||
}
|
||||
|
||||
protected void loadData(ListLoadConfig loadConfig,
|
||||
final AsyncCallback<ListLoadResult<TemplateData>> callback) {
|
||||
|
||||
TDGWTServiceAsync.INSTANCE
|
||||
.getTemplates(new AsyncCallback<ArrayList<TemplateData>>() {
|
||||
|
||||
public void onFailure(Throwable caught) {
|
||||
if (caught instanceof TDGWTSessionExpiredException) {
|
||||
eventBus.fireEvent(new SessionExpiredEvent(
|
||||
SessionExpiredType.EXPIREDONSERVER));
|
||||
} else {
|
||||
Log.error("Load templates failure:"
|
||||
+ caught.getLocalizedMessage());
|
||||
UtilsGXT3.alert("Error retrieving templates",
|
||||
"Error retrieving templates");
|
||||
}
|
||||
callback.onFailure(caught);
|
||||
}
|
||||
|
||||
public void onSuccess(ArrayList<TemplateData> result) {
|
||||
Log.trace("loaded " + result.size() + " Occurences");
|
||||
callback.onSuccess(new ListLoadResultBean<TemplateData>(
|
||||
result));
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected ArrayList<TemplateData> getSelectedItem() {
|
||||
ArrayList<TemplateData> templates = new ArrayList<TemplateData>();
|
||||
for (TemplateData template : grid.getSelectionModel()
|
||||
.getSelectedItems()) {
|
||||
templates.add(template);
|
||||
}
|
||||
return templates;
|
||||
}
|
||||
|
||||
|
||||
protected void share() {
|
||||
|
||||
ArrayList<TemplateData> templates = getSelectedItem();
|
||||
if (templates == null || templates.size() == 0) {
|
||||
UtilsGXT3.info("Attention", "Select the template");
|
||||
} else {
|
||||
TemplateData template = templates.get(0);
|
||||
Log.debug("templateShare: " + template);
|
||||
parent.templateShare(template);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void close() {
|
||||
parent.close();
|
||||
}
|
||||
|
||||
protected class ExtendedListStore<M> extends ListStore<M> {
|
||||
|
||||
public ExtendedListStore(ModelKeyProvider<? super M> keyProvider) {
|
||||
super(keyProvider);
|
||||
}
|
||||
|
||||
public void applyFilters() {
|
||||
super.applyFilters();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void gridReload() {
|
||||
grid.getLoader().load();
|
||||
}
|
||||
|
||||
protected boolean select(TemplateData item, String searchTerm) {
|
||||
if (item.getName() != null
|
||||
&& item.getName().toLowerCase()
|
||||
.contains(searchTerm.toLowerCase()))
|
||||
return true;
|
||||
if (item.getCategory() != null
|
||||
&& item.getCategory().toLowerCase()
|
||||
.contains(searchTerm.toLowerCase()))
|
||||
return true;
|
||||
if (item.getAgency() != null
|
||||
&& item.getAgency().toLowerCase()
|
||||
.contains(searchTerm.toLowerCase()))
|
||||
return true;
|
||||
if (item.getDescription() != null
|
||||
&& item.getDescription().toLowerCase()
|
||||
.contains(searchTerm.toLowerCase()))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
|
@ -76,18 +76,18 @@
|
|||
<!-- Specify the app entry point class. -->
|
||||
<entry-point class='org.gcube.portlets.user.td.client.TabularDataPortlet' />
|
||||
|
||||
|
||||
<!--
|
||||
<set-property name="log_ConsoleLogger" value="ENABLED" />
|
||||
<set-property name="log_DivLogger" value="ENABLED" />
|
||||
<set-property name="log_GWTLogger" value="ENABLED" />
|
||||
<set-property name="log_SystemLogger" value="ENABLED" />
|
||||
<set-property name="log_SystemLogger" value="ENABLED" /> -->
|
||||
<!-- Not in GWT 2.6 <set-property name="log_FirebugLogger" value="ENABLED" /> -->
|
||||
|
||||
<!--
|
||||
|
||||
<set-property name="log_ConsoleLogger" value="DISABLED" />
|
||||
<set-property name="log_DivLogger" value="DISABLED" />
|
||||
<set-property name="log_GWTLogger" value="DISABLED" />
|
||||
<set-property name="log_SystemLogger" value="DISABLED" /> -->
|
||||
<set-property name="log_SystemLogger" value="DISABLED" />
|
||||
<!-- Not in GWT 2.6 <set-property name="log_FirebugLogger" value="DISABLED" /> -->
|
||||
|
||||
<!-- Specify the paths for translatable code -->
|
||||
|
|
Loading…
Reference in New Issue