Skip to content

Commit 0fae9b8

Browse files
committed
✨ launch Newt in download tab
1 parent 8bfa003 commit 0fae9b8

3 files changed

Lines changed: 19 additions & 1 deletion

File tree

src/main/java/org/reactome/web/pwp/client/details/tabs/downloads/widgets/DownloadItem.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ public class DownloadItem extends FlowPanel {
2323

2424
public DownloadItem(final DownloadType type, final List<String> urls) {
2525
setStyleName(RESOURCES.getCSS().downloadItem());
26-
setTitle("View/download in " + type.getTooltip() + " format");
26+
27+
if(type.getTooltip().equals("NEWT")){
28+
setTitle("SBGN view in " + type.getTooltip() + " Editor");
29+
} else {
30+
setTitle("View/download in " + type.getTooltip() + " format");
31+
}
2732

2833
FlowPanel container = new FlowPanel();
2934
container.add(new Image(type.getIcon()));

src/main/java/org/reactome/web/pwp/client/details/tabs/downloads/widgets/DownloadType.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import com.google.gwt.core.client.GWT;
44
import com.google.gwt.resources.client.ClientBundle;
55
import com.google.gwt.resources.client.ImageResource;
6+
import com.google.gwt.user.client.Window;
67
import org.reactome.web.pwp.model.client.common.ContentClientAbstract;
78

89
import java.util.Arrays;
@@ -18,6 +19,7 @@ public enum DownloadType {
1819
BIOPAX_2 ("BIOPAX 2", "/ReactomeRESTfulAPI/RESTfulWS/biopaxExporter/Level2/__ID__", "Biopax 2", DownloadIcons.INSTANCE.BioPAX2Icon(), Group.FORMAT ),
1920
BIOPAX_3 ("BIOPAX 3", "/ReactomeRESTfulAPI/RESTfulWS/biopaxExporter/Level3/__ID__", "Biopax 3", DownloadIcons.INSTANCE.BioPAX3Icon(), Group.FORMAT),
2021
PDF ("PDF", ContentClientAbstract.CONTENT_SERVICE + "exporter/document/event/__STID__.pdf__PARAMS__", "PDF", DownloadIcons.INSTANCE.PDFIcon(), Group.FORMAT),
22+
NEWT ("NEWT EDITOR", "https://web.newteditor.org/?URL=https://" + getHost() + ContentClientAbstract.CONTENT_SERVICE + "exporter/event/__STID__.sbgn" + "&inferNestingOnLoad=true&mapColorScheme=opposed_red_blue&fitLabelsToNodes=true", "NEWT", DownloadIcons.INSTANCE.NEWTIcon(), Group.FORMAT),
2123
// PROTEGE ("Protege", "/cgi-bin/protegeexporter?DB=__DB__&ID=__ID__", "OWL", DownloadIcons.INSTANCE.ProtegeIcon(), Group.FORMAT),
2224
SVG ("SVG", ContentClientAbstract.CONTENT_SERVICE + "exporter/diagram/__STID__.svg__PARAMS__", "SVG", DownloadIcons.INSTANCE.SVGIcon(), Group.DIAGRAM),
2325
// POWERPOINT ("Powerpoint", ContentClientAbstract.CONTENT_SERVICE + "exporter/diagram/__STID__.pptx__PARAMS__", "PPTX", DownloadIcons.INSTANCE.PowerPointIcon(), Group.FORMAT),
@@ -77,6 +79,14 @@ public boolean hasQualityOptions() {
7779
return hasQualityOptions;
7880
}
7981

82+
public static String getHost() {
83+
String hostName = Window.Location.getHostName();
84+
if (hostName.equals("localhost") || hostName.equals("127.0.0.1")) {
85+
return "dev.reactome.org";
86+
}
87+
return hostName;
88+
}
89+
8090
public interface DownloadIcons extends ClientBundle {
8191

8292
DownloadIcons INSTANCE = GWT.create(DownloadIcons.class);
@@ -116,5 +126,8 @@ public interface DownloadIcons extends ClientBundle {
116126

117127
@Source("images/GIF_download.png")
118128
ImageResource GIFIcon();
129+
130+
@Source("images/NEWT_editor.png")
131+
ImageResource NEWTIcon();
119132
}
120133
}
903 Bytes
Loading

0 commit comments

Comments
 (0)