Commits

Sam Adams committed e63bf88

Renamed ContentLoad* to Deposit*

  • Participants
  • Parent commits ceb8230

Comments (0)

Files changed (4)

File crystallography-importer/src/main/java/uk/ac/cam/ch/wwmm/chempound/crystal/importer/CrystalStructureImporter.java

 
 import com.hp.hpl.jena.rdf.model.Model;
 import com.hp.hpl.jena.rdf.model.Resource;
-import com.hp.hpl.jena.rdf.model.Statement;
-import com.hp.hpl.jena.rdf.model.StmtIterator;
 import com.hp.hpl.jena.sparql.vocabulary.FOAF;
 import com.hp.hpl.jena.vocabulary.RDFS;
 import nu.xom.*;
 import org.apache.commons.io.FileUtils;
-import org.apache.commons.io.IOUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.xmlcml.cif.CIF;
 import org.xmlcml.cml.element.CMLIdentifier;
 import org.xmlcml.cml.element.CMLMolecule;
 import org.xmlcml.cml.tools.ConnectionTableTool;
-import sea36.image.jmol.ImageGeneratorJmol;
-import uk.ac.cam.ch.wwmm.chempound.ContentImporter;
 import uk.ac.cam.ch.wwmm.chempound.chemistry.CmlImporter;
 import uk.ac.cam.ch.wwmm.chempound.chemistry.inchi.InchiTool;
-import uk.ac.cam.ch.wwmm.chempound.content.ContentLoadRequest;
-import uk.ac.cam.ch.wwmm.chempound.content.DefaultContentLoadRequest;
+import uk.ac.cam.ch.wwmm.chempound.content.DepositRequest;
+import uk.ac.cam.ch.wwmm.chempound.content.DefaultDepositRequest;
 import uk.ac.cam.ch.wwmm.chempound.crystal.importer.utils.CifIO;
 import uk.ac.cam.ch.wwmm.chempound.crystal.importer.utils.CifSplitter;
-import uk.ac.cam.ch.wwmm.chempound.crystal.rdf.ont.CifDict;
 import uk.ac.cam.ch.wwmm.chempound.crystal.rdf.ont.Cryst;
 import uk.ac.cam.ch.wwmm.chempound.rdf.DCTerms;
 import uk.ac.cam.ch.wwmm.chempound.rdf.chempound.ChempoundAggregation;
 
 import java.io.*;
 import java.net.URI;
-import java.util.ArrayList;
 import java.util.List;
 
 import static org.xmlcml.cml.base.CMLConstants.CML_XPATH;
 
     private void loadCif(CIF cif, String id) throws IOException, ParsingException {
 
-        ContentLoadRequest loadRequest = generateDepositRequest(cif, id);
+        DepositRequest loadRequest = generateDepositRequest(cif, id);
 
         loadContent(loadRequest);
 
     }
 
 
-    public ContentLoadRequest generateDepositRequest(InputStream in, String id) throws IOException, ParsingException, CIFException {
+    public DepositRequest generateDepositRequest(InputStream in, String id) throws IOException, ParsingException, CIFException {
         CIF cif = CifIO.readCif(in, "UTF-8");
         return generateDepositRequest(cif, id);
     }
 
-    public ContentLoadRequest generateDepositRequest(CIF cif, String id) throws IOException, ParsingException {
+    public DepositRequest generateDepositRequest(CIF cif, String id) throws IOException, ParsingException {
 
         LocalResource cifResource = createCifResource(cif, id+".cif");
 
         model.add(cifResource.getModel());
         model.add(cmlResource.getModel());
 
-        ContentLoadRequest loadRequest = new DefaultContentLoadRequest();
+        DepositRequest loadRequest = new DefaultDepositRequest();
         loadRequest.setSlug(id);
         ChempoundAggregation item = loadRequest.getResourceMetadata();
         addType(item);

File crystallography-importer/src/test/java/uk/ac/cam/ch/wwmm/chempound/crystal/importer/CrystalStructureImporterTest.java

 import org.junit.Test;
 import org.xmlcml.cif.CIF;
 import org.xmlcml.cif.CIFException;
-import uk.ac.cam.ch.wwmm.chempound.content.ContentLoadRequest;
-import uk.ac.cam.ch.wwmm.chempound.content.DefaultContentLoadRequest;
+import uk.ac.cam.ch.wwmm.chempound.content.DepositRequest;
 import uk.ac.cam.ch.wwmm.chempound.crystal.importer.utils.CifIO;
 import uk.ac.cam.ch.wwmm.chempound.crystal.rdf.CrystalEyeUtil;
 import uk.ac.cam.ch.wwmm.chempound.crystal.rdf.CrystalPersonalities;
         }
 
         CrystalStructureImporter importer = new CrystalStructureImporter();
-        ContentLoadRequest request = importer.generateDepositRequest(cif, "wn2432");
+        DepositRequest request = importer.generateDepositRequest(cif, "wn2432");
 
         Model model = request.getMetadataModel();
         CrystalStructure crystalStructure = CrystalEyeUtil.createCrystalStructure(model, "");

File crystallography-test-harness/src/test/java/uk/ac/cam/ch/wwmm/chempound/crystal/CrystalIntegrationTest.java

 import com.google.inject.Guice;
 import com.google.inject.Injector;
 import com.google.inject.Module;
-import com.hp.hpl.jena.query.Dataset;
 import com.hp.hpl.jena.rdf.model.Statement;
-import com.hp.hpl.jena.tdb.TDBFactory;
 import com.hp.hpl.jena.xmloutput.RDFXMLWriterI;
 import com.hp.hpl.jena.xmloutput.impl.Abbreviated;
 import nu.xom.ParsingException;
 import uk.ac.cam.ch.wwmm.chempound.config.ChempoundConfiguration;
 import uk.ac.cam.ch.wwmm.chempound.DefaultChempoundModule;
 import uk.ac.cam.ch.wwmm.chempound.config.DefaultChempoundConfiguration;
-import uk.ac.cam.ch.wwmm.chempound.content.ContentLoadRequest;
+import uk.ac.cam.ch.wwmm.chempound.content.DepositRequest;
 import uk.ac.cam.ch.wwmm.chempound.crystal.importer.CrystalStructureImporter;
 import uk.ac.cam.ch.wwmm.chempound.crystal.importer.utils.CifIO;
-import uk.ac.cam.ch.wwmm.chempound.datastore.JenaTripleStore;
-import uk.ac.cam.ch.wwmm.chempound.datastore.TripleStore;
 import uk.ac.cam.ch.wwmm.chempound.rdf.DCTerms;
 import uk.ac.cam.ch.wwmm.chempound.storage.DepositResource;
-import uk.ac.cam.ch.wwmm.chempound.storage.FileSystemResourceStore;
-import uk.ac.cam.ch.wwmm.chempound.storage.ResourceStore;
-import uk.ac.cam.ch.wwmm.chempound.webapp.ChempoundApplication;
 import uk.ac.cam.ch.wwmm.chempound.webapp.DefaultChempoundWebModule;
-import uk.ac.cam.ch.wwmm.chempound.webapp.sword.impl.SwordModule;
 
 import java.io.*;
 import java.net.URI;
 
     private DepositReceipt performDeposit(CIF cif, String id) throws IOException, ParsingException, SWORDClientException, SWORDError, ProtocolViolationException {
         CrystalStructureImporter importer = new CrystalStructureImporter();
-        ContentLoadRequest request = importer.generateDepositRequest(cif, id);
+        DepositRequest request = importer.generateDepositRequest(cif, id);
         Deposit deposit = createDeposit(id, request);
 
         SWORDClient sword = new SWORDClient();
     }
 
 
-    private static Deposit createDeposit(String id, ContentLoadRequest request) throws IOException {
+    private static Deposit createDeposit(String id, DepositRequest request) throws IOException {
         Deposit deposit = new Deposit();
 
         EntryPart entryPart = new EntryPart();
         return deposit;
     }
 
-    private static byte[] createZipFile(ContentLoadRequest request) throws IOException {
+    private static byte[] createZipFile(DepositRequest request) throws IOException {
         ByteArrayOutputStream buffer = new ByteArrayOutputStream();
         ZipOutputStream out = new ZipOutputStream(buffer);
         for (DepositResource resource : request.getAggregatedResources()) {
         return buffer.toByteArray();
     }
 
-    private static void attachMetaData(ContentLoadRequest request, EntryPart entryPart) {
+    private static void attachMetaData(DepositRequest request, EntryPart entryPart) {
         ByteArrayOutputStream buffer = new ByteArrayOutputStream();
 
         RDFXMLWriterI w = new Abbreviated();

File crystallography-test-harness/src/test/java/uk/ac/cam/ch/wwmm/chempound/crystal/CrystalSearchIntegrationTest.java

 import com.google.inject.Guice;
 import com.google.inject.Injector;
 import com.google.inject.Module;
-import com.hp.hpl.jena.query.Dataset;
-import com.hp.hpl.jena.tdb.TDBFactory;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.IOUtils;
 import org.junit.AfterClass;
 import uk.ac.cam.ch.wwmm.chempound.DefaultChempoundModule;
 import uk.ac.cam.ch.wwmm.chempound.config.ChempoundConfiguration;
 import uk.ac.cam.ch.wwmm.chempound.config.DefaultChempoundConfiguration;
-import uk.ac.cam.ch.wwmm.chempound.content.ContentLoadRequest;
+import uk.ac.cam.ch.wwmm.chempound.content.DepositRequest;
 import uk.ac.cam.ch.wwmm.chempound.crystal.importer.CrystalStructureImporter;
-import uk.ac.cam.ch.wwmm.chempound.datastore.JenaTripleStore;
 import uk.ac.cam.ch.wwmm.chempound.deposit.SwordUtil;
-import uk.ac.cam.ch.wwmm.chempound.storage.FileSystemResourceStore;
-import uk.ac.cam.ch.wwmm.chempound.storage.ResourceStore;
 import uk.ac.cam.ch.wwmm.chempound.webapp.DefaultChempoundWebModule;
 
 import java.io.File;
             CrystalStructureImporter importer = new CrystalStructureImporter();
 //            importer.setId(id);
             importer.setCreateImages(false);
-            ContentLoadRequest request = importer.generateDepositRequest(in, id);
+            DepositRequest request = importer.generateDepositRequest(in, id);
             Deposit deposit = SwordUtil.createSwordDeposit(request);
 
             SWORDClient sword = new SWORDClient();