Skip to content

Commit

Permalink
fix new rdf generators to use service proxies
Browse files Browse the repository at this point in the history
  • Loading branch information
barmintor committed Mar 27, 2013
1 parent d0cb976 commit ffd0d74
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Expand Up @@ -3,12 +3,12 @@

import static javax.ws.rs.core.MediaType.TEXT_PLAIN;
import static javax.ws.rs.core.MediaType.TEXT_XML;
import static org.fcrepo.services.DatastreamService.getDatastream;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.List;

import javax.inject.Inject;
import javax.jcr.NamespaceRegistry;
import javax.jcr.RepositoryException;
import javax.ws.rs.DefaultValue;
Expand All @@ -26,6 +26,7 @@
import org.fcrepo.generator.rdf.TripleSource;
import org.fcrepo.generator.rdf.TripleSource.Triple;
import org.fcrepo.generator.rdf.Utils;
import org.fcrepo.services.DatastreamService;
import org.openrdf.model.URI;
import org.openrdf.model.ValueFactory;
import org.openrdf.sail.memory.model.MemValueFactory;
Expand All @@ -42,6 +43,9 @@ public class DatastreamRdfGenerator extends AbstractResource {

final private Logger logger = LoggerFactory
.getLogger(DatastreamRdfGenerator.class);

@Inject
DatastreamService datastreamService;

@GET
@Path("/")
Expand All @@ -53,7 +57,7 @@ public String getRdfXml(@PathParam("pid")
final String mimeType) throws IOException, RepositoryException,
TripleHandlerException {

final Datastream ds = getDatastream(pid, dsId);
final Datastream ds = datastreamService.getDatastream(pid, dsId);
final URI docURI = valFactory.createURI("info:" + pid + "/" + dsId);
logger.debug("Using ValueFactory: " + valFactory.toString());
final ExtractionContext context =
Expand Down
Expand Up @@ -3,12 +3,12 @@

import static javax.ws.rs.core.MediaType.TEXT_PLAIN;
import static javax.ws.rs.core.MediaType.TEXT_XML;
import static org.fcrepo.services.ObjectService.getObject;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.List;

import javax.inject.Inject;
import javax.jcr.NamespaceRegistry;
import javax.jcr.RepositoryException;
import javax.ws.rs.DefaultValue;
Expand All @@ -26,6 +26,7 @@
import org.fcrepo.generator.rdf.TripleSource;
import org.fcrepo.generator.rdf.TripleSource.Triple;
import org.fcrepo.generator.rdf.Utils;
import org.fcrepo.services.ObjectService;
import org.openrdf.model.URI;
import org.openrdf.model.ValueFactory;
import org.openrdf.sail.memory.model.MemValueFactory;
Expand All @@ -37,6 +38,9 @@
public class ObjectRdfGenerator extends AbstractResource {

List<TripleSource<FedoraObject>> objectGenerators;

@Inject
ObjectService objectService;

final private static ValueFactory valFactory = new MemValueFactory();

Expand All @@ -52,7 +56,7 @@ public String getRdfXml(@PathParam("pid")
final String mimeType) throws IOException, RepositoryException,
TripleHandlerException {

final FedoraObject obj = getObject(pid);
final FedoraObject obj = objectService.getObject(pid);
final URI docURI = valFactory.createURI("info:" + pid);
logger.debug("Using ValueFactory: " + valFactory.toString());
final ExtractionContext context =
Expand Down

0 comments on commit ffd0d74

Please sign in to comment.