From 8322c7e287d68e96403b06f3b9cfefefcb248688 Mon Sep 17 00:00:00 2001
From: Giancarlo Panichi
Date: Wed, 29 Apr 2015 14:59:43 +0000
Subject: [PATCH] Added wiki link
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-toolbox-widget@114585 82a268e6-3cf1-43bd-a215-b396298e98cf
---
.../toolboxwidget/client/help/HelpPanel.java | 104 +++++++++++-------
.../client/help/HelpPanelMessages.java | 7 ++
.../client/resources/ResourceBundle.java | 32 ++++++
.../client/resources/tabular-data-wiki.png | Bin 0 -> 647 bytes
.../client/resources/tabular-data-wiki_32.png | Bin 0 -> 1143 bytes
.../client/resources/wiki_link.txt | 1 +
.../client/help/HelpPanelMessages.properties | 4 +-
.../help/HelpPanelMessages_es.properties | 4 +-
.../help/HelpPanelMessages_it.properties | 4 +-
.../client/resources/tabular-data-wiki.png | Bin 0 -> 647 bytes
.../client/resources/tabular-data-wiki_32.png | Bin 0 -> 1143 bytes
.../client/resources/wiki_link.txt | 1 +
12 files changed, 116 insertions(+), 41 deletions(-)
create mode 100644 src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/resources/ResourceBundle.java
create mode 100644 src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/resources/tabular-data-wiki.png
create mode 100644 src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/resources/tabular-data-wiki_32.png
create mode 100644 src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/resources/wiki_link.txt
create mode 100644 src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/resources/tabular-data-wiki.png
create mode 100644 src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/resources/tabular-data-wiki_32.png
create mode 100644 src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/resources/wiki_link.txt
diff --git a/src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/help/HelpPanel.java b/src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/help/HelpPanel.java
index 84d59ef..9891eb4 100644
--- a/src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/help/HelpPanel.java
+++ b/src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/help/HelpPanel.java
@@ -1,31 +1,45 @@
package org.gcube.portlets.user.td.toolboxwidget.client.help;
+
+
+import org.gcube.portlets.user.td.monitorwidget.client.utils.UtilsGXT3;
+import org.gcube.portlets.user.td.toolboxwidget.client.resources.ResourceBundle;
+
+import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.GWT;
+import com.google.gwt.resources.client.ResourceCallback;
+import com.google.gwt.resources.client.ResourceException;
+import com.google.gwt.resources.client.TextResource;
+import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.HTML;
import com.google.web.bindery.event.shared.EventBus;
+import com.sencha.gxt.cell.core.client.ButtonCell.IconAlign;
import com.sencha.gxt.core.client.util.Margins;
import com.sencha.gxt.widget.core.client.FramedPanel;
+import com.sencha.gxt.widget.core.client.button.TextButton;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;
+import com.sencha.gxt.widget.core.client.event.SelectEvent;
+import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
import com.sencha.gxt.widget.core.client.form.FieldSet;
/**
*
- * @author giancarlo
- * email: g.panichi@isti.cnr.it
+ * @author giancarlo email: g.panichi@isti.cnr.it
*
*/
public class HelpPanel extends FramedPanel {
private HelpPanelMessages msgs;
- //private String headingTitle;
- //private HashMap tabularResourcePropertiesMap;
+ // private String headingTitle;
+ // private HashMap tabularResourcePropertiesMap;
private VerticalLayoutContainer vl;
- //private EventBus eventBus;
+ // private EventBus eventBus;
private FieldSet contents;
private VerticalLayoutContainer layoutCaptions;
-
+ private TextButton wikiButton;
public HelpPanel(String name, EventBus eventBus) {
super();
@@ -40,11 +54,9 @@ public class HelpPanel extends FramedPanel {
this.add(vl);
}
-
-
-
+
public void addContents() {
- HTML title = new HTML(""+msgs.helpPanelTitle()+"");
+ HTML title = new HTML("" + msgs.helpPanelTitle() + "");
vl.add(title, new VerticalLayoutData(-1, -1, new Margins(1, 1, 10, 1)));
contents = new FieldSet();
@@ -56,44 +68,60 @@ public class HelpPanel extends FramedPanel {
contents.add(layoutCaptions);
HTML info = new HTML(msgs.info());
- layoutCaptions
- .add(info, new VerticalLayoutData(1, -1, new Margins(1)));
+ wikiButton = new TextButton(msgs.wikiButton());
+ wikiButton.setIcon(ResourceBundle.INSTANCE.wiki());
+ wikiButton.setIconAlign(IconAlign.RIGHT);
+ wikiButton.setToolTip(msgs.wikiButtonToolTip());
+ SelectHandler wikiHandler = new SelectHandler() {
-
+ public void onSelect(SelectEvent event) {
+ onWiki();
+ }
+ };
+ wikiButton.addSelectHandler(wikiHandler);
+
+ layoutCaptions.add(info, new VerticalLayoutData(1, -1, new Margins(1)));
+ layoutCaptions.add(wikiButton, new VerticalLayoutData(-1, -1,
+ new Margins(1)));
vl.add(contents, new VerticalLayoutData(1, -1, new Margins(1)));
}
- /*
- * protected void getLastTable(TRId trId) { TDGWTServiceAsync.INSTANCE
- * .getLastTable(trId,new AsyncCallback() {
- *
- * public void onSuccess(TableData result) { updateTable(result);
- * Log.info("Retrived LastTable:" + result.getName());
- *
- * }
- *
- * public void onFailure(Throwable caught) { AlertMessageBox d = new
- * AlertMessageBox("Error", "Error retrienving Last Table: " +
- * caught.getLocalizedMessage()); d.addHideHandler(new HideHandler() {
- *
- * public void onHide(HideEvent event) { //
- *
- * }
- *
- * }); d.show();
- *
- * }
- *
- * }); }
- */
+ private void onWiki() {
+ try {
+ ResourceBundle.INSTANCE.linksProperties().getText(
+ new ResourceCallback() {
+ public void onError(ResourceException e) {
+ Log.error("Error retrieving wiki link!: "
+ + e.getLocalizedMessage());
+ UtilsGXT3.alert("Error",
+ "Error retrieving wiki link!");
+ }
+
+ public void onSuccess(TextResource r) {
+ openWiki(r);
+ }
+ });
+ } catch (ResourceException e) {
+ Log.error("Error retrieving wiki link!: " + e.getLocalizedMessage());
+ UtilsGXT3.alert("Error", "Error retrieving wiki link!");
+ e.printStackTrace();
+
+ }
+
+ }
+
+ private void openWiki(TextResource r) {
+ String s = r.getText();
+ Window.open(s,
+ "Tabular Data Manager Wiki", "");
+
+ }
public void initInformation() {
addContents();
}
-
-
}
diff --git a/src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/help/HelpPanelMessages.java b/src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/help/HelpPanelMessages.java
index a554363..1e10df8 100644
--- a/src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/help/HelpPanelMessages.java
+++ b/src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/help/HelpPanelMessages.java
@@ -21,4 +21,11 @@ public interface HelpPanelMessages extends Messages {
String info();
+ @DefaultMessage("Wiki")
+ String wikiButton();
+
+ @DefaultMessage("Tabular Data Manager Wiki")
+ String wikiButtonToolTip();
+
+
}
\ No newline at end of file
diff --git a/src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/resources/ResourceBundle.java b/src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/resources/ResourceBundle.java
new file mode 100644
index 0000000..cd09686
--- /dev/null
+++ b/src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/resources/ResourceBundle.java
@@ -0,0 +1,32 @@
+package org.gcube.portlets.user.td.toolboxwidget.client.resources;
+
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.resources.client.ClientBundle;
+import com.google.gwt.resources.client.ExternalTextResource;
+import com.google.gwt.resources.client.ImageResource;
+
+
+/**
+ * Resource Bundle
+ *
+ * @author "Giancarlo Panichi"
+ * g.panichi@isti.cnr.it
+ *
+ */
+public interface ResourceBundle extends ClientBundle {
+
+ public static final ResourceBundle INSTANCE=GWT.create(ResourceBundle.class);
+
+
+ @Source("wiki_link.txt")
+ ExternalTextResource linksProperties();
+
+ @Source("tabular-data-wiki.png")
+ ImageResource wiki();
+
+ @Source("tabular-data-wiki_32.png")
+ ImageResource wiki32();
+
+
+}
\ No newline at end of file
diff --git a/src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/resources/tabular-data-wiki.png b/src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/resources/tabular-data-wiki.png
new file mode 100644
index 0000000000000000000000000000000000000000..a5f514ebb2cd482ce5de9629cb09abe09c2d72ea
GIT binary patch
literal 647
zcmV;20(kw2P)pznu
zx$1N}gE0tXfr6yl7-RQI*N8BLV4BTlyIQTjPm;vm-`|f(vOrOiVvHINhwAtH>h*f+
zcDrh~+q${AktDTREuEjAUuCn|kHum!KRH28QU^d1X_^vaB!qw@27>|f^YeJ`>GgWt
z-Q9I6mC6U;*AoJO7~^<_5C|bqC=`%{F$QZb#+aADU}l?_k<9LF)}wd
z2VlqBRLhOQIfu0t=iC^x)=mb%4F4%>E!J8xnamg)4u=oN4&bIvaCmsg;^HF47`C>y
z*xA{^7{kKC0!K$jY;SKzKtSzLjFVNb*9B-}V?&ZuE|>K$B0o1W8(7
zU)M;hE-oyu2)9jQ02U1r$fU&l9xUZ2_v)YLcY2wKX~Cbar+&CYTw$@b>cZ@=L$p
z_meV8rP7~#KL4p&tu`8s#`)~*Y&nz3eD>ad1>OKn1K^x{ou=ul5!s{v1awDJz5s^6
hZ=mFyyG_%y^%s*KLE2r8gsK1l002ovPDHLkV1l6vAUyy8
literal 0
HcmV?d00001
diff --git a/src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/resources/tabular-data-wiki_32.png b/src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/resources/tabular-data-wiki_32.png
new file mode 100644
index 0000000000000000000000000000000000000000..450b5c3c8c5f2bc461df5262612aef14c84465c6
GIT binary patch
literal 1143
zcmV--1c>{IP)Jz_BJ=EgL4YTZ04xN(<-AQ+2XxD!F~ZxFh2W49_I
zLKnJHER^nB5GxXOQ|Ush7HzdeQ|r&hbaJ|QnRzoYiHR>gaG87Odz16M-*e8ra~0m%
z3*ZyLNA2u4;LmasbXWhiX`1@O!^0(@)WEr}D9S4l@#l#=X=&4nkI%};Pd%D+}POo
z4)`000UuXHpcIK>@9n4C48y=QO>|vH*Y)7h(b135Xw(2+0!#J-f|VC4QY;Lm
z)>Baxlp^6?d7(0zrg3$3^{7%T%c8Ndk*dnDQWAw>&@|0MOhl-3E3Vkw30O**V)Ont
z0;LkO5(4UTx7uz5BUWZzmvtWm#l08TZe!`BwBaY%O)VU0hs9C=?Rl
zQJb2YlF7-*qF7s7o5$IXU6@_}Cfu^mvtB
zUS3Am-{$(#(h@+*{hj!%G8`WtclwrPv9hw_j29OdJ#!Zp7SMH_R4T>Z-X6eDc@>@)
z0^9t4zaw)f6cQ1Uv$L~DRnXkrEU8pVHa9l~5Jge?fY0B1BN`nYb^7Uan(ggvW@l%K
zL?R>-2?skpJtdt^v$(iOTU#3<@=K|2DwiCX=3O7#tjwj*bqA$K$fQyZfkA1A&0d
z&CLnWn)mg71THQvBpQu6PJBL}0J6HeDk37mV9>z=fq)o>VV9wYz_UXT3WaEIZ+FI-
zOa@g|>FetQU~Fv6!S3(xiAJL|H8s`lFe-EcFg!f$^aln8JXm*kH>PPmc{6IQ_6B5{
zrX%(G`nvP}{QO)Zk%)tBZEe|SLfH@~B9hH!vwv06fb`JN&<#L19JXSyn1h8vp>#AF
z{Rg1FzCPR8*_jrRY`y}d*azaLnx?(5EbF$4E1CeG0p9>W17ErpWdZ%bSHL{*HDG9(
zR&QC>HLzPqK+j*#>)Z@0uv~s;(~Df~tvu$>;|g#G{0jUF@E_C=w*k6uLE``b002ov
JPDHLkV1fgS6*K?<
literal 0
HcmV?d00001
diff --git a/src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/resources/wiki_link.txt b/src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/resources/wiki_link.txt
new file mode 100644
index 0000000..b3b826d
--- /dev/null
+++ b/src/main/java/org/gcube/portlets/user/td/toolboxwidget/client/resources/wiki_link.txt
@@ -0,0 +1 @@
+http://gcube.wiki.gcube-system.org/gcube/index.php/Tabular_Data_Manager
\ No newline at end of file
diff --git a/src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/help/HelpPanelMessages.properties b/src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/help/HelpPanelMessages.properties
index 760d333..c727c37 100644
--- a/src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/help/HelpPanelMessages.properties
+++ b/src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/help/HelpPanelMessages.properties
@@ -8,4 +8,6 @@ Tabular Resource are used in many domains ranging from statistics to signal proc
and econometrics. Tabular Data Manager offers a rich set of facilities ranging \
from those supporting the assessment of data correctness to those supporting \
the verification of the compliance of data with given code lists, \
-the aggregation and filtering of data.
\ No newline at end of file
+the aggregation and filtering of data.
+wikiButton=Wiki
+wikiButtonToolTip=Tabular Data Manager Wiki
\ No newline at end of file
diff --git a/src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/help/HelpPanelMessages_es.properties b/src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/help/HelpPanelMessages_es.properties
index 50cd162..1fa5165 100644
--- a/src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/help/HelpPanelMessages_es.properties
+++ b/src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/help/HelpPanelMessages_es.properties
@@ -8,4 +8,6 @@ de un determinado evento o fenómeno en diferentes intervalos de tiempo. \
y econometría. Tabular Data Manager ofrece un amplio conjunto de servicios que van \
por quienes soliciten la evaluación de la corrección de datos a los que apoyan \
la verificación del cumplimiento de los datos con listas de códigos dados, \
-la agregación y filtrado de datos.
\ No newline at end of file
+la agregación y filtrado de datos.
+wikiButton=Wiki
+wikiButtonToolTip=Tabular Data Manager Wiki
\ No newline at end of file
diff --git a/src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/help/HelpPanelMessages_it.properties b/src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/help/HelpPanelMessages_it.properties
index 7991bd7..3630f3a 100644
--- a/src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/help/HelpPanelMessages_it.properties
+++ b/src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/help/HelpPanelMessages_it.properties
@@ -9,4 +9,6 @@ Le Tabular Resources sono usate in molti domini, nella statistica, nel
e nell''econometria. Tabular Data Manager offre un ricco insieme di strumenti sia \
quelli di sostegno alla valutazione della correttezza dei dati, sia quelli di supporto \
alla verifica della conformità dei dati con determinate codelist e sia quelli per \
-l''aggregazione ed il filtro dei dati.
\ No newline at end of file
+l''aggregazione ed il filtro dei dati.
+wikiButton=Wiki
+wikiButtonToolTip=Tabular Data Manager Wiki
\ No newline at end of file
diff --git a/src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/resources/tabular-data-wiki.png b/src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/resources/tabular-data-wiki.png
new file mode 100644
index 0000000000000000000000000000000000000000..a5f514ebb2cd482ce5de9629cb09abe09c2d72ea
GIT binary patch
literal 647
zcmV;20(kw2P)pznu
zx$1N}gE0tXfr6yl7-RQI*N8BLV4BTlyIQTjPm;vm-`|f(vOrOiVvHINhwAtH>h*f+
zcDrh~+q${AktDTREuEjAUuCn|kHum!KRH28QU^d1X_^vaB!qw@27>|f^YeJ`>GgWt
z-Q9I6mC6U;*AoJO7~^<_5C|bqC=`%{F$QZb#+aADU}l?_k<9LF)}wd
z2VlqBRLhOQIfu0t=iC^x)=mb%4F4%>E!J8xnamg)4u=oN4&bIvaCmsg;^HF47`C>y
z*xA{^7{kKC0!K$jY;SKzKtSzLjFVNb*9B-}V?&ZuE|>K$B0o1W8(7
zU)M;hE-oyu2)9jQ02U1r$fU&l9xUZ2_v)YLcY2wKX~Cbar+&CYTw$@b>cZ@=L$p
z_meV8rP7~#KL4p&tu`8s#`)~*Y&nz3eD>ad1>OKn1K^x{ou=ul5!s{v1awDJz5s^6
hZ=mFyyG_%y^%s*KLE2r8gsK1l002ovPDHLkV1l6vAUyy8
literal 0
HcmV?d00001
diff --git a/src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/resources/tabular-data-wiki_32.png b/src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/resources/tabular-data-wiki_32.png
new file mode 100644
index 0000000000000000000000000000000000000000..450b5c3c8c5f2bc461df5262612aef14c84465c6
GIT binary patch
literal 1143
zcmV--1c>{IP)Jz_BJ=EgL4YTZ04xN(<-AQ+2XxD!F~ZxFh2W49_I
zLKnJHER^nB5GxXOQ|Ush7HzdeQ|r&hbaJ|QnRzoYiHR>gaG87Odz16M-*e8ra~0m%
z3*ZyLNA2u4;LmasbXWhiX`1@O!^0(@)WEr}D9S4l@#l#=X=&4nkI%};Pd%D+}POo
z4)`000UuXHpcIK>@9n4C48y=QO>|vH*Y)7h(b135Xw(2+0!#J-f|VC4QY;Lm
z)>Baxlp^6?d7(0zrg3$3^{7%T%c8Ndk*dnDQWAw>&@|0MOhl-3E3Vkw30O**V)Ont
z0;LkO5(4UTx7uz5BUWZzmvtWm#l08TZe!`BwBaY%O)VU0hs9C=?Rl
zQJb2YlF7-*qF7s7o5$IXU6@_}Cfu^mvtB
zUS3Am-{$(#(h@+*{hj!%G8`WtclwrPv9hw_j29OdJ#!Zp7SMH_R4T>Z-X6eDc@>@)
z0^9t4zaw)f6cQ1Uv$L~DRnXkrEU8pVHa9l~5Jge?fY0B1BN`nYb^7Uan(ggvW@l%K
zL?R>-2?skpJtdt^v$(iOTU#3<@=K|2DwiCX=3O7#tjwj*bqA$K$fQyZfkA1A&0d
z&CLnWn)mg71THQvBpQu6PJBL}0J6HeDk37mV9>z=fq)o>VV9wYz_UXT3WaEIZ+FI-
zOa@g|>FetQU~Fv6!S3(xiAJL|H8s`lFe-EcFg!f$^aln8JXm*kH>PPmc{6IQ_6B5{
zrX%(G`nvP}{QO)Zk%)tBZEe|SLfH@~B9hH!vwv06fb`JN&<#L19JXSyn1h8vp>#AF
z{Rg1FzCPR8*_jrRY`y}d*azaLnx?(5EbF$4E1CeG0p9>W17ErpWdZ%bSHL{*HDG9(
zR&QC>HLzPqK+j*#>)Z@0uv~s;(~Df~tvu$>;|g#G{0jUF@E_C=w*k6uLE``b002ov
JPDHLkV1fgS6*K?<
literal 0
HcmV?d00001
diff --git a/src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/resources/wiki_link.txt b/src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/resources/wiki_link.txt
new file mode 100644
index 0000000..b3b826d
--- /dev/null
+++ b/src/main/resources/org/gcube/portlets/user/td/toolboxwidget/client/resources/wiki_link.txt
@@ -0,0 +1 @@
+http://gcube.wiki.gcube-system.org/gcube/index.php/Tabular_Data_Manager
\ No newline at end of file