Remove dirs

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-column-widget@91012 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-02-07 09:51:06 +00:00
parent 2a91261b9b
commit 87c2577e8e
9 changed files with 83 additions and 293 deletions

29
config/profile.xml Normal file
View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<Resource>
<ID></ID>
<Type>Service</Type>
<Profile>
<Description>tabular-data-column-widget allows to perform operations on the columns of a tabular resource</Description>
<Class>PortletsUser</Class>
<Name>tabular-data-column-widget</Name>
<Version>1.0.0</Version>
<Packages>
<Software>
<Description>tabular-data-column-widget allows to perform operations on the columns of a tabular resource</Description>
<Name>tabular-data-column-widget</Name>
<Version>1.0.0-SNAPSHOT</Version>
<MavenCoordinates>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>tabular-data-column-widget</artifactId>
<version>1.0.0-SNAPSHOT</version>
</MavenCoordinates>
<Type>library</Type>
<Files>
<File>tabular-data-column-widget-1.0.0-SNAPSHOT.jar</File>
</Files>
</Software>
</Packages>
</Profile>
</Resource>

0
distro/INSTALL Normal file
View File

6
distro/LICENSE Normal file
View File

@ -0,0 +1,6 @@
gCube System - License
------------------------------------------------------------
The gCube/gCore software is licensed as Free Open Source software conveying to the EUPL (http://ec.europa.eu/idabc/eupl).
The software and documentation is provided by its authors/distributors "as is" and no expressed or
implied warranty is given for its use, quality or fitness for a particular case.

1
distro/MAINTAINERS Normal file
View File

@ -0,0 +1 @@
Giancarlo Panichi (giancarlo.panichi@isti.cnr.it), CNR Pisa, Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo"

40
distro/README Normal file
View File

@ -0,0 +1,40 @@
The gCube System - tabular-data-column-widget
------------------------------------------------------------
This work has been supported by the following European projects: iMarine (FP7-INFRASTRUCTURES-2011-2)
Authors
-------
Giancarlo Panichi (giancarlo.panichi@isti.cnr.it), CNR Pisa,
Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo"
Version and Release Date
------------------------
v. 1.0.0-SNAPSHOT (2013-10-18)
Description
-----------
tabular-data-column-widget allows to perform operations on the columns of a tabular resource
Download information
--------------------
Source code URL: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-column-widget
Documentation
-------------
tabular-data-column-widget allows to perform operations on the columns of a tabular resource
Licensing
---------
This software is licensed under the terms you may find in the file named "LICENSE" in this directory.

6
distro/changelog.xml Normal file
View File

@ -0,0 +1,6 @@
<ReleaseNotes>
<Changeset component="org.gcube.portlets.user.tabular-data-column-widget.1-0-0"
date="2013-12-18">
<Change>First Release</Change>
</Changeset>
</ReleaseNotes>

1
distro/svnpath.txt Normal file
View File

@ -0,0 +1 @@
https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-column-widget

View File

@ -1,265 +0,0 @@
package org.gcube.portlets.user.td.columnwidget.client.combo;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.gcube.portlets.user.td.columnwidget.client.resources.ResourceBundle;
import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource;
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.event.logical.shared.SelectionEvent;
import com.google.gwt.event.logical.shared.SelectionHandler;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.rpc.AsyncCallback;
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.data.client.loader.RpcProxy;
import com.sencha.gxt.data.shared.ListStore;
import com.sencha.gxt.data.shared.loader.LoadResultListStoreBinding;
import com.sencha.gxt.data.shared.loader.PagingLoadConfig;
import com.sencha.gxt.data.shared.loader.PagingLoadResult;
import com.sencha.gxt.data.shared.loader.PagingLoadResultBean;
import com.sencha.gxt.data.shared.loader.PagingLoader;
import com.sencha.gxt.widget.core.client.FramedPanel;
import com.sencha.gxt.widget.core.client.Window;
import com.sencha.gxt.widget.core.client.button.TextButton;
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.grid.LiveGridView;
import com.sencha.gxt.widget.core.client.grid.LiveToolItem;
import com.sencha.gxt.widget.core.client.toolbar.LabelToolItem;
import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
public class DialogCodelistSelection extends Window {
protected static final int WIDTH = 550;
protected static final int HEIGHT = 520;
protected static final int CACHE_SIZE = 200;
private static final TabResourcesProperties properties = GWT
.create(TabResourcesProperties.class);
protected static final ColumnConfig<TabResource, String> nameColumn = new ColumnConfig<TabResource, String>(
properties.name(), 50, "Name");
protected static final ColumnConfig<TabResource, String> agencyColumn = new ColumnConfig<TabResource, String>(
properties.agency(), 50, "Agency");
protected static final ColumnConfig<TabResource, String> dateColumn = new ColumnConfig<TabResource, String>(
properties.date(), 50, "Date");
protected Grid<TabResource> grid;
protected ExtendedLiveGridView liveGridView;
protected ResourceBundle res;
public DialogCodelistSelection() {
Log.info("Dialog CodelistSelection");
setWidth(WIDTH);
setHeight(HEIGHT);
res = ResourceBundle.INSTANCE;
setBodyBorder(false);
setResizable(true);
setHeadingText("Select Codelist");
FramedPanel panel = new FramedPanel();
panel.setHeaderVisible(false);
panel.setBodyBorder(false);
VerticalLayoutContainer v = new VerticalLayoutContainer();
// Search
ToolBar toolBar = new ToolBar();
toolBar.add(new LabelToolItem("Search: "));
final TextField searchField = new TextField();
toolBar.add(searchField);
TextButton btnReload = new TextButton();
btnReload.setText("Reload");
btnReload.setIcon(res.refresh());
btnReload.setToolTip("Reload");
toolBar.add(btnReload);
IdentityValueProvider<TabResource> identity = new IdentityValueProvider<TabResource>();
final CheckBoxSelectionModel<TabResource> sm = new CheckBoxSelectionModel<TabResource>(
identity);
@SuppressWarnings("unchecked")
List<ColumnConfig<TabResource, ?>> columns = Arrays
.<ColumnConfig<TabResource, ?>> asList(nameColumn,
agencyColumn, dateColumn);
ColumnModel<TabResource> cm = new ColumnModel<TabResource>(columns);
final ListStore<TabResource> store = new ListStore<TabResource>(
properties.id());
searchField.addKeyUpHandler(new KeyUpHandler() {
public void onKeyUp(KeyUpEvent event) {
Log.trace("searchTerm: " + searchField.getCurrentValue());
//store.applyFilters();
}
});
RpcProxy<PagingLoadConfig, PagingLoadResult<TabResource>> proxy = new RpcProxy<PagingLoadConfig, PagingLoadResult<TabResource>>() {
public void load(PagingLoadConfig loadConfig,
final AsyncCallback<PagingLoadResult<TabResource>> callback) {
loadData(loadConfig, callback);
}
};
final PagingLoader<PagingLoadConfig, PagingLoadResult<TabResource>> loader = new PagingLoader<PagingLoadConfig, PagingLoadResult<TabResource>>(
proxy);
loader.setRemoteSort(true);
loader.addLoadHandler(new LoadResultListStoreBinding<PagingLoadConfig, TabResource, PagingLoadResult<TabResource>>(
store));
liveGridView = new ExtendedLiveGridView();
liveGridView.setForceFit(true);
liveGridView.setEmptyText("No Matching Results.");
liveGridView.setCacheSize(CACHE_SIZE);
grid = new Grid<TabResource>(store, cm) {
@Override
protected void onAfterFirstAttach() {
super.onAfterFirstAttach();
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
public void execute() {
loader.load(0, liveGridView.getCacheSize());
}
});
}
};
sm.setSelectionMode(SelectionMode.SINGLE);
grid.setLoader(loader);
grid.setSelectionModel(sm);
grid.setView(liveGridView);
grid.setBorders(false);
grid.setLoadMask(true);
grid.setColumnReordering(true);
SelectHandler sh = new SelectHandler() {
public void onSelect(SelectEvent event) {
loader.load();
}
};
btnReload.addSelectHandler(sh);
ToolBar baseToolBar = new ToolBar();
baseToolBar.add(new LiveToolItem(grid));
baseToolBar.addStyleName(ThemeStyles.getStyle().borderTop());
baseToolBar.getElement().getStyle().setProperty("borderBottom", "none");
v.add(toolBar, new VerticalLayoutData(-1, -1));
v.add(grid, new VerticalLayoutData(1, 1));
v.add(baseToolBar, new VerticalLayoutData(1, 25));
panel.add(v);
panel.addButton(new TextButton("Select"));
add(panel);
}
protected void loadData(PagingLoadConfig loadConfig,
final AsyncCallback<PagingLoadResult<TabResource>> callback) {
/*
* TDGWTServiceAsync.INSTANCE.getTabularResources(new
* AsyncCallback<ArrayList<TabResource>>() {
*
* public void onFailure(Throwable caught) {
* Log.error("load combo failure:" + caught.getLocalizedMessage());
* callback.onFailure(caught); }
*
* public void onSuccess(ArrayList<TabResource> result) {
* Log.trace("loaded " + result.size() + " ColumnData"); /*if
* (columnName != null) { for (ColumnData cd : result) { if
* (cd.getName().compareTo(columnName) == 0) { comboColumn.setValue(cd);
* labelColumn.setValue(cd.getLabel());
* comboColumnTypeCode.select(ColumnTypeCodeStore
* .selected(cd.getTypeCode())); } } } callback.onSuccess(new
* ListLoadResultBean<TabResource>( result));
*
* }
*
*
* });
*/
ArrayList<TabResource> trs = new ArrayList<TabResource>(1000);
int totalLength = loadConfig.getOffset() + loadConfig.getLimit();
int offset = loadConfig.getOffset();
Log.debug("Offset: " + offset);
Log.debug("Limit:" + loadConfig.getLimit());
Log.debug("TotalLength:" + totalLength);
int cur = 0;
for (int i = offset; i < totalLength; i++) {
try {
cur = i + 1;
TabResource tr = new TabResource();
tr.setId(String.valueOf(i));
tr.setName("Number" + cur);
tr.setAgency("Agency" + cur);
tr.setDate("2013/11/01");
trs.add(tr);
} catch (IndexOutOfBoundsException e) {
Log.debug("OutOfBounds size:" + trs.size() + " index: " + i
+ " Error:" + e.getMessage() + "\n");
}
}
callback.onSuccess(new PagingLoadResultBean<TabResource>(trs, 1000,
offset));
}
protected HandlerRegistration addSelectionHandler(
SelectionHandler<TabResource> handler) {
SelectionHandler<TabResource> hand = new SelectionHandler<TabResource>() {
public void onSelection(SelectionEvent<TabResource> event) {
// tabResourcesSelectionPanel.getSelectedItem();
// getWizardWindow().setEnableNextButton(true);
}
};
return grid.getSelectionModel().addSelectionHandler(hand);
}
public TabResource getSelectedItem() {
return grid.getSelectionModel().getSelectedItem();
}
protected class ExtendedLiveGridView extends LiveGridView<TabResource> {
@Override
public void refresh(boolean headerToo) {
preventScrollToTopOnRefresh = true;
super.refresh(headerToo);
}
};
}

View File

@ -1,28 +0,0 @@
/**
*
*/
package org.gcube.portlets.user.td.columnwidget.client.combo;
import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource;
import com.google.gwt.editor.client.Editor.Path;
import com.sencha.gxt.core.client.ValueProvider;
import com.sencha.gxt.data.shared.ModelKeyProvider;
import com.sencha.gxt.data.shared.PropertyAccess;
/**
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public interface TabResourcesProperties extends PropertyAccess<TabResource> {
@Path("id")
ModelKeyProvider<TabResource> id();
ValueProvider<TabResource, String> name();
ValueProvider<TabResource, String> agency();
ValueProvider<TabResource, String> date();
}