33import com .google .gwt .core .client .GWT ;
44import com .google .gwt .resources .client .ClientBundle ;
55import com .google .gwt .resources .client .ImageResource ;
6+ import com .google .gwt .user .client .Window ;
67import org .reactome .web .pwp .model .client .common .ContentClientAbstract ;
78
89import 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}
0 commit comments