diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..2f96405 --- /dev/null +++ b/.classpath @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000..f0792fc --- /dev/null +++ b/.project @@ -0,0 +1,53 @@ + + + tabular-data-resources-widget + + + + + + org.eclipse.wst.jsdt.core.javascriptValidator + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.wst.validation.validationbuilder + + + + + com.google.gdt.eclipse.core.webAppProjectValidator + + + + + com.google.gwt.eclipse.core.gwtProjectValidator + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + org.eclipse.wst.common.project.facet.core.nature + com.google.gwt.eclipse.core.gwtNature + org.eclipse.wst.jsdt.core.jsNature + + diff --git a/ResourcesWidget.launch b/ResourcesWidget.launch new file mode 100644 index 0000000..5a9531d --- /dev/null +++ b/ResourcesWidget.launch @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..f10baf6 --- /dev/null +++ b/pom.xml @@ -0,0 +1,318 @@ + + + + + maven-parent + org.gcube.tools + 1.0.0 + + + + + 4.0.0 + org.gcube.portlets.user + tabular-data-resources-widget + 1.0.0-SNAPSHOT + + + tabular-data-resources-widget + tabular-data-resources-widget allows to a to manage the resources of a TR + + + https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-resources-widget + + + + + Giancarlo Panichi + g.panichi@isti.cnr.it + CNR Pisa, Istituto di Scienza e Tecnologie dell'Informazione "A. Faedo" + + architect + developer + + + + + + ${project.basedir}/distro + ${project.build.directory}/${project.build.finalName} + 2014-09-12 + https://gcube.wiki.gcube-system.org/gcube/index.php + templates + distro + config + + + 2.5.1 + + ${env.KEYS} + + + UTF-8 + UTF-8 + + + + + + + localRun + + + org.gcube.common + home-library + + + org.slf4j + slf4j-api + compile + + + ch.qos.logback + logback-classic + 1.0.1 + runtime + + + + + + + + + com.google.gwt + gwt-servlet + + + com.google.gwt + gwt-user + + + + + javax.validation + validation-api + 1.0.0.GA + test + + + javax.validation + validation-api + 1.0.0.GA + sources + test + + + + com.sencha.gxt + gxt + 3.0.1 + + + + org.gcube.common + home-library + + provided + + + + + + org.gcube.portlets.user + tabular-data-gwt-service + [2.0.0-SNAPSHOT,3.0.0-SNAPSHOT) + provided + + + + + org.gcube.portlets.user + tabular-data-widget-common-event + [1.0.0-SNAPSHOT,2.0.0-SNAPSHOT) + provided + + + + + + com.allen-sauer.gwt.log + gwt-log + 3.2.1 + provided + + + + org.slf4j + slf4j-api + + + + + + junit + junit + 4.8.1 + test + + + + + + + + + + ${webappDirectory}/WEB-INF/classes + + + src/main/resources + + **/*.* + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.16 + + true + + + + + org.apache.maven.surefire + surefire-junit47 + 2.16 + + + + + + + org.codehaus.mojo + gwt-maven-plugin + ${gwtVersion} + + + + resources + + + + + ResourcesWidget.html + ${webappDirectory} + org.gcube.portlets.user.td.resourceswidget.ResourcesWidget + + + + + + maven-resources-plugin + 2.6 + + + copy-profile + process-resources + + copy-resources + + + ${configDirectory} + + + ${templatesDirectory} + + profile.xml + + true + + + + + + copy-distro-resources + process-resources + + copy-resources + + + ${distroDirectory} + + + ${templatesDirectory} + + profile.xml + descriptor.xml + + true + + + + + + + + maven-clean-plugin + 2.5 + + + + ${distroDirectory} + + ** + + false + + + ${configDirectory} + + ** + + false + + + + + + org.apache.maven.plugins + maven-assembly-plugin + 2.2 + + + ${templatesDirectory}/descriptor.xml + + + + + servicearchive + package + + single + + + + + + + + + + + + + org.gcube.distribution + maven-portal-bom + LATEST + pom + import + + + + diff --git a/src/main/java/org/gcube/portlets/user/td/resourceswidget/ColumnWidget.gwt.xml b/src/main/java/org/gcube/portlets/user/td/resourceswidget/ColumnWidget.gwt.xml new file mode 100644 index 0000000..309634c --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/td/resourceswidget/ColumnWidget.gwt.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/ResourcesDialog.java b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/ResourcesDialog.java new file mode 100644 index 0000000..1b0acf4 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/ResourcesDialog.java @@ -0,0 +1,70 @@ +package org.gcube.portlets.user.td.resourceswidget.client; + +import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId; + +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; + +/** + * Delete Column Dialog + * + * @author "Giancarlo Panichi" + * g.panichi@isti.cnr.it + * + */ +public class ResourcesDialog extends Window { + protected String WIDTH = "320px"; + protected String HEIGHT = "540px"; + protected TRId trId; + + protected EventBus eventBus; + + public ResourcesDialog(TRId trId, EventBus eventBus) { + create(trId, eventBus); + } + + + protected void create(TRId trId, EventBus eventBus) { + this.trId = trId; + + this.eventBus=eventBus; + initWindow(); + + ResourcesPanel resourcesPanel= new ResourcesPanel(this, trId, eventBus); + add(resourcesPanel); + } + + protected void initWindow() { + setWidth(WIDTH); + setHeight(HEIGHT); + setBodyBorder(false); + setResizable(false); + setHeadingText("Resources"); + //getHeader().setIcon(Resources.IMAGES.side_list()); + } + + + /** + * {@inheritDoc} + */ + @Override + protected void initTools() { + super.initTools(); + + closeBtn.addSelectHandler(new SelectHandler() { + + public void onSelect(SelectEvent event) { + close(); + } + }); + + } + + public void close() { + hide(); + + } + +} diff --git a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/ResourcesPanel.java b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/ResourcesPanel.java new file mode 100644 index 0000000..e7a50ad --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/ResourcesPanel.java @@ -0,0 +1,400 @@ +package org.gcube.portlets.user.td.resourceswidget.client; + +import java.util.ArrayList; +import java.util.List; + +import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync; +import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsLockedException; +import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException; +import org.gcube.portlets.user.td.gwtservice.shared.history.RollBackSession; +import org.gcube.portlets.user.td.gwtservice.shared.tr.TableData; +import org.gcube.portlets.user.td.gwtservice.shared.tr.resources.InternalURITD; +import org.gcube.portlets.user.td.gwtservice.shared.tr.resources.ResourceTD; +import org.gcube.portlets.user.td.gwtservice.shared.tr.resources.ResourceTDDescriptor; +import org.gcube.portlets.user.td.gwtservice.shared.tr.resources.ResourceTDType; +import org.gcube.portlets.user.td.gwtservice.shared.tr.resources.StringResourceTD; +import org.gcube.portlets.user.td.gwtservice.shared.tr.resources.TableResourceTD; +import org.gcube.portlets.user.td.resourceswidget.client.properties.ResourceTDDescriptorProperties; +import org.gcube.portlets.user.td.resourceswidget.client.utils.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; +import com.google.gwt.cell.client.AbstractCell; +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.safehtml.shared.SafeHtmlBuilder; +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.google.web.bindery.event.shared.EventBus; +import com.sencha.gxt.core.client.IdentityValueProvider; +import com.sencha.gxt.data.client.loader.RpcProxy; +import com.sencha.gxt.data.shared.ListStore; +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.container.MarginData; +import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer; +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.RowExpander; + +/** + * + * ResourcesPanel shows the resources + * + * + * @author "Giancarlo Panichi" g.panichi@isti.cnr.it + * + */ +public class ResourcesPanel extends FramedPanel { + protected String WIDTH = "298px"; + protected String HEIGHT = "520px"; + + protected ResourcesDialog parent; + protected TRId trId; + protected TableData table; + protected String headingTitle; + protected VerticalLayoutContainer vl; + protected EventBus eventBus; + + protected ListStore store; + protected ListLoader> loader; + protected Grid grid; + + protected ResourceTDDescriptor currentTDDescriptor; + protected int currentRowIndex; + protected RollBackSession rollBackSession; + + private boolean drawed = false; + + public ResourcesPanel(ResourcesDialog parent, TRId trId, EventBus eventBus) { + super(); + this.parent = parent; + this.trId = trId; + this.eventBus = eventBus; + forceLayoutOnResize = true; + draw(); + } + + public ResourcesPanel(TRId trId, EventBus eventBus) { + super(); + this.trId = trId; + this.eventBus = eventBus; + forceLayoutOnResize = true; + draw(); + } + + protected void draw() { + drawed = true; + init(); + create(); + } + + protected void init() { + setWidth(WIDTH); + setHeight(HEIGHT); + setHeaderVisible(false); + setBodyBorder(false); + setResize(true); + + } + + protected void create() { + ResourceTDDescriptorProperties props = GWT.create(ResourceTDDescriptorProperties.class); + + IdentityValueProvider identityProvider = new IdentityValueProvider(); + RowExpander expander = new RowExpander( + identityProvider, new AbstractCell() { + @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 + + + + + ${distroDirectory}/svnpath.txt + /${artifactId} + + + ${configDirectory}/profile.xml + / + + + target/${build.finalName}.${packaging} + /${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