Skip to content
Permalink
Browse files

Rename fedora model objects to reflect usage, not legacy baggage

  • Loading branch information...
cbeer committed Oct 30, 2014
1 parent 3432611 commit 6883b68eabbe59463cb913e8b1b99cdae7cdfad7
Showing with 628 additions and 596 deletions.
  1. +4 −4 fcrepo-auth-common/src/test/java/org/fcrepo/auth/integration/ModeShapeHonorsFADResponseIT.java
  2. +1 −1 fcrepo-auth-common/src/test/java/org/fcrepo/auth/integration/RootTestResource.java
  3. +8 −8 fcrepo-connector-file/src/main/java/org/fcrepo/connector/file/FedoraFileSystemConnector.java
  4. +17 −15 ...file/src/test/java/org/fcrepo/integration/connector/file/AbstractFedoraFileSystemConnectorIT.java
  5. +1 −1 ...rc/test/java/org/fcrepo/integration/connector/file/BasicReadWriteFedoraFileSystemConnectorIT.java
  6. +1 −1 .../org/fcrepo/integration/connector/file/ReadOnlyExternalPropertiesFedoraFileSystemConnectorIT.java
  7. +13 −14 fcrepo-http-api/src/main/java/org/fcrepo/http/api/ContentExposingResource.java
  8. +2 −2 fcrepo-http-api/src/main/java/org/fcrepo/http/api/FedoraBaseResource.java
  9. +1 −1 fcrepo-http-api/src/main/java/org/fcrepo/http/api/FedoraExport.java
  10. +2 −2 fcrepo-http-api/src/main/java/org/fcrepo/http/api/FedoraFixity.java
  11. +14 −14 fcrepo-http-api/src/main/java/org/fcrepo/http/api/FedoraLdp.java
  12. +1 −1 fcrepo-http-api/src/main/java/org/fcrepo/http/api/FedoraNodes.java
  13. +1 −1 fcrepo-http-api/src/main/java/org/fcrepo/http/api/FedoraTombstones.java
  14. +1 −1 fcrepo-http-api/src/main/java/org/fcrepo/http/api/FedoraVersioning.java
  15. +2 −2 fcrepo-http-api/src/main/java/org/fcrepo/http/api/FedoraVersions.java
  16. +10 −5 fcrepo-http-api/src/main/java/org/fcrepo/http/api/url/HttpApiResources.java
  17. +11 −11 fcrepo-http-api/src/test/java/org/fcrepo/http/api/FedoraExportTest.java
  18. +1 −1 fcrepo-http-api/src/test/java/org/fcrepo/http/api/FedoraFixityTest.java
  19. +63 −60 fcrepo-http-api/src/test/java/org/fcrepo/http/api/FedoraLdpTest.java
  20. +19 −20 fcrepo-http-api/src/test/java/org/fcrepo/http/api/FedoraNodesTest.java
  21. +1 −1 fcrepo-http-api/src/test/java/org/fcrepo/http/api/FedoraTombstonesTest.java
  22. +2 −2 fcrepo-http-api/src/test/java/org/fcrepo/http/api/url/HttpApiResourcesTest.java
  23. +4 −3 fcrepo-http-api/src/test/java/org/fcrepo/integration/http/api/FedoraLdpIT.java
  24. +3 −3 fcrepo-http-api/src/test/java/org/fcrepo/integration/http/api/FedoraNodeTypesIT.java
  25. +3 −3 fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/AbstractResource.java
  26. +5 −5 fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/api/rdf/HttpResourceConverter.java
  27. +1 −1 fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/api/rdf/HttpTripleUtil.java
  28. +1 −1 fcrepo-http-commons/src/main/java/org/fcrepo/http/commons/api/rdf/UriAwareResourceModelFactory.java
  29. +10 −10 fcrepo-http-commons/src/test/java/org/fcrepo/http/commons/api/rdf/HttpResourceConverterTest.java
  30. +1 −1 fcrepo-http-commons/src/test/java/org/fcrepo/http/commons/api/rdf/HttpTripleUtilTest.java
  31. +1 −1 ...commons/src/test/java/org/fcrepo/http/commons/exceptionhandlers/TombstoneExceptionMapperTest.java
  32. +6 −6 fcrepo-http-commons/src/test/java/org/fcrepo/http/commons/test/util/TestHelpers.java
  33. +3 −3 fcrepo-jms/src/test/java/org/fcrepo/integration/jms/observer/HeadersJMSIT.java
  34. +6 −6 fcrepo-kernel-impl/src/main/java/org/fcrepo/kernel/impl/{FedoraObjectImpl.java → ContainerImpl.java}
  35. +8 −8 fcrepo-kernel-impl/src/main/java/org/fcrepo/kernel/impl/FedoraBinaryImpl.java
  36. +18 −18 fcrepo-kernel-impl/src/main/java/org/fcrepo/kernel/impl/FedoraResourceImpl.java
  37. +8 −9 ...mpl/src/main/java/org/fcrepo/kernel/impl/{DatastreamImpl.java → NonRdfSourceDescriptionImpl.java}
  38. +1 −1 fcrepo-kernel-impl/src/main/java/org/fcrepo/kernel/impl/TombstoneImpl.java
  39. +6 −6 fcrepo-kernel-impl/src/main/java/org/fcrepo/kernel/impl/identifiers/NodeResourceConverter.java
  40. +4 −4 fcrepo-kernel-impl/src/main/java/org/fcrepo/kernel/impl/observer/DefaultFilter.java
  41. +1 −1 fcrepo-kernel-impl/src/main/java/org/fcrepo/kernel/impl/rdf/JcrRdfTools.java
  42. +1 −1 fcrepo-kernel-impl/src/main/java/org/fcrepo/kernel/impl/rdf/converters/ValueConverter.java
  43. +1 −1 fcrepo-kernel-impl/src/main/java/org/fcrepo/kernel/impl/rdf/impl/AclRdfContext.java
  44. +1 −1 fcrepo-kernel-impl/src/main/java/org/fcrepo/kernel/impl/rdf/impl/BlankNodeRdfContext.java
  45. +6 −4 fcrepo-kernel-impl/src/main/java/org/fcrepo/kernel/impl/rdf/impl/ChildrenRdfContext.java
  46. +5 −5 fcrepo-kernel-impl/src/main/java/org/fcrepo/kernel/impl/rdf/impl/ContentRdfContext.java
  47. +1 −1 fcrepo-kernel-impl/src/main/java/org/fcrepo/kernel/impl/rdf/impl/DefaultIdentifierTranslator.java
  48. +2 −2 fcrepo-kernel-impl/src/main/java/org/fcrepo/kernel/impl/rdf/impl/FixityRdfContext.java
  49. +1 −1 fcrepo-kernel-impl/src/main/java/org/fcrepo/kernel/impl/rdf/impl/HashRdfContext.java
  50. +6 −4 fcrepo-kernel-impl/src/main/java/org/fcrepo/kernel/impl/rdf/impl/LdpContainerRdfContext.java
  51. +1 −1 fcrepo-kernel-impl/src/main/java/org/fcrepo/kernel/impl/rdf/impl/LdpIsMemberOfRdfContext.java
  52. +3 −3 fcrepo-kernel-impl/src/main/java/org/fcrepo/kernel/impl/rdf/impl/LdpRdfContext.java
  53. +1 −1 fcrepo-kernel-impl/src/main/java/org/fcrepo/kernel/impl/rdf/impl/NodeRdfContext.java
  54. +1 −1 fcrepo-kernel-impl/src/main/java/org/fcrepo/kernel/impl/rdf/impl/ParentRdfContext.java
  55. +1 −1 fcrepo-kernel-impl/src/main/java/org/fcrepo/kernel/impl/rdf/impl/PropertiesRdfContext.java
  56. +1 −1 fcrepo-kernel-impl/src/main/java/org/fcrepo/kernel/impl/rdf/impl/ReferencesRdfContext.java
  57. +1 −1 fcrepo-kernel-impl/src/main/java/org/fcrepo/kernel/impl/rdf/impl/RootRdfContext.java
  58. +1 −1 fcrepo-kernel-impl/src/main/java/org/fcrepo/kernel/impl/rdf/impl/TypeRdfContext.java
  59. +1 −1 fcrepo-kernel-impl/src/main/java/org/fcrepo/kernel/impl/rdf/impl/VersionsRdfContext.java
  60. +1 −1 fcrepo-kernel-impl/src/main/java/org/fcrepo/kernel/impl/rdf/impl/mappings/PropertyToTriple.java
  61. +4 −4 fcrepo-kernel-impl/src/main/java/org/fcrepo/kernel/impl/services/BinaryServiceImpl.java
  62. +15 −15 ...rc/main/java/org/fcrepo/kernel/impl/services/{ObjectServiceImpl.java → ContainerServiceImpl.java}
  63. +1 −1 fcrepo-kernel-impl/src/main/java/org/fcrepo/kernel/impl/services/NodeServiceImpl.java
  64. +2 −2 fcrepo-kernel-impl/src/main/java/org/fcrepo/kernel/impl/services/ServiceHelpers.java
  65. +5 −5 fcrepo-kernel-impl/src/main/java/org/fcrepo/kernel/impl/utils/FedoraTypesUtils.java
  66. +1 −1 fcrepo-kernel-impl/src/main/java/org/fcrepo/kernel/impl/utils/JcrPropertyStatementListener.java
  67. +1 −1 fcrepo-kernel-impl/src/main/java/org/fcrepo/kernel/impl/utils/NodePropertiesTools.java
  68. +1 −1 ...kernel-impl/src/main/java/org/fcrepo/kernel/impl/utils/iterators/PersistingRdfStreamConsumer.java
  69. +1 −1 fcrepo-kernel-impl/src/main/java/org/fcrepo/kernel/impl/utils/iterators/RdfAdder.java
  70. +1 −1 fcrepo-kernel-impl/src/main/java/org/fcrepo/kernel/impl/utils/iterators/RdfRemover.java
  71. +12 −17 fcrepo-kernel-impl/src/main/resources/fedora-node-types.cnd
  72. +2 −2 fcrepo-kernel-impl/src/test/java/org/fcrepo/integration/kernel/impl/DatastreamImplIT.java
  73. +16 −16 fcrepo-kernel-impl/src/test/java/org/fcrepo/integration/kernel/impl/FedoraBinaryImplIT.java
  74. +12 −12 fcrepo-kernel-impl/src/test/java/org/fcrepo/integration/kernel/impl/FedoraObjectImplIT.java
  75. +58 −55 fcrepo-kernel-impl/src/test/java/org/fcrepo/integration/kernel/impl/FedoraResourceImplIT.java
  76. +3 −3 fcrepo-kernel-impl/src/test/java/org/fcrepo/integration/kernel/impl/observer/SimpleObserverIT.java
  77. +4 −4 ...po-kernel-impl/src/test/java/org/fcrepo/integration/kernel/impl/services/BinaryServiceImplIT.java
  78. +5 −5 ...rnel-impl/src/test/java/org/fcrepo/integration/kernel/impl/services/TransactionServiceImplIT.java
  79. +8 −8 ...o-kernel-impl/src/test/java/org/fcrepo/integration/kernel/impl/services/VersionServiceImplIT.java
  80. +8 −8 ...el-impl/src/test/java/org/fcrepo/kernel/impl/{FedoraObjectImplTest.java → ContainerImplTest.java}
  81. +7 −7 fcrepo-kernel-impl/src/test/java/org/fcrepo/kernel/impl/DatastreamImplTest.java
  82. +2 −2 fcrepo-kernel-impl/src/test/java/org/fcrepo/kernel/impl/FedoraBinaryImplTest.java
  83. +2 −2 fcrepo-kernel-impl/src/test/java/org/fcrepo/kernel/impl/FedoraResourceImplTest.java
  84. +9 −9 fcrepo-kernel-impl/src/test/java/org/fcrepo/kernel/impl/identifiers/NodeResourceConverterTest.java
  85. +6 −6 fcrepo-kernel-impl/src/test/java/org/fcrepo/kernel/impl/observer/DefaultFilterTest.java
  86. +1 −1 fcrepo-kernel-impl/src/test/java/org/fcrepo/kernel/impl/rdf/JcrRdfToolsTest.java
  87. +1 −1 fcrepo-kernel-impl/src/test/java/org/fcrepo/kernel/impl/rdf/converters/ValueConverterTest.java
  88. +1 −1 fcrepo-kernel-impl/src/test/java/org/fcrepo/kernel/impl/rdf/impl/AclRdfContextTest.java
  89. +1 −1 fcrepo-kernel-impl/src/test/java/org/fcrepo/kernel/impl/rdf/impl/BlankNodeRdfContextTest.java
  90. +5 −5 fcrepo-kernel-impl/src/test/java/org/fcrepo/kernel/impl/rdf/impl/ContentRdfContextTest.java
  91. +1 −1 fcrepo-kernel-impl/src/test/java/org/fcrepo/kernel/impl/rdf/impl/HashRdfContextTest.java
  92. +1 −1 fcrepo-kernel-impl/src/test/java/org/fcrepo/kernel/impl/rdf/impl/LdpContainerRdfContextTest.java
  93. +4 −4 fcrepo-kernel-impl/src/test/java/org/fcrepo/kernel/impl/rdf/impl/LdpIsMemberOfRdfContextTest.java
  94. +3 −3 fcrepo-kernel-impl/src/test/java/org/fcrepo/kernel/impl/rdf/impl/LdpRdfContextTest.java
  95. +1 −1 fcrepo-kernel-impl/src/test/java/org/fcrepo/kernel/impl/rdf/impl/ReferencesRdfContextTest.java
  96. +1 −1 fcrepo-kernel-impl/src/test/java/org/fcrepo/kernel/impl/rdf/impl/TypeRdfContextTest.java
  97. +1 −1 fcrepo-kernel-impl/src/test/java/org/fcrepo/kernel/impl/rdf/impl/mappings/PropertyToTripleTest.java
  98. +6 −6 ...java/org/fcrepo/kernel/impl/services/{ObjectServiceImplTest.java → ContainerServiceImplTest.java}
  99. +1 −1 fcrepo-kernel-impl/src/test/java/org/fcrepo/kernel/impl/services/RepositoryServiceImplTest.java
  100. +1 −1 fcrepo-kernel-impl/src/test/java/org/fcrepo/kernel/impl/testutilities/TestTriplesContext.java
  101. +6 −6 fcrepo-kernel-impl/src/test/java/org/fcrepo/kernel/impl/utils/FedoraTypesUtilsTest.java
  102. +1 −1 fcrepo-kernel-impl/src/test/java/org/fcrepo/kernel/impl/utils/JcrPropertyStatementListenerTest.java
  103. +1 −1 fcrepo-kernel-impl/src/test/java/org/fcrepo/kernel/impl/utils/NodePropertiesToolsTest.java
  104. +1 −1 ...el-impl/src/test/java/org/fcrepo/kernel/impl/utils/iterators/PersistingRdfStreamConsumerTest.java
  105. +1 −1 fcrepo-kernel-impl/src/test/java/org/fcrepo/kernel/impl/utils/iterators/RdfAdderTest.java
  106. +1 −1 fcrepo-kernel-impl/src/test/java/org/fcrepo/kernel/impl/utils/iterators/RdfRemoverTest.java
  107. +6 −8 fcrepo-kernel/src/main/java/org/fcrepo/jcr/FedoraJcrTypes.java
  108. +1 −1 fcrepo-kernel/src/main/java/org/fcrepo/kernel/exception/TombstoneException.java
  109. +2 −2 fcrepo-kernel/src/main/java/org/fcrepo/kernel/{FedoraObject.java → models/Container.java}
  110. +2 −8 fcrepo-kernel/src/main/java/org/fcrepo/kernel/{ → models}/FedoraBinary.java
  111. +1 −1 fcrepo-kernel/src/main/java/org/fcrepo/kernel/{ → models}/FedoraResource.java
  112. +30 −0 fcrepo-kernel/src/main/java/org/fcrepo/kernel/models/NonRdfSource.java
  113. +3 −3 ...po-kernel/src/main/java/org/fcrepo/kernel/{Datastream.java → models/NonRdfSourceDescription.java}
  114. +1 −1 fcrepo-kernel/src/main/java/org/fcrepo/kernel/{ → models}/Tombstone.java
  115. +1 −1 fcrepo-kernel/src/main/java/org/fcrepo/kernel/services/BinaryService.java
  116. +2 −2 fcrepo-kernel/src/main/java/org/fcrepo/kernel/services/{ObjectService.java → ContainerService.java}
  117. +1 −1 fcrepo-kernel/src/main/java/org/fcrepo/kernel/services/NodeService.java
  118. +1 −1 fcrepo-serialization/src/main/java/org/fcrepo/serialization/BaseFedoraObjectSerializer.java
  119. +1 −1 fcrepo-serialization/src/main/java/org/fcrepo/serialization/FedoraObjectSerializer.java
  120. +1 −1 fcrepo-serialization/src/main/java/org/fcrepo/serialization/JcrXmlSerializer.java
  121. +1 −1 fcrepo-serialization/src/main/java/org/fcrepo/serialization/package-info.java
  122. +7 −7 fcrepo-serialization/src/test/java/org/fcrepo/serialization/JcrXmlSerializerTest.java
  123. +1 −1 fcrepo-transform/src/main/java/org/fcrepo/transform/http/FedoraTransform.java
  124. +1 −1 fcrepo-transform/src/main/java/org/fcrepo/transform/http/TransformResources.java
  125. +1 −1 fcrepo-transform/src/main/java/org/fcrepo/transform/sparql/JQLConverter.java
  126. +1 −1 fcrepo-transform/src/main/java/org/fcrepo/transform/sparql/JQLQueryVisitor.java
  127. +1 −1 fcrepo-transform/src/main/java/org/fcrepo/transform/sparql/JQLResultSet.java
  128. +23 −23 fcrepo-transform/src/test/java/org/fcrepo/integration/JQLConverterIT.java
  129. +4 −4 fcrepo-transform/src/test/java/org/fcrepo/integration/LDPathServiceIT.java
  130. +4 −4 fcrepo-transform/src/test/java/org/fcrepo/integration/SparqlQueryTransformIT.java
  131. +2 −2 fcrepo-transform/src/test/java/org/fcrepo/integration/transform/http/FedoraSparqlIT.java
  132. +1 −1 fcrepo-transform/src/test/java/org/fcrepo/transform/sparql/JQLResultSetTest.java
@@ -25,8 +25,8 @@
import org.fcrepo.auth.common.FedoraAuthorizationDelegate;
import org.fcrepo.auth.common.ServletContainerAuthenticationProvider;
import org.fcrepo.kernel.exception.RepositoryRuntimeException;
import org.fcrepo.kernel.services.ObjectService;
import org.fcrepo.kernel.impl.services.ObjectServiceImpl;
import org.fcrepo.kernel.services.ContainerService;
import org.fcrepo.kernel.impl.services.ContainerServiceImpl;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@@ -101,7 +101,7 @@ public void testPermissiveFAD() throws RepositoryException {
for (final Privilege p : rootPrivs) {
logger.debug("got priv: " + p.getName());
}
final ObjectService os = new ObjectServiceImpl();
final ContainerService os = new ContainerServiceImpl();
os.findOrCreate(session, "/myobject");
verify(fad, times(4)).hasPermission(any(Session.class), any(Path.class), any(String[].class));
}
@@ -122,7 +122,7 @@ public void testRestrictiveFAD() throws Throwable {

final ServletCredentials credentials = new ServletCredentials(request);
final Session session = repo.login(credentials);
final ObjectService os = new ObjectServiceImpl();
final ContainerService os = new ContainerServiceImpl();
try {
os.findOrCreate(session, "/myobject");
} catch (final RepositoryRuntimeException e) {
@@ -18,7 +18,7 @@
import com.hp.hpl.jena.rdf.model.Resource;
import org.fcrepo.http.commons.AbstractResource;
import org.fcrepo.http.commons.api.rdf.HttpResourceConverter;
import org.fcrepo.kernel.FedoraResource;
import org.fcrepo.kernel.models.FedoraResource;
import org.fcrepo.kernel.identifiers.IdentifierConverter;
import org.modeshape.jcr.api.JcrTools;
import org.slf4j.Logger;
@@ -19,8 +19,8 @@
import static org.fcrepo.jcr.FedoraJcrTypes.CONTENT_DIGEST;
import static org.fcrepo.jcr.FedoraJcrTypes.CONTENT_SIZE;
import static org.fcrepo.jcr.FedoraJcrTypes.FEDORA_BINARY;
import static org.fcrepo.jcr.FedoraJcrTypes.FEDORA_DATASTREAM;
import static org.fcrepo.jcr.FedoraJcrTypes.FEDORA_OBJECT;
import static org.fcrepo.jcr.FedoraJcrTypes.FEDORA_CONTAINER;
import static org.fcrepo.jcr.FedoraJcrTypes.FEDORA_NON_RDF_SOURCE_DESCRIPTION;
import static org.fcrepo.jcr.FedoraJcrTypes.FEDORA_RESOURCE;
import static org.fcrepo.jcr.FedoraJcrTypes.JCR_CREATED;
import static org.fcrepo.jcr.FedoraJcrTypes.JCR_LASTMODIFIED;
@@ -208,16 +208,16 @@ private String computeAndCacheSha1(final File file) {


private static void decorateObjectNode(final DocumentReader docReader, final DocumentWriter docWriter) {
if (!docReader.getMixinTypeNames().contains(FEDORA_OBJECT)) {
LOGGER.trace("Adding mixin: {}, to {}", FEDORA_OBJECT, docReader.getDocumentId());
docWriter.addMixinType(FEDORA_OBJECT);
if (!docReader.getMixinTypeNames().contains(FEDORA_CONTAINER)) {
LOGGER.trace("Adding mixin: {}, to {}", FEDORA_CONTAINER, docReader.getDocumentId());
docWriter.addMixinType(FEDORA_CONTAINER);
}
}

private static void decorateDatastreamNode(final DocumentReader docReader, final DocumentWriter docWriter) {
if (!docReader.getMixinTypeNames().contains(FEDORA_DATASTREAM)) {
LOGGER.trace("Adding mixin: {}, to {}", FEDORA_DATASTREAM, docReader.getDocumentId());
docWriter.addMixinType(FEDORA_DATASTREAM);
if (!docReader.getMixinTypeNames().contains(FEDORA_NON_RDF_SOURCE_DESCRIPTION)) {
LOGGER.trace("Adding mixin: {}, to {}", FEDORA_NON_RDF_SOURCE_DESCRIPTION, docReader.getDocumentId());
docWriter.addMixinType(FEDORA_NON_RDF_SOURCE_DESCRIPTION);
}
}

@@ -23,8 +23,8 @@
import static com.google.common.collect.Lists.transform;
import static org.fcrepo.jcr.FedoraJcrTypes.CONTENT_SIZE;
import static org.fcrepo.jcr.FedoraJcrTypes.FEDORA_BINARY;
import static org.fcrepo.jcr.FedoraJcrTypes.FEDORA_DATASTREAM;
import static org.fcrepo.jcr.FedoraJcrTypes.FEDORA_OBJECT;
import static org.fcrepo.jcr.FedoraJcrTypes.FEDORA_NON_RDF_SOURCE_DESCRIPTION;
import static org.fcrepo.jcr.FedoraJcrTypes.FEDORA_CONTAINER;
import static org.fcrepo.kernel.RdfLexicon.HAS_MESSAGE_DIGEST;
import static org.fcrepo.kernel.utils.ContentDigest.asURI;
import static org.junit.Assert.assertEquals;
@@ -58,13 +58,13 @@
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.filefilter.TrueFileFilter;
import org.apache.commons.io.filefilter.WildcardFileFilter;
import org.fcrepo.kernel.Datastream;
import org.fcrepo.kernel.FedoraBinary;
import org.fcrepo.kernel.FedoraObject;
import org.fcrepo.kernel.models.NonRdfSourceDescription;
import org.fcrepo.kernel.models.FedoraBinary;
import org.fcrepo.kernel.models.Container;
import org.fcrepo.kernel.impl.rdf.impl.DefaultIdentifierTranslator;
import org.fcrepo.kernel.services.BinaryService;
import org.fcrepo.kernel.services.NodeService;
import org.fcrepo.kernel.services.ObjectService;
import org.fcrepo.kernel.services.ContainerService;
import org.fcrepo.kernel.services.functions.JcrPropertyFunctions;
import org.junit.AfterClass;
import org.junit.BeforeClass;
@@ -94,7 +94,7 @@
protected NodeService nodeService;

@Inject
protected ObjectService objectService;
protected ContainerService containerService;

@Inject
protected BinaryService binaryService;
@@ -195,15 +195,15 @@ protected static void cleanUpJsonFilesFiles(final File directory) {
public void testGetFederatedObject() throws RepositoryException {
final Session session = repo.login();

final FedoraObject object = objectService.findOrCreate(session, testDirPath());
final Container object = containerService.findOrCreate(session, testDirPath());
assertNotNull(object);

final Node node = object.getNode();
final NodeType[] mixins = node.getMixinNodeTypes();
assertEquals(2, mixins.length);

final boolean found = transform(asList(mixins), JcrPropertyFunctions.nodetype2name).contains(FEDORA_OBJECT);
assertTrue("Mixin not found: " + FEDORA_OBJECT, found);
final boolean found = transform(asList(mixins), JcrPropertyFunctions.nodetype2name).contains(FEDORA_CONTAINER);
assertTrue("Mixin not found: " + FEDORA_CONTAINER, found);

session.save();
session.logout();
@@ -213,15 +213,17 @@ public void testGetFederatedObject() throws RepositoryException {
public void testGetFederatedDatastream() throws RepositoryException {
final Session session = repo.login();

final Datastream datastream = binaryService.findOrCreate(session, testFilePath()).getDescription();
assertNotNull(datastream);
final NonRdfSourceDescription nonRdfSourceDescription
= binaryService.findOrCreate(session, testFilePath()).getDescription();
assertNotNull(nonRdfSourceDescription);

final Node node = datastream.getNode();
final Node node = nonRdfSourceDescription.getNode();
final NodeType[] mixins = node.getMixinNodeTypes();
assertEquals(2, mixins.length);

final boolean found = transform(asList(mixins), JcrPropertyFunctions.nodetype2name).contains(FEDORA_DATASTREAM);
assertTrue("Mixin not found: " + FEDORA_DATASTREAM, found);
final boolean found = transform(asList(mixins), JcrPropertyFunctions.nodetype2name)
.contains(FEDORA_NON_RDF_SOURCE_DESCRIPTION);
assertTrue("Mixin not found: " + FEDORA_NON_RDF_SOURCE_DESCRIPTION, found);

session.save();
session.logout();
@@ -15,7 +15,7 @@
*/
package org.fcrepo.integration.connector.file;

import org.fcrepo.kernel.FedoraResource;
import org.fcrepo.kernel.models.FedoraResource;
import org.fcrepo.kernel.impl.rdf.impl.DefaultIdentifierTranslator;
import org.fcrepo.kernel.impl.rdf.impl.PropertiesRdfContext;
import org.fcrepo.kernel.utils.iterators.RdfStream;
@@ -15,7 +15,7 @@
*/
package org.fcrepo.integration.connector.file;

import org.fcrepo.kernel.FedoraResource;
import org.fcrepo.kernel.models.FedoraResource;
import org.junit.Test;

import javax.jcr.Node;
@@ -30,10 +30,11 @@
import org.fcrepo.http.commons.domain.Range;
import org.fcrepo.http.commons.domain.ldp.LdpPreferTag;
import org.fcrepo.http.commons.responses.RangeRequestInputStream;
import org.fcrepo.kernel.Datastream;
import org.fcrepo.kernel.FedoraBinary;
import org.fcrepo.kernel.FedoraObject;
import org.fcrepo.kernel.FedoraResource;
import org.fcrepo.kernel.models.NonRdfSource;
import org.fcrepo.kernel.models.NonRdfSourceDescription;
import org.fcrepo.kernel.models.FedoraBinary;
import org.fcrepo.kernel.models.Container;
import org.fcrepo.kernel.models.FedoraResource;
import org.fcrepo.kernel.exception.InvalidChecksumException;
import org.fcrepo.kernel.exception.MalformedRdfException;
import org.fcrepo.kernel.exception.RepositoryRuntimeException;
@@ -94,7 +95,6 @@
import static javax.ws.rs.core.Response.status;
import static org.apache.commons.lang.StringUtils.isBlank;
import static org.apache.jena.riot.RDFLanguages.contentTypeToLang;
import static org.fcrepo.jcr.FedoraJcrTypes.FEDORA_CONTAINER;
import static org.fcrepo.jcr.FedoraJcrTypes.LDP_BASIC_CONTAINER;
import static org.fcrepo.jcr.FedoraJcrTypes.LDP_DIRECT_CONTAINER;
import static org.fcrepo.jcr.FedoraJcrTypes.LDP_INDIRECT_CONTAINER;
@@ -236,10 +236,9 @@ public boolean apply(final Triple input) {
}

// Include binary properties if this is a binary description
if (resource() instanceof Datastream) {
final FedoraBinary binary = ((Datastream) resource()).getBinary();
rdfStream.concat(filter(binary.getTriples(translator(), ImmutableList.of(
TypeRdfContext.class,
if (resource() instanceof NonRdfSourceDescription) {
final FedoraResource described = ((NonRdfSourceDescription) resource()).getDescribedResource();
rdfStream.concat(filter(described.getTriples(translator(), ImmutableList.of(TypeRdfContext.class,
PropertiesRdfContext.class,
ContentRdfContext.class)), tripleFilter));
}
@@ -420,21 +419,21 @@ protected void addResourceHttpHeaders(final FedoraResource resource) {

servletResponse.addHeader("Link", "<" + LDP_NAMESPACE + "Resource>;rel=\"type\"");

if (resource instanceof Datastream) {
servletResponse.addHeader("Link", "<" + LDP_NAMESPACE + "RDFSource>;rel=\"type\"");
} else if (resource instanceof FedoraBinary) {
if (resource instanceof NonRdfSource) {
servletResponse.addHeader("Link", "<" + LDP_NAMESPACE + "NonRDFSource>;rel=\"type\"");
} else if (resource instanceof FedoraObject) {
} else if (resource instanceof Container) {
servletResponse.addHeader("Link", "<" + CONTAINER.getURI() + ">;rel=\"type\"");
if (resource.hasType(LDP_BASIC_CONTAINER)) {
servletResponse.addHeader("Link", "<" + BASIC_CONTAINER.getURI() + ">;rel=\"type\"");
} else if (resource.hasType(LDP_DIRECT_CONTAINER)) {
servletResponse.addHeader("Link", "<" + DIRECT_CONTAINER.getURI() + ">;rel=\"type\"");
} else if (resource.hasType(LDP_INDIRECT_CONTAINER)) {
servletResponse.addHeader("Link", "<" + INDIRECT_CONTAINER.getURI() + ">;rel=\"type\"");
} else if (!resource.hasType(FEDORA_CONTAINER)) {
} else {
servletResponse.addHeader("Link", "<" + BASIC_CONTAINER.getURI() + ">;rel=\"type\"");
}
} else {
servletResponse.addHeader("Link", "<" + LDP_NAMESPACE + "RDFSource>;rel=\"type\"");
}

}
@@ -19,8 +19,8 @@
import com.hp.hpl.jena.rdf.model.Resource;
import org.fcrepo.http.commons.AbstractResource;
import org.fcrepo.http.commons.api.rdf.HttpResourceConverter;
import org.fcrepo.kernel.FedoraResource;
import org.fcrepo.kernel.Tombstone;
import org.fcrepo.kernel.models.FedoraResource;
import org.fcrepo.kernel.models.Tombstone;
import org.fcrepo.kernel.exception.TombstoneException;
import org.fcrepo.kernel.identifiers.IdentifierConverter;
import org.slf4j.Logger;
@@ -34,7 +34,7 @@
import javax.ws.rs.core.Response;
import javax.ws.rs.core.StreamingOutput;

import org.fcrepo.kernel.FedoraResource;
import org.fcrepo.kernel.models.FedoraResource;
import org.fcrepo.serialization.FedoraObjectSerializer;
import org.fcrepo.serialization.SerializerUtil;
import org.slf4j.Logger;
@@ -39,8 +39,8 @@
import javax.ws.rs.core.UriInfo;

import org.fcrepo.http.commons.responses.HtmlTemplate;
import org.fcrepo.kernel.FedoraBinary;
import org.fcrepo.kernel.FedoraResource;
import org.fcrepo.kernel.models.FedoraBinary;
import org.fcrepo.kernel.models.FedoraResource;
import org.fcrepo.kernel.utils.iterators.RdfStream;
import org.springframework.context.annotation.Scope;

@@ -23,10 +23,10 @@
import org.fcrepo.http.commons.domain.ContentLocation;
import org.fcrepo.http.commons.domain.PATCH;
import org.fcrepo.http.commons.domain.Prefer;
import org.fcrepo.kernel.Datastream;
import org.fcrepo.kernel.FedoraBinary;
import org.fcrepo.kernel.FedoraObject;
import org.fcrepo.kernel.FedoraResource;
import org.fcrepo.kernel.models.NonRdfSourceDescription;
import org.fcrepo.kernel.models.FedoraBinary;
import org.fcrepo.kernel.models.Container;
import org.fcrepo.kernel.models.FedoraResource;
import org.fcrepo.kernel.exception.InvalidChecksumException;
import org.fcrepo.kernel.exception.MalformedRdfException;
import org.fcrepo.kernel.exception.RepositoryRuntimeException;
@@ -84,7 +84,7 @@
import static org.fcrepo.http.commons.domain.RDFMediaType.TURTLE;
import static org.fcrepo.http.commons.domain.RDFMediaType.TURTLE_X;
import static org.fcrepo.jcr.FedoraJcrTypes.FEDORA_BINARY;
import static org.fcrepo.jcr.FedoraJcrTypes.FEDORA_OBJECT;
import static org.fcrepo.jcr.FedoraJcrTypes.FEDORA_CONTAINER;
import static org.fcrepo.kernel.impl.services.TransactionServiceImpl.getCurrentTransactionId;
import static org.slf4j.LoggerFactory.getLogger;

@@ -265,7 +265,7 @@ public Response createOrReplaceObjectRdf(
if (requestBodyStream == null && !resource.isNew()) {
throw new ClientErrorException("No RDF provided and the resource already exists!", CONFLICT);
} else if (requestBodyStream != null) {
if ((resource instanceof FedoraObject || resource instanceof Datastream)
if ((resource instanceof Container || resource instanceof NonRdfSourceDescription)
&& isRdfContentType(contentType.toString())) {
try {
replaceResourceWithStream(resource, requestBodyStream, contentType, resourceTriples);
@@ -371,7 +371,7 @@ public Response createObject(@QueryParam("checksum") final String checksum,
@ContentLocation final InputStream requestBodyStream)
throws InvalidChecksumException, IOException, MalformedRdfException {

if (!(resource() instanceof FedoraObject)) {
if (!(resource() instanceof Container)) {
throw new ClientErrorException("Object cannot have child nodes", CONFLICT);
}

@@ -403,7 +403,7 @@ public Response createObject(@QueryParam("checksum") final String checksum,
} else {
LOGGER.trace("Received createObject with a request body and content type \"{}\"", contentTypeString);

if ((result instanceof FedoraObject)
if ((result instanceof Container)
&& isRdfContentType(contentTypeString)) {
replaceResourceWithStream(result, requestBodyStream, contentType, resourceTriples);
} else if (result instanceof FedoraBinary) {
@@ -469,11 +469,11 @@ private void addOptionsHttpHeaders() {
if (resource() instanceof FedoraBinary) {
options = "DELETE,HEAD,GET,PUT,OPTIONS";

} else if (resource() instanceof Datastream) {
} else if (resource() instanceof NonRdfSourceDescription) {
options = "MOVE,COPY,DELETE,POST,HEAD,GET,PUT,PATCH,OPTIONS";
servletResponse.addHeader("Accept-Patch", contentTypeSPARQLUpdate);

} else if (resource() instanceof FedoraObject) {
} else if (resource() instanceof Container) {
options = "MOVE,COPY,DELETE,POST,HEAD,GET,PUT,PATCH,OPTIONS";
servletResponse.addHeader("Accept-Patch", contentTypeSPARQLUpdate);

@@ -495,8 +495,8 @@ private void addResourceLinkHeaders(final FedoraResource resource) {
}

private void addResourceLinkHeaders(final FedoraResource resource, final boolean includeAnchor) {
if (resource instanceof Datastream) {
final URI uri = getUri(((Datastream) resource).getBinary());
if (resource instanceof NonRdfSourceDescription) {
final URI uri = getUri(((NonRdfSourceDescription) resource).getDescribedResource());
final Link link = Link.fromUri(uri).rel("describes").build();
servletResponse.addHeader("Link", link.toString());
} else if (resource instanceof FedoraBinary) {
@@ -526,7 +526,7 @@ private String getRequestedObjectType(final MediaType requestContentType,
return FEDORA_BINARY;
}

return FEDORA_OBJECT;
return FEDORA_CONTAINER;
}

private FedoraResource createFedoraResource(final String path,
@@ -539,7 +539,7 @@ private FedoraResource createFedoraResource(final String path,
if (objectType.equals(FEDORA_BINARY)) {
result = binaryService.findOrCreate(session, path);
} else {
result = objectService.findOrCreate(session, path);
result = containerService.findOrCreate(session, path);
}

return result;
@@ -43,7 +43,7 @@

import org.fcrepo.http.commons.domain.COPY;
import org.fcrepo.http.commons.domain.MOVE;
import org.fcrepo.kernel.FedoraResource;
import org.fcrepo.kernel.models.FedoraResource;
import org.fcrepo.kernel.exception.RepositoryRuntimeException;
import org.slf4j.Logger;
import org.springframework.context.annotation.Scope;
@@ -16,7 +16,7 @@
package org.fcrepo.http.api;

import com.google.common.annotations.VisibleForTesting;
import org.fcrepo.kernel.FedoraResource;
import org.fcrepo.kernel.models.FedoraResource;
import org.fcrepo.kernel.exception.RepositoryRuntimeException;
import org.springframework.context.annotation.Scope;

@@ -51,7 +51,7 @@
import javax.ws.rs.core.UriInfo;

import org.fcrepo.http.commons.responses.HtmlTemplate;
import org.fcrepo.kernel.FedoraResource;
import org.fcrepo.kernel.models.FedoraResource;
import org.fcrepo.kernel.exception.RepositoryRuntimeException;
import org.fcrepo.kernel.exception.RepositoryVersionRuntimeException;
import org.fcrepo.kernel.impl.rdf.impl.VersionsRdfContext;
@@ -18,8 +18,8 @@
import com.google.common.annotations.VisibleForTesting;
import org.fcrepo.http.commons.domain.PATCH;
import org.fcrepo.http.commons.domain.Prefer;
import org.fcrepo.kernel.FedoraBinary;
import org.fcrepo.kernel.FedoraResource;
import org.fcrepo.kernel.models.FedoraBinary;
import org.fcrepo.kernel.models.FedoraResource;
import org.fcrepo.kernel.utils.iterators.RdfStream;
import org.slf4j.Logger;
import org.springframework.context.annotation.Scope;
Oops, something went wrong.

0 comments on commit 6883b68

Please sign in to comment.
You can’t perform that action at this time.