() {
+ @Override
+ public void render(Context context, ResourceTDDescriptor value,
+ SafeHtmlBuilder sb) {
+ sb.appendHtmlConstant("Name:"
+ + value.getName() + "
");
+ sb.appendHtmlConstant("Description: "
+ + value.getDescription());
+
+ sb.appendHtmlConstant("
Creation Date:"
+ + value.getCreationDate() + "
");
+ sb.appendHtmlConstant("Creator Id:"
+ + value.getCreatorId() + "
");
+ sb.appendHtmlConstant("Type:"
+ + value.getResourceType().toString() + "
");
+
+ ResourceTD resource=value.getResourceTD();
+
+ if(resource instanceof InternalURITD){
+ InternalURITD internalURITD=(InternalURITD)resource;
+
+ sb.appendHtmlConstant("File id:"
+ + internalURITD.getFileId() + "
");
+
+ sb.appendHtmlConstant("URI:"
+ + internalURITD.getUri() + "
");
+
+ } else {
+ if(resource instanceof StringResourceTD){
+ StringResourceTD stringResourceTD=(StringResourceTD)resource;
+
+ sb.appendHtmlConstant("Value:"
+ + stringResourceTD.getStringValue() + "
");
+
+ } else {
+ if(resource instanceof TableResourceTD){
+ TableResourceTD tableResourceTD=(TableResourceTD)resource;
+
+ sb.appendHtmlConstant("Table Id:"
+ + tableResourceTD.getTableId() + "
");
+
+ } else {
+
+ }
+ }
+ }
+
+ }
+
+
+
+ });
+
+ ColumnConfig nameCol = new ColumnConfig(
+ props.name(), 132, "Name");
+
+ nameCol.setCell(new AbstractCell() {
+
+ @Override
+ public void render(Context context, String value, SafeHtmlBuilder sb) {
+ sb.appendHtmlConstant("" + value
+ + "");
+
+ }
+
+ });
+
+
+ ColumnConfig typeColumn = new ColumnConfig(
+ props.resourceType(), 40, "Type");
+ /*
+ ActionButtonCellNoFirst button = new ActionButtonCellNoFirst();
+ button.setIcon(ResourceBundle.INSTANCE.undo());
+ button.setTitle("Undo");
+ button.addSelectHandler(new SelectHandler() {
+
+ @Override
+ public void onSelect(SelectEvent event) {
+ Log.debug("Button Undo Pressed");
+ Context c = event.getContext();
+ int rowIndex = c.getIndex();
+ startSearchRollBackId(rowIndex);
+ }
+ });
+
+ typeColumn.setCell(button);
+ */
+ List> l = new ArrayList>();
+ l.add(expander);
+ l.add(nameCol);
+ l.add(typeColumn);
+
+ ColumnModel cm = new ColumnModel(l);
+
+ store = new ListStore(props.id());
+
+ RpcProxy> proxy = new RpcProxy>() {
+
+ public void load(ListLoadConfig loadConfig,
+ final AsyncCallback> callback) {
+ loadData(loadConfig, callback);
+ }
+
+ };
+
+ loader = new ListLoader>(
+ proxy);
+
+ loader.setRemoteSort(false);
+ loader.addLoadHandler(new LoadResultListStoreBinding>(
+ store) {
+ });
+
+ grid = new Grid(store, cm) {
+ @Override
+ protected void onAfterFirstAttach() {
+ super.onAfterFirstAttach();
+ Scheduler.get().scheduleDeferred(new ScheduledCommand() {
+
+ public void execute() {
+ loader.load();
+ }
+ });
+ }
+ };
+
+ grid.setLoader(loader);
+ grid.setSize("200px", "300px");
+
+ 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(nameCol);
+ grid.getView().setEmptyText("Empty");
+ expander.initPlugin(grid);
+
+ /*
+ * VerticalLayoutContainer v = new VerticalLayoutContainer();
+ * v.setScrollMode(ScrollMode.AUTO); v.add(grid, new
+ * VerticalLayoutData(1, 1, new Margins(0))); v.forceLayout();
+ */
+ add(grid, new MarginData(0));
+
+ onResize();
+ }
+
+ protected void startSearchRollBackId(int rowIndex) {
+ currentRowIndex = rowIndex;
+ currentTDDescriptor = store.get(rowIndex - 1);
+ Log.debug(currentTDDescriptor.toString() + " was clicked.[rowIndex="
+ + currentRowIndex + " ]");
+ callRollBack();
+
+ }
+
+ protected void callRollBack() {
+ /*
+ rollBackSession = new RollBackSession(trId,
+
+ currentTDDescriptor.getHistoryId());
+ TDGWTServiceAsync.INSTANCE.startRollBack(rollBackSession,
+ new AsyncCallback() {
+
+ public void onFailure(Throwable caught) {
+ if (caught instanceof TDGWTSessionExpiredException) {
+ eventBus.fireEvent(new SessionExpiredEvent(
+ SessionExpiredType.EXPIREDONSERVER));
+ } else {
+ if (caught instanceof TDGWTIsLockedException) {
+ Log.error(caught.getLocalizedMessage());
+ UtilsGXT3.alert("Error Locked",
+ caught.getLocalizedMessage());
+ } else {
+ if (caught instanceof TDGWTIsFinalException) {
+ Log.error(caught.getLocalizedMessage());
+ UtilsGXT3.alert("Error Final",
+ caught.getLocalizedMessage());
+ } else {
+ Log.error("Error in rollback: "
+ + caught.getLocalizedMessage());
+ UtilsGXT3
+ .alert("Error in rollback",
+ "Error: "
+ + caught.getLocalizedMessage());
+ }
+ }
+ }
+ }
+
+ public void onSuccess(String taskId) {
+ Log.debug("Rollback started");
+ //openMonitorDialog(taskId);
+
+ }
+
+ });
+
+ */
+ }
+
+ protected void loadData(ListLoadConfig loadConfig,
+ final AsyncCallback> callback) {
+
+ TDGWTServiceAsync.INSTANCE.getResourcesTD(trId,
+ new AsyncCallback>() {
+
+ public void onFailure(Throwable caught) {
+ if (caught instanceof TDGWTSessionExpiredException) {
+ eventBus.fireEvent(new SessionExpiredEvent(
+ SessionExpiredType.EXPIREDONSERVER));
+ } else {
+ if (caught instanceof TDGWTIsLockedException) {
+ Log.error(caught.getLocalizedMessage());
+ UtilsGXT3.alert("Error Locked",
+ caught.getLocalizedMessage());
+ } else {
+ Log.error("Error Retrieving Resources: "
+ + caught.getLocalizedMessage());
+ UtilsGXT3.alert("Error retrieving resources",
+ "Error retrieving resources");
+ }
+ }
+ callback.onFailure(caught);
+ }
+
+ public void onSuccess(ArrayList result) {
+ Log.debug("loaded " + result.size());
+ callback.onSuccess(new ListLoadResultBean(
+ result));
+ }
+
+ });
+
+ }
+
+ public void update() {
+ retrieveCurrentTR();
+ loader.load();
+ forceLayout();
+ }
+
+ protected void retrieveCurrentTR() {
+ TDGWTServiceAsync.INSTANCE.getCurrentTRId(new AsyncCallback() {
+
+ public void onFailure(Throwable caught) {
+ if (caught instanceof TDGWTSessionExpiredException) {
+ eventBus.fireEvent(new SessionExpiredEvent(
+ SessionExpiredType.EXPIREDONSERVER));
+ } else {
+ if (caught instanceof TDGWTIsLockedException) {
+ Log.error(caught.getLocalizedMessage());
+ UtilsGXT3.alert("Error Locked",
+ caught.getLocalizedMessage());
+ } else {
+ Log.error("Error retrieving current TRId: "
+ + caught.getLocalizedMessage());
+ UtilsGXT3.alert("Error",
+ "Error retrieving current tabular resource id");
+ }
+ }
+ }
+
+ public void onSuccess(TRId result) {
+ Log.debug("retrieved " + result);
+ trId = result;
+ if (!drawed) {
+ draw();
+ }
+
+ }
+
+ });
+ }
+
+ protected void close() {
+
+ if (parent != null) {
+ parent.close();
+ }
+
+ }
+
+}
diff --git a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/ResourcesWidgetEntry.java b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/ResourcesWidgetEntry.java
new file mode 100644
index 0000000..fc961d5
--- /dev/null
+++ b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/ResourcesWidgetEntry.java
@@ -0,0 +1,35 @@
+package org.gcube.portlets.user.td.resourceswidget.client;
+
+
+
+import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
+
+import com.allen_sauer.gwt.log.client.Log;
+import com.google.gwt.core.client.EntryPoint;
+import com.google.web.bindery.event.shared.EventBus;
+import com.google.web.bindery.event.shared.SimpleEventBus;
+
+/**
+ *
+ * @author "Giancarlo Panichi"
+ * g.panichi@isti.cnr.it
+ *
+ */
+public class ResourcesWidgetEntry implements EntryPoint {
+
+
+ public void onModuleLoad() {
+ EventBus eventBus= new SimpleEventBus();
+
+ TRId trId=new TRId();
+ //For example Tabular Resource 7 and table 402
+ trId.setId("7");
+ trId.setTableId("402");
+
+ ResourcesDialog dialog=new ResourcesDialog(trId,eventBus);
+ dialog.show();
+
+
+ Log.info("Hello!");
+ }
+}
diff --git a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/properties/ResourceTDDescriptorProperties.java b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/properties/ResourceTDDescriptorProperties.java
new file mode 100644
index 0000000..598275f
--- /dev/null
+++ b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/properties/ResourceTDDescriptorProperties.java
@@ -0,0 +1,27 @@
+package org.gcube.portlets.user.td.resourceswidget.client.properties;
+
+import org.gcube.portlets.user.td.gwtservice.shared.tr.resources.ResourceTDDescriptor;
+import org.gcube.portlets.user.td.gwtservice.shared.tr.resources.ResourceTDType;
+
+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"
+ * g.panichi@isti.cnr.it
+ *
+ */
+public interface ResourceTDDescriptorProperties extends
+ PropertyAccess {
+
+ @Path("id")
+ ModelKeyProvider id();
+
+ ValueProvider name();
+
+ ValueProvider resourceType();
+
+}
diff --git a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/Dialog.css b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/Dialog.css
new file mode 100644
index 0000000..d44d232
--- /dev/null
+++ b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/Dialog.css
@@ -0,0 +1,3 @@
+@CHARSET "UTF-8";
+
+
diff --git a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/DialogCSS.java b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/DialogCSS.java
new file mode 100644
index 0000000..d49a81b
--- /dev/null
+++ b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/DialogCSS.java
@@ -0,0 +1,19 @@
+/**
+ *
+ */
+package org.gcube.portlets.user.td.resourceswidget.client.resources;
+
+import com.google.gwt.resources.client.CssResource;
+
+/**
+ *
+ * @author "Giancarlo Panichi"
+ * g.panichi@isti.cnr.it
+ *
+ */
+public interface DialogCSS extends CssResource {
+
+
+
+
+}
diff --git a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/ResourceBundle.java b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/ResourceBundle.java
new file mode 100644
index 0000000..f688f41
--- /dev/null
+++ b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/ResourceBundle.java
@@ -0,0 +1,80 @@
+package org.gcube.portlets.user.td.resourceswidget.client.resources;
+
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.resources.client.ClientBundle;
+import com.google.gwt.resources.client.ImageResource;
+
+/**
+ *
+ * @author "Giancarlo Panichi"
+ * g.panichi@isti.cnr.it
+ *
+ */
+public interface ResourceBundle extends ClientBundle {
+
+ public static final ResourceBundle INSTANCE=GWT.create(ResourceBundle.class);
+
+ @Source("Dialog.css")
+ DialogCSS dialogCSS();
+
+ @Source("arrow-refresh_16.png")
+ ImageResource refresh();
+
+ @Source("arrow-refresh_24.png")
+ ImageResource refresh24();
+
+
+ @Source("arrow-refresh_32.png")
+ ImageResource refresh32();
+
+ @Source("magnifier.png")
+ ImageResource magnifier();
+
+ @Source("magnifier_32.png")
+ ImageResource magnifier32();
+
+ @Source("close-red.png")
+ ImageResource close();
+
+ @Source("close-red_32.png")
+ ImageResource close32();
+
+ @Source("disk.png")
+ ImageResource save();
+
+ @Source("disk_32.png")
+ ImageResource save32();
+
+ @Source("codelist-link.png")
+ ImageResource codelistLink();
+
+ @Source("codelist-link_24.png")
+ ImageResource codelistLink24();
+
+ @Source("codelist-link_32.png")
+ ImageResource codelistLink32();
+
+ @Source("codelist-link-break.png")
+ ImageResource codelistLinkBreak();
+
+ @Source("codelist-link-break_24.png")
+ ImageResource codelistLinkBreak24();
+
+ @Source("codelist-link-break_32.png")
+ ImageResource codelistLinkBreak32();
+
+ @Source("add.png")
+ ImageResource add();
+
+ @Source("add_32.png")
+ ImageResource add32();
+
+ @Source("delete.png")
+ ImageResource delete();
+
+ @Source("delete_32.png")
+ ImageResource delete32();
+
+}
+
\ No newline at end of file
diff --git a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/accept.png b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/accept.png
new file mode 100644
index 0000000..89c8129
Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/accept.png differ
diff --git a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/add.png b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/add.png
new file mode 100644
index 0000000..6b1ab47
Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/add.png differ
diff --git a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/add_32.png b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/add_32.png
new file mode 100644
index 0000000..6981821
Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/add_32.png differ
diff --git a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/arrow-refresh_16.png b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/arrow-refresh_16.png
new file mode 100644
index 0000000..72edf8a
Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/arrow-refresh_16.png differ
diff --git a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/arrow-refresh_24.png b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/arrow-refresh_24.png
new file mode 100644
index 0000000..764f995
Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/arrow-refresh_24.png differ
diff --git a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/arrow-refresh_32.png b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/arrow-refresh_32.png
new file mode 100644
index 0000000..f3521ea
Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/arrow-refresh_32.png differ
diff --git a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/close-red.png b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/close-red.png
new file mode 100644
index 0000000..978f945
Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/close-red.png differ
diff --git a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/close-red_32.png b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/close-red_32.png
new file mode 100644
index 0000000..8e877f1
Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/close-red_32.png differ
diff --git a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/codelist-link-break.png b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/codelist-link-break.png
new file mode 100644
index 0000000..dbc316a
Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/codelist-link-break.png differ
diff --git a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/codelist-link-break_24.png b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/codelist-link-break_24.png
new file mode 100644
index 0000000..197c3a8
Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/codelist-link-break_24.png differ
diff --git a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/codelist-link-break_32.png b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/codelist-link-break_32.png
new file mode 100644
index 0000000..c2c85a9
Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/codelist-link-break_32.png differ
diff --git a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/codelist-link.png b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/codelist-link.png
new file mode 100644
index 0000000..d238e55
Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/codelist-link.png differ
diff --git a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/codelist-link_24.png b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/codelist-link_24.png
new file mode 100644
index 0000000..39bce94
Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/codelist-link_24.png differ
diff --git a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/codelist-link_32.png b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/codelist-link_32.png
new file mode 100644
index 0000000..cb1afb2
Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/codelist-link_32.png differ
diff --git a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/delete.png b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/delete.png
new file mode 100644
index 0000000..b639afd
Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/delete.png differ
diff --git a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/delete_32.png b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/delete_32.png
new file mode 100644
index 0000000..020b555
Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/delete_32.png differ
diff --git a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/disk.png b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/disk.png
new file mode 100644
index 0000000..9cce534
Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/disk.png differ
diff --git a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/disk_32.png b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/disk_32.png
new file mode 100644
index 0000000..fbb32bc
Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/disk_32.png differ
diff --git a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/error.png b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/error.png
new file mode 100644
index 0000000..c37bd06
Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/error.png differ
diff --git a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/information.png b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/information.png
new file mode 100644
index 0000000..12cd1ae
Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/information.png differ
diff --git a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/loading.gif b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/loading.gif
new file mode 100644
index 0000000..e846e1d
Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/loading.gif differ
diff --git a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/magnifier.png b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/magnifier.png
new file mode 100644
index 0000000..13024cd
Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/magnifier.png differ
diff --git a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/magnifier_32.png b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/magnifier_32.png
new file mode 100644
index 0000000..531f8ab
Binary files /dev/null and b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/resources/magnifier_32.png differ
diff --git a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/utils/Constants.java b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/utils/Constants.java
new file mode 100644
index 0000000..3ed4f99
--- /dev/null
+++ b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/utils/Constants.java
@@ -0,0 +1,7 @@
+package org.gcube.portlets.user.td.resourceswidget.client.utils;
+
+public class Constants {
+
+
+
+}
diff --git a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/utils/InfoMessageBox.java b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/utils/InfoMessageBox.java
new file mode 100644
index 0000000..c47b5b0
--- /dev/null
+++ b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/utils/InfoMessageBox.java
@@ -0,0 +1,28 @@
+package org.gcube.portlets.user.td.resourceswidget.client.utils;
+
+import com.sencha.gxt.widget.core.client.box.MessageBox;
+
+/**
+ *
+ * @author "Giancarlo Panichi"
+ * g.panichi@isti.cnr.it
+ *
+ */
+public class InfoMessageBox extends MessageBox {
+
+ /**
+ * Creates a message box with an info icon and the specified title and
+ * message.
+ *
+ * @param title
+ * the message box title
+ * @param message
+ * the message displayed in the message box
+ */
+ public InfoMessageBox(String title, String message) {
+ super(title, message);
+
+ setIcon(ICONS.info());
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/utils/UtilsGXT3.java b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/utils/UtilsGXT3.java
new file mode 100644
index 0000000..1507eff
--- /dev/null
+++ b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/utils/UtilsGXT3.java
@@ -0,0 +1,78 @@
+package org.gcube.portlets.user.td.resourceswidget.client.utils;
+
+import com.google.gwt.core.client.Callback;
+import com.google.gwt.user.client.Element;
+import com.sencha.gxt.core.client.dom.XElement;
+import com.sencha.gxt.widget.core.client.Component;
+import com.sencha.gxt.widget.core.client.box.AlertMessageBox;
+import com.sencha.gxt.widget.core.client.event.HideEvent;
+import com.sencha.gxt.widget.core.client.event.HideEvent.HideHandler;
+
+/**
+ *
+ * @author "Giancarlo Panichi" g.panichi@isti.cnr.it
+ *
+ */
+public class UtilsGXT3 {
+ public static void mask(Element element) {
+ XElement el = element. cast();
+ el.mask("Loading...");
+ }
+
+ public static void umask(Element element) {
+ element. cast().unmask();
+ }
+
+ public static void alert(String title, String message) {
+ final AlertMessageBox d = new AlertMessageBox(title, message);
+ d.addHideHandler(new HideHandler() {
+
+ public void onHide(HideEvent event) {
+
+ }
+ });
+ d.show();
+
+ }
+
+ public static void alert(String title, String message,
+ final Callback callback) {
+ final AlertMessageBox d = new AlertMessageBox(title, message);
+ d.addHideHandler(new HideHandler() {
+
+ public void onHide(HideEvent event) {
+ Component comp = event.getSource();
+ callback.onSuccess(comp);
+ }
+ });
+ d.show();
+ }
+
+ public static void info(String title, String message) {
+ final InfoMessageBox d = new InfoMessageBox(title, message);
+ d.addHideHandler(new HideHandler() {
+
+ public void onHide(HideEvent event) {
+
+ }
+ });
+ d.show();
+
+ }
+
+ public static void info(String title, String message,
+ final Callback callback) {
+ final InfoMessageBox d = new InfoMessageBox(title, message);
+ d.addHideHandler(new HideHandler() {
+
+ public void onHide(HideEvent event) {
+ Component comp = event.getSource();
+ callback.onSuccess(comp);
+ }
+ });
+ d.show();
+
+ }
+
+}
diff --git a/src/main/resources/org/gcube/portlets/user/td/resourceswidget/ResourcesWidget.gwt.xml b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/ResourcesWidget.gwt.xml
new file mode 100644
index 0000000..89555c0
--- /dev/null
+++ b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/ResourcesWidget.gwt.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/Messages.properties b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/Messages.properties
new file mode 100644
index 0000000..c222555
--- /dev/null
+++ b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/Messages.properties
@@ -0,0 +1,2 @@
+sendButton = Send
+nameField = Enter your name
\ No newline at end of file
diff --git a/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/Messages_fr.properties b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/Messages_fr.properties
new file mode 100644
index 0000000..b4a7627
--- /dev/null
+++ b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/Messages_fr.properties
@@ -0,0 +1,2 @@
+sendButton = Envoyer
+nameField = Entrez votre nom
\ No newline at end of file
diff --git a/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/Dialog.css b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/Dialog.css
new file mode 100644
index 0000000..d44d232
--- /dev/null
+++ b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/Dialog.css
@@ -0,0 +1,3 @@
+@CHARSET "UTF-8";
+
+
diff --git a/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/accept.png b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/accept.png
new file mode 100644
index 0000000..89c8129
Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/accept.png differ
diff --git a/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/add.png b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/add.png
new file mode 100644
index 0000000..6b1ab47
Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/add.png differ
diff --git a/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/add_32.png b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/add_32.png
new file mode 100644
index 0000000..6981821
Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/add_32.png differ
diff --git a/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/arrow-refresh_16.png b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/arrow-refresh_16.png
new file mode 100644
index 0000000..72edf8a
Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/arrow-refresh_16.png differ
diff --git a/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/arrow-refresh_24.png b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/arrow-refresh_24.png
new file mode 100644
index 0000000..764f995
Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/arrow-refresh_24.png differ
diff --git a/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/arrow-refresh_32.png b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/arrow-refresh_32.png
new file mode 100644
index 0000000..f3521ea
Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/arrow-refresh_32.png differ
diff --git a/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/close-red.png b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/close-red.png
new file mode 100644
index 0000000..978f945
Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/close-red.png differ
diff --git a/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/close-red_32.png b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/close-red_32.png
new file mode 100644
index 0000000..8e877f1
Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/close-red_32.png differ
diff --git a/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/codelist-link-break.png b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/codelist-link-break.png
new file mode 100644
index 0000000..dbc316a
Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/codelist-link-break.png differ
diff --git a/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/codelist-link-break_24.png b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/codelist-link-break_24.png
new file mode 100644
index 0000000..197c3a8
Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/codelist-link-break_24.png differ
diff --git a/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/codelist-link-break_32.png b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/codelist-link-break_32.png
new file mode 100644
index 0000000..c2c85a9
Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/codelist-link-break_32.png differ
diff --git a/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/codelist-link.png b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/codelist-link.png
new file mode 100644
index 0000000..d238e55
Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/codelist-link.png differ
diff --git a/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/codelist-link_24.png b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/codelist-link_24.png
new file mode 100644
index 0000000..39bce94
Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/codelist-link_24.png differ
diff --git a/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/codelist-link_32.png b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/codelist-link_32.png
new file mode 100644
index 0000000..cb1afb2
Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/codelist-link_32.png differ
diff --git a/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/delete.png b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/delete.png
new file mode 100644
index 0000000..b639afd
Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/delete.png differ
diff --git a/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/delete_32.png b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/delete_32.png
new file mode 100644
index 0000000..020b555
Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/delete_32.png differ
diff --git a/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/disk.png b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/disk.png
new file mode 100644
index 0000000..9cce534
Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/disk.png differ
diff --git a/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/disk_32.png b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/disk_32.png
new file mode 100644
index 0000000..fbb32bc
Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/disk_32.png differ
diff --git a/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/error.png b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/error.png
new file mode 100644
index 0000000..c37bd06
Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/error.png differ
diff --git a/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/information.png b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/information.png
new file mode 100644
index 0000000..12cd1ae
Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/information.png differ
diff --git a/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/loading.gif b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/loading.gif
new file mode 100644
index 0000000..e846e1d
Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/loading.gif differ
diff --git a/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/magnifier.png b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/magnifier.png
new file mode 100644
index 0000000..13024cd
Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/magnifier.png differ
diff --git a/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/magnifier_32.png b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/magnifier_32.png
new file mode 100644
index 0000000..531f8ab
Binary files /dev/null and b/src/main/resources/org/gcube/portlets/user/td/resourceswidget/client/resources/magnifier_32.png differ
diff --git a/src/main/webapp/ResourcesWidget.css b/src/main/webapp/ResourcesWidget.css
new file mode 100644
index 0000000..7aca7ac
--- /dev/null
+++ b/src/main/webapp/ResourcesWidget.css
@@ -0,0 +1,34 @@
+/** Add css rules here for your application. */
+
+
+/** Example rules used by the template application (remove for your app) */
+h1 {
+ font-size: 2em;
+ font-weight: bold;
+ color: #777777;
+ margin: 40px 0px 70px;
+ text-align: center;
+}
+
+.sendButton {
+ display: block;
+ font-size: 16pt;
+}
+
+/** Most GWT widgets already have a style name defined */
+.gwt-DialogBox {
+ width: 400px;
+}
+
+.dialogVPanel {
+ margin: 5px;
+}
+
+.serverResponseLabelError {
+ color: red;
+}
+
+/** Set ids using widget.getElement().setId("idOfElement") */
+#closeButton {
+ margin: 15px 6px 6px;
+}
diff --git a/src/main/webapp/ResourcesWidget.html b/src/main/webapp/ResourcesWidget.html
new file mode 100644
index 0000000..b59fd58
--- /dev/null
+++ b/src/main/webapp/ResourcesWidget.html
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Web Application Starter Project
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..c890b91
--- /dev/null
+++ b/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+ TDGWTService
+ org.gcube.portlets.user.td.gwtservice.server.TDGWTServiceImpl
+
+
+
+ jUnitHostImpl
+ com.google.gwt.junit.server.JUnitHostImpl
+
+
+
+
+ TDGWTService
+ ResourcesWidget/TDGWTService
+
+
+ jUnitHostImpl
+ ResourcesWidget/junithost/*
+
+
+
+
+
+ ResourcesWidget.html
+
+
+
diff --git a/src/test/java/org/gcube/portlets/user/td/resourceswidget/client/GwtTestResourcesWidget.java b/src/test/java/org/gcube/portlets/user/td/resourceswidget/client/GwtTestResourcesWidget.java
new file mode 100644
index 0000000..529ca53
--- /dev/null
+++ b/src/test/java/org/gcube/portlets/user/td/resourceswidget/client/GwtTestResourcesWidget.java
@@ -0,0 +1,64 @@
+package org.gcube.portlets.user.td.resourceswidget.client;
+
+
+
+import com.google.gwt.junit.client.GWTTestCase;
+
+/**
+ * GWT JUnit integration tests must extend GWTTestCase.
+ * Using "GwtTest*"
naming pattern exclude them from running with
+ * surefire during the test phase.
+ *
+ * If you run the tests using the Maven command line, you will have to
+ * navigate with your browser to a specific url given by Maven.
+ * See http://mojo.codehaus.org/gwt-maven-plugin/user-guide/testing.html
+ * for details.
+ */
+public class GwtTestResourcesWidget extends GWTTestCase {
+
+ /**
+ * Must refer to a valid module that sources this class.
+ */
+ public String getModuleName() {
+ return "org.gcube.portlets.user.td.resourceswidget.ResourcesWidgetJUnit";
+ }
+
+
+ /**
+ * This test will send a request to the server using the greetServer method in
+ * GreetingService and verify the response.
+ */
+ public void testGreetingService() {
+ // Create the service that we will test.
+ //GreetingServiceAsync greetingService = GWT.create(GreetingService.class);
+ //ServiceDefTarget target = (ServiceDefTarget) greetingService;
+ //target.setServiceEntryPoint(GWT.getModuleBaseURL() + "SDMXImportWizardTD/greet");
+
+ // Since RPC calls are asynchronous, we will need to wait for a response
+ // after this test method returns. This line tells the test runner to wait
+ // up to 10 seconds before timing out.
+ //delayTestFinish(10000);
+
+ // Send a request to the server.
+ /* greetingService.greetServer("GWT User", new AsyncCallback() {
+ public void onFailure(Throwable caught) {
+ // The request resulted in an unexpected error.
+ fail("Request failure: " + caught.getMessage());
+ }
+
+
+ public void onSuccess(String result) {
+ // Verify that the response is correct.
+ assertTrue(result.startsWith("Hello, GWT User!"));
+
+ // Now that we have received a response, we need to tell the test runner
+ // that the test is complete. You must call finishTest() after an
+ // asynchronous test finishes successfully, or the test will time out.
+ finishTest();
+ }
+ });*/
+
+ }
+
+
+}
diff --git a/src/test/resources/org/gcube/portlets/user/td/resourceswidget/ColumnWidgetJUnit.gwt.xml b/src/test/resources/org/gcube/portlets/user/td/resourceswidget/ColumnWidgetJUnit.gwt.xml
new file mode 100644
index 0000000..590bdd7
--- /dev/null
+++ b/src/test/resources/org/gcube/portlets/user/td/resourceswidget/ColumnWidgetJUnit.gwt.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/templates/INSTALL b/templates/INSTALL
new file mode 100644
index 0000000..e69de29
diff --git a/templates/LICENSE b/templates/LICENSE
new file mode 100644
index 0000000..cc51139
--- /dev/null
+++ b/templates/LICENSE
@@ -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.
\ No newline at end of file
diff --git a/templates/MAINTAINERS b/templates/MAINTAINERS
new file mode 100644
index 0000000..0bc9be3
--- /dev/null
+++ b/templates/MAINTAINERS
@@ -0,0 +1 @@
+Giancarlo Panichi (giancarlo.panichi@isti.cnr.it), CNR Pisa, Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo"
diff --git a/templates/README b/templates/README
new file mode 100644
index 0000000..7e3ad55
--- /dev/null
+++ b/templates/README
@@ -0,0 +1,48 @@
+The gCube System - ${name}
+------------------------------------------------------------
+
+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. ${version} (${release.date})
+
+
+Description
+-----------
+
+${project.description}
+
+
+Download information
+--------------------
+Source code is available from SVN:
+ ${scm.url}
+
+Binaries can be downloaded from:
+ http://software.d4science.research-infrastructures.eu/
+
+
+Documentation
+-------------
+
+${project.description}
+
+Documentation is available on-line from the Projects Documentation Wiki:
+ ${wikiurl}
+
+
+Licensing
+---------
+
+This software is licensed under the terms you may find in the file named "LICENSE" in this directory.
+
+
diff --git a/templates/changelog.xml b/templates/changelog.xml
new file mode 100644
index 0000000..4d09efc
--- /dev/null
+++ b/templates/changelog.xml
@@ -0,0 +1,6 @@
+
+
+ First Release
+
+
\ No newline at end of file
diff --git a/templates/descriptor.xml b/templates/descriptor.xml
new file mode 100644
index 0000000..b978636
--- /dev/null
+++ b/templates/descriptor.xml
@@ -0,0 +1,39 @@
+
+ servicearchive
+
+ tar.gz
+
+ /
+
+
+ ${distroDirectory}
+ /
+ true
+
+ README
+ LICENSE
+ INSTALL
+ MAINTAINERS
+ changelog.xml
+
+ 755
+
+
+
+
+
+ /${artifactId}
+
+
+
+ /
+
+
+
+ /${artifactId}
+
+
+
\ No newline at end of file
diff --git a/templates/profile.xml b/templates/profile.xml
new file mode 100644
index 0000000..19ed5bc
--- /dev/null
+++ b/templates/profile.xml
@@ -0,0 +1,29 @@
+
+
+
+ Service
+
+ ${project.description}
+ PortletsUser
+ ${project.name}
+ ${version}
+
+
+ ${project.description}
+ ${project.name}
+ ${version}
+
+ ${project.groupId}
+ ${project.artifactId}
+ ${project.version}
+
+ library
+
+ ${project.build.finalName}.${project.packaging}
+
+
+
+
+
+
+
diff --git a/templates/svnpath.txt b/templates/svnpath.txt
new file mode 100644
index 0000000..dcd0d22
--- /dev/null
+++ b/templates/svnpath.txt
@@ -0,0 +1 @@
+${scm.url}
\ No newline at end of file