JAL-1835 made BioJSON embedding to html exports configurable, and trapped import...
[jalview.git] / src / jalview / io / HtmlSvgOutput.java
index 1eb86b7..7fcf629 100644 (file)
@@ -97,22 +97,24 @@ public class HtmlSvgOutput
 
       String titleSvgData = g1.getSVGDocument();
       String alignSvgData = g2.getSVGDocument();
-
+      String jsonData = null;
+      boolean isEmbbedBioJSON = Boolean.valueOf(jalview.bin.Cache
+              .getDefault("EXPORT_EMBBED_BIOJSON", "true"));
+      if (isEmbbedBioJSON)
+      {
       AlignmentExportData exportData = ap.alignFrame.getAlignmentForExport(
               JSONFile.FILE_DESC, av);
       if (exportData.getSettings().isCancelled())
       {
         return;
       }
-      String jsonData = new FormatAdapter(ap, exportData.getSettings())
+        jsonData = new FormatAdapter(ap, exportData.getSettings())
               .formatSequences(JSONFile.FILE_DESC, exportData
                       .getAlignment(), exportData.getOmitHidden(),
                       exportData.getStartEndPostions(), ap
                               .getAlignViewport().getColumnSelection());
-
-      // String jsonData = JSONFile.getJSONData(ap);
+      }
       String htmlData = getHtml(titleSvgData, alignSvgData, jsonData);
-
       FileOutputStream out = new FileOutputStream(file);
       out.write(htmlData.getBytes());
       out.flush();