66 lines
2.1 KiB
Java
66 lines
2.1 KiB
Java
package org.gcube.portlets.widgets.ckancontentmoderator.client;
|
|
|
|
import java.util.List;
|
|
|
|
import org.gcube.datacatalogue.utillibrary.shared.ItemStatus;
|
|
import org.gcube.portlets.widgets.ckancontentmoderator.client.material.table.CustomizedView;
|
|
import org.gcube.portlets.widgets.ckancontentmoderator.client.resources.DataTableClientBundle;
|
|
import org.gcube.portlets.widgets.ckancontentmoderator.shared.CatalogueDataset;
|
|
|
|
import com.google.gwt.core.client.EntryPoint;
|
|
import com.google.gwt.core.client.GWT;
|
|
import com.google.gwt.dom.client.StyleInjector;
|
|
import com.google.gwt.user.client.Window;
|
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
|
import com.google.gwt.user.client.ui.RootPanel;
|
|
|
|
/**
|
|
* Entry point classes define <code>onModuleLoad()</code>.
|
|
*/
|
|
public class CkanContentModeratorWidget implements EntryPoint {
|
|
/**
|
|
* The message displayed to the user when the server cannot be reached or
|
|
* returns an error.
|
|
*/
|
|
private static final String SERVER_ERROR = "An error occurred while "
|
|
+ "attempting to contact the server. Please check your network " + "connection and try again.";
|
|
|
|
/**
|
|
* Create a remote service proxy to talk to the server-side Greeting service.
|
|
*/
|
|
private final CkanContentModeratorServiceAsync greetingService = GWT.create(CkanContentModeratorService.class);
|
|
|
|
/**
|
|
* This is the entry point method.
|
|
*/
|
|
public void onModuleLoad() {
|
|
/*StyleInjector.inject(DataTableClientBundle.INSTANCE.dataTable().getText());
|
|
|
|
// MaterialDataTable<String> table = new MaterialDataTable<String>();
|
|
// table.getTableTitle().setText("Customers");
|
|
// List<String> users = new ArrayList<String>();
|
|
// users.add("Pippo");
|
|
// table.setRowData(0, users);
|
|
|
|
final CustomizedView cvTable = new CustomizedView();
|
|
RootPanel.get().add(cvTable);
|
|
// table.getView().refresh();
|
|
|
|
greetingService.getListItemsForStatus(ItemStatus.PENDING, 20, 0, new AsyncCallback<List<CatalogueDataset>>() {
|
|
|
|
@Override
|
|
public void onSuccess(List<CatalogueDataset> result) {
|
|
cvTable.setData(result);
|
|
|
|
}
|
|
|
|
@Override
|
|
public void onFailure(Throwable caught) {
|
|
Window.alert(caught.getMessage());
|
|
|
|
}
|
|
});*/
|
|
}
|
|
|
|
}
|