Commits

Sam Adams committed 76ba5c9

Add fields to DepositItemResponse

Comments (0)

Files changed (2)

chempound-client/src/main/java/net/chempound/client/DefaultChempoundClient.java

     }
 
     private static DepositItemResponse mapDepositItemResponse(final DepositReceipt receipt) {
-        return new DepositItemResponse(
+        return new DepositItemResponse(receipt.getEntry().getTitle(),
                                        URI.create(receipt.getSplashPageIRI().toString()),
-                                       receipt.getEditLink().getHref()
-        );
+                                       receipt.getEditLink(),
+                                       receipt.getEditMediaLink(),
+                                       receipt.getSwordEditLink(),
+                                       receipt.getDerivedResourceLinks());
     }
 
     private static void attachMetadata(final EntryPart entryPart, final Model metadataModel) {

chempound-client/src/main/java/net/chempound/client/DepositItemResponse.java

 package net.chempound.client;
 
 import org.apache.abdera.i18n.iri.IRI;
+import org.apache.abdera.model.Link;
 
 import java.net.URI;
+import java.util.List;
 
 /**
  * @author Sam Adams
  */
 public class DepositItemResponse {
 
-    private final URI uri;
-    private final IRI mediaEntry;
+    private final String title;
+    private final URI splashPage;
+    private final Link editLink;
+    private final Link editMediaLink;
+    private final Link swordEditLink;
+    private final List<Link> derivedResources;
 
-    public DepositItemResponse(final URI uri, final IRI mediaEntry) {
-        this.uri = uri;
-        this.mediaEntry = mediaEntry;
+    public DepositItemResponse(final String title, final URI splashPage, final Link editLink, final Link editMedia,
+                               final Link swordEditLink, final List<Link> derivedResources) {
+        this.title = title;
+        this.splashPage = splashPage;
+        this.editLink = editLink;
+        this.editMediaLink = editMedia;
+        this.swordEditLink = swordEditLink;
+        this.derivedResources = derivedResources;
     }
 
-    public URI getUri() {
-        return uri;
+    public String getTitle() {
+        return title;
     }
 
-    public IRI getMediaEntry() {
-        return mediaEntry;
+    public URI getSplashPage() {
+        return splashPage;
+    }
+
+    public Link getEditLink() {
+        return editLink;
+    }
+
+    public Link getEditMediaLink() {
+        return editMediaLink;
+    }
+
+    public Link getSwordEditLink() {
+        return swordEditLink;
+    }
+
+    public List<Link> getDerivedResources() {
+        return derivedResources;
     }
 }