X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FVamsasDatastore.java;h=efc13da6ebabcbd1b53837af76e323d3072fce5f;hb=2f1b1f33d31e1b068cea66d66f0bed29a4585cf7;hp=69213af08b8117667964eb09e13eaf0aba712a67;hpb=4e988b599b29712e28b5746d7594c33c67cd2f74;p=jalview.git diff --git a/src/jalview/io/VamsasDatastore.java b/src/jalview/io/VamsasDatastore.java index 69213af..efc13da 100755 --- a/src/jalview/io/VamsasDatastore.java +++ b/src/jalview/io/VamsasDatastore.java @@ -24,6 +24,8 @@ import org.vamsas.objects.core.*; import jalview.gui.*; import java.io.*; import java.util.jar.*; +import org.exolab.castor.xml.*; +import org.exolab.castor.mapping.Mapping; /* @@ -50,6 +52,33 @@ public class VamsasDatastore storeVAMSAS(file); } + public void storeJalview(String file, AlignFrame af) + { + try + { + // 1. Load the mapping information from the file + Mapping map = new Mapping(getClass().getClassLoader()); + java.net.URL url = getClass().getResource("/jalview_mapping.xml"); + map.loadMapping(url); + + // 2. Unmarshal the data + // Unmarshaller unmar = new Unmarshaller(); + //unmar.setIgnoreExtraElements(true); + //unmar.setMapping(map); + // uni = (UniprotFile) unmar.unmarshal(new FileReader(file)); + + // 3. marshal the data with the total price back and print the XML in the console + Marshaller marshaller = new Marshaller( new FileWriter(file) ); + + marshaller.setMapping(map); + marshaller.marshal(af); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + public VAMSAS storeVAMSAS(String file)