fixed loss of plural alignmentannotation in new schema version
authorjprocter <jprocter@compbio.dundee.ac.uk>
Mon, 22 May 2006 16:27:33 +0000 (16:27 +0000)
committerjprocter <jprocter@compbio.dundee.ac.uk>
Mon, 22 May 2006 16:27:33 +0000 (16:27 +0000)
git-svn-id: https://svn.lifesci.dundee.ac.uk/svn/repository/trunk@225 be28352e-c001-0410-b1a7-c7978e42abec

src/org/vamsas/test/simpleclient/ArchiveReports.java

index 4d7ac5b..771b620 100644 (file)
@@ -4,6 +4,7 @@ import java.io.InputStream;
 import java.io.PrintStream;
 import java.io.PrintWriter;
 
+import org.vamsas.client.ClientDocument;
 import org.vamsas.client.Vobject;
 import org.vamsas.client.simpleclient.VamsasArchiveReader;
 import org.vamsas.objects.core.Alignment;
@@ -11,6 +12,7 @@ import org.vamsas.objects.core.AppData;
 import org.vamsas.objects.core.ApplicationData;
 import org.vamsas.objects.core.DataSet;
 import org.vamsas.objects.core.Entry;
+import org.vamsas.objects.core.Instance;
 import org.vamsas.objects.core.Provenance;
 import org.vamsas.objects.core.Tree;
 import org.vamsas.objects.core.User;
@@ -77,6 +79,13 @@ public class ArchiveReports {
     if (appD!=null) {
       // Report on root appData
       appDataEntryReport(appD, archive, cascade, outstr);
+      if (appD.getInstanceCount()>0) {
+        Instance inst[] = appD.getInstance();
+        for (int i=0,j=inst.hashCode(); i<j; i++) {
+          outstr.println("Data for App Instance URN: '"+inst[i].getUrn());
+          appDataEntryReport(inst[i],archive,cascade,outstr);
+        }
+      }
       if (appD.getUserCount()>0) {
         User users[] = appD.getUser();
         for (int i=0,j=users.length; i<j; i++) {
@@ -99,7 +108,7 @@ public class ArchiveReports {
         outstr.print("There are "+document.getApplicationDataCount()+" ApplicationData references.\n");
         ApplicationData appd[] = document.getApplicationData();
         for (int i=0,j=appd.length; i<j; i++) {
-          outstr.print("Application "+i+": '"+appd[i].getName()+"'\nVersion '"+appd[i].getVersion()+"'\nURN: '"+appd[i].getUrn()+"'\n");
+          outstr.print("Application "+i+": '"+appd[i].getName()+"'\nVersion '"+appd[i].getVersion()+"'\n");
           outstr.print("AppData is :");
           appDataReport(appd[i], archive, cascade, outstr);
         }
@@ -160,7 +169,7 @@ public class ArchiveReports {
         if (cascade)
           reportProvenance(al[i].getProvenance(), outstr);
         outstr.println("Involves "+al[i].getAlignmentSequenceCount()+" sequences, has "
-            +al[i].getAlignmentAnnotationsCount()+" annotations and "+al[i].getTreeCount()+" trees.");
+            +al[i].getAlignmentAnnotationCount()+" annotations and "+al[i].getTreeCount()+" trees.");
         if (cascade) {
           for (int t=0; t<al[i].getTreeCount(); t++)
             treeReport(al[i].getTree(t), true, outstr);