public class FedoraResourceImpl extends org.modeshape.jcr.api.JcrTools implements FedoraTypes, FedoraResource
Container and
NonRdfSourceDescription types; also used
when the exact type of an object is irrelevantorg.modeshape.jcr.api.JcrTools.BasicOperation, org.modeshape.jcr.api.JcrTools.BrowseContent, org.modeshape.jcr.api.JcrTools.CountNodes, org.modeshape.jcr.api.JcrTools.NodeOperation, org.modeshape.jcr.api.JcrTools.Operation, org.modeshape.jcr.api.JcrTools.PrintNodes, org.modeshape.jcr.api.JcrTools.Variable| Modifier and Type | Field and Description |
|---|---|
protected javax.jcr.Node |
node |
CONTENT_DIGEST, CONTENT_SIZE, DEFAULT_DIGEST_ALGORITHM, FCR_METADATA, FCR_VERSIONS, FEDORA_BINARY, FEDORA_CONTAINER, FEDORA_CREATED, FEDORA_CREATEDBY, FEDORA_LASTMODIFIED, FEDORA_LASTMODIFIEDBY, FEDORA_NON_RDF_SOURCE_DESCRIPTION, FEDORA_PAIRTREE, FEDORA_REPOSITORY_ROOT, FEDORA_RESOURCE, FEDORA_SKOLEM, FEDORA_TOMBSTONE, FILENAME, HAS_MIME_TYPE, LDP_BASIC_CONTAINER, LDP_CONTAINER, LDP_DIRECT_CONTAINER, LDP_HAS_MEMBER_RELATION, LDP_INDIRECT_CONTAINER, LDP_INSERTED_CONTENT_RELATION, LDP_IS_MEMBER_OF_RELATION, LDP_MEMBER_RESOURCE, LDP_NON_RDF_SOURCE, LDP_RDF_SOURCE| Constructor and Description |
|---|
FedoraResourceImpl(javax.jcr.Node node)
Construct a
FedoraResource from an existing JCR Node |
| Modifier and Type | Method and Description |
|---|---|
void |
delete()
Delete this resource, and any inbound references to it
|
void |
disableVersioning()
Disable versioning
|
void |
enableVersioning()
Enable versioning
|
boolean |
equals(Object object) |
static Function<org.apache.jena.graph.Triple,org.apache.jena.graph.Triple> |
fixDatesIfNecessary(FedoraResource r,
com.google.common.base.Converter<javax.jcr.Node,org.apache.jena.rdf.model.Resource> translator)
A method that takes a Triple and returns a Triple that is the correct representation of
that triple for the given resource.
|
FedoraResource |
getBaseVersion()
Get the base version for the node
|
FedoraResource |
getChild(String relPath)
Get the child of this resource at the given path
|
Stream<FedoraResource> |
getChildren(Boolean recursive)
Get the children of this resource, possibly recursively
|
FedoraResource |
getContainer()
Get the container of this resource
|
Instant |
getCreatedDate()
Get the date this resource was created
|
FedoraResource |
getDescribedResource()
Get the resource described by this resource
|
FedoraResource |
getDescription()
Get the description for this resource
|
String |
getEtagValue()
Construct an ETag value for the resource.
|
Instant |
getLastModifiedDate()
This method gets the last modified date for this FedoraResource.
|
javax.jcr.Node |
getNode()
Return the underlying JCR Node for this resource
|
String |
getPath()
Get the path to the resource
|
protected javax.jcr.Property |
getProperty(String relPath) |
protected javax.jcr.Session |
getSession() |
RdfStream |
getTriples(IdentifierConverter<org.apache.jena.rdf.model.Resource,FedoraResource> idTranslator,
Set<? extends TripleCategory> contexts)
Return the RDF properties of this object using the provided contexts
|
RdfStream |
getTriples(IdentifierConverter<org.apache.jena.rdf.model.Resource,FedoraResource> idTranslator,
TripleCategory context)
Return the RDF properties of this object using the provided context
|
List<URI> |
getTypes()
Get the RDF:type values for this resource
|
FedoraResource |
getUnfrozenResource()
Get the unfrozen equivalent of a frozen versioned node
|
FedoraResource |
getVersion(String label)
Get a resource version for this object with the provided label.
|
FedoraResource |
getVersionedAncestor()
When this is a frozen node, get the ancestor that was explicitly versioned
|
String |
getVersionLabelOfFrozenResource()
This method returns the version label of this frozen resource.
|
protected javax.jcr.version.VersionManager |
getVersionManager() |
Stream<FedoraVersion> |
getVersions()
Get a stream of versions associated with this resource
|
int |
hashCode() |
boolean |
hasProperty(String relPath)
Does this resource have a property
|
boolean |
hasType(String type)
Check if this object uses a given RDF type
|
boolean |
isFrozenResource()
Check if a resource is frozen (a historic version).
|
Boolean |
isNew()
Check if a resource was created in this session
|
boolean |
isVersioned()
Check if a resource is versioned
|
void |
replaceProperties(IdentifierConverter<org.apache.jena.rdf.model.Resource,FedoraResource> idTranslator,
org.apache.jena.rdf.model.Model inputModel,
RdfStream originalTriples)
Replace the properties of this object with the properties from the given
model
|
String |
toString() |
void |
touch(boolean includeMembershipResource,
Calendar createdDate,
String createdUser,
Calendar modifiedDate,
String modifyingUser)
Touches a resource to ensure that the implicitly updated properties are updated if
not explicitly set.
|
void |
updateProperties(IdentifierConverter<org.apache.jena.rdf.model.Resource,FedoraResource> idTranslator,
String sparqlUpdateStatement,
RdfStream originalTriples)
Update the provided properties with a SPARQL Update query.
|
findOrCreateChild, findOrCreateChild, findOrCreateNode, findOrCreateNode, findOrCreateNode, findOrCreateNode, getNode, getReadable, getStringValue, importContent, importContent, importContent, importContent, importContent, importContent, importContent, isDebug, onEachNode, onEachNodeBelow, print, printNode, printQuery, printQuery, printQuery, printQuery, printSubgraph, printSubgraph, printSubgraph, registerNodeTypes, removeAllChildren, removeAllChildren, repeatedlyWithSession, resourceUrl, setDebug, uploadFile, uploadFile, uploadFile, uploadFileAndBlock, uploadFileAndBlock, uploadFileAndBlock, uploadFilesAndBlock, var, vars, withSessionclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetChildrenprotected javax.jcr.Node node
public FedoraResourceImpl(javax.jcr.Node node)
FedoraResource from an existing JCR Nodenode - an existing JCR node to treat as an fcrepo objectpublic javax.jcr.Node getNode()
public String getPath()
FedoraResourcegetPath in interface FedoraResourcepublic Stream<FedoraResource> getChildren(Boolean recursive)
FedoraResourcegetChildren in interface FedoraResourcerecursive - whether to recursively fetch child resourcespublic FedoraResource getDescription()
FedoraResourcegetDescription in interface FedoraResourcepublic FedoraResource getDescribedResource()
FedoraResourcegetDescribedResource in interface FedoraResourcepublic FedoraResource getContainer()
FedoraResourcegetContainer in interface FedoraResourcepublic FedoraResource getChild(String relPath)
FedoraResourcegetChild in interface FedoraResourcerelPath - the given pathpublic boolean hasProperty(String relPath)
FedoraResourcehasProperty in interface FedoraResourcerelPath - the given pathpublic void delete()
FedoraResourcedelete in interface FedoraResourcepublic Instant getCreatedDate()
FedoraResourcegetCreatedDate in interface FedoraResourcepublic Instant getLastModifiedDate()
getLastModifiedDate in interface FedoraResourcepublic boolean hasType(String type)
FedoraResourceNote: the type parameter should be in prefixed short form, so ldp:Container or ex:Image are both acceptable types. This method does not assume any jcr to fedora prefix mappings are managed by the implementation, so hasType("jcr:frozenNode") is a valid use of this method.
hasType in interface FedoraResourcetype - the given typepublic List<URI> getTypes()
FedoraResourcegetTypes in interface FedoraResourcepublic void updateProperties(IdentifierConverter<org.apache.jena.rdf.model.Resource,FedoraResource> idTranslator, String sparqlUpdateStatement, RdfStream originalTriples) throws MalformedRdfException, AccessDeniedException
FedoraResourceupdateProperties in interface FedoraResourceidTranslator - the property of idTranslatorsparqlUpdateStatement - sparql update statementoriginalTriples - original triplesMalformedRdfException - if malformed rdf exception occurredAccessDeniedException - if access denied in updating propertiespublic RdfStream getTriples(IdentifierConverter<org.apache.jena.rdf.model.Resource,FedoraResource> idTranslator, TripleCategory context)
FedoraResourcegetTriples in interface FedoraResourceidTranslator - the property of idTranslatorcontext - the contextpublic RdfStream getTriples(IdentifierConverter<org.apache.jena.rdf.model.Resource,FedoraResource> idTranslator, Set<? extends TripleCategory> contexts)
FedoraResourcegetTriples in interface FedoraResourceidTranslator - the property of idTranslatorcontexts - the provided contextspublic FedoraResource getBaseVersion()
FedoraResourcegetBaseVersion in interface FedoraResourcepublic Boolean isNew()
FedoraResourceisNew in interface FedoraResourcepublic void replaceProperties(IdentifierConverter<org.apache.jena.rdf.model.Resource,FedoraResource> idTranslator, org.apache.jena.rdf.model.Model inputModel, RdfStream originalTriples) throws MalformedRdfException
FedoraResourcereplaceProperties in interface FedoraResourceidTranslator - the given property of idTranslatorinputModel - the input modeloriginalTriples - the original triplesMalformedRdfException - if malformed rdf exception occurredpublic void touch(boolean includeMembershipResource, Calendar createdDate, String createdUser, Calendar modifiedDate, String modifyingUser) throws javax.jcr.RepositoryException
includeMembershipResource - true if this touch should propagate through to
ldp membership resourcescreatedDate - the date to which the created date should be set or null to leave it unchangedcreatedUser - the user to which the created by should be set or null to leave it unchangedmodifiedDate - the date to which the modified date should be set or null to use nowmodifyingUser - the user making the modification or null to use the current userjavax.jcr.RepositoryException - an error occurs while updating the repositorypublic String getEtagValue()
FedoraResourcegetEtagValue in interface FedoraResourcepublic void enableVersioning()
FedoraResourceenableVersioning in interface FedoraResourcepublic void disableVersioning()
FedoraResourcedisableVersioning in interface FedoraResourcepublic boolean isVersioned()
FedoraResourceisVersioned in interface FedoraResourcepublic boolean isFrozenResource()
FedoraResourceisFrozenResource in interface FedoraResourcepublic FedoraResource getVersionedAncestor()
FedoraResourcegetVersionedAncestor in interface FedoraResourcepublic FedoraResource getUnfrozenResource()
FedoraResourcegetUnfrozenResource in interface FedoraResourcepublic FedoraResource getVersion(String label)
FedoraResourcegetVersion in interface FedoraResourcelabel - the labelpublic Stream<FedoraVersion> getVersions()
FedoraResourcegetVersions in interface FedoraResourcepublic String getVersionLabelOfFrozenResource()
FedoraResourcegetVersionLabelOfFrozenResource in interface FedoraResourceprotected javax.jcr.version.VersionManager getVersionManager()
protected javax.jcr.Session getSession()
protected javax.jcr.Property getProperty(String relPath)
public static Function<org.apache.jena.graph.Triple,org.apache.jena.graph.Triple> fixDatesIfNecessary(FedoraResource r, com.google.common.base.Converter<javax.jcr.Node,org.apache.jena.rdf.model.Resource> translator)
PropertiesRdfContext to replace the reported RdfLexicon.LAST_MODIFIED_DATE
with the one produced by getLastModifiedDate().r - the Fedora resourcetranslator - a converter to get the external identifier from a jcr nodeCopyright © 2013–2017 DuraSpace, Inc.. All rights reserved.