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, FCR_METADATA, FCR_VERSIONS, FEDORA_BINARY, FEDORA_CONTAINER, FEDORA_NON_RDF_SOURCE_DESCRIPTION, FEDORA_PAIRTREE, FEDORA_RESOURCE, FEDORA_SKOLEM, FEDORA_TOMBSTONE, FILENAME, HAS_MIME_TYPE, LDP_BASIC_CONTAINER, LDP_DIRECT_CONTAINER, LDP_HAS_MEMBER_RELATION, LDP_INDIRECT_CONTAINER, LDP_INSERTED_CONTENT_RELATION, LDP_IS_MEMBER_OF_RELATION, LDP_MEMBER_RESOURCE
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) |
javax.jcr.version.Version |
getBaseVersion()
Get the JCR 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
|
Date |
getCreatedDate()
Get the date this datastream was created
|
String |
getEtagValue()
Construct an ETag value from the last modified date and path.
|
Date |
getLastModifiedDate()
Get the date this datastream was last modified
|
javax.jcr.Node |
getNode() |
javax.jcr.Node |
getNodeVersion(String label)
Get the node for this object at the version provided.
|
String |
getPath()
Get the path to the JCR node
|
protected javax.jcr.Property |
getProperty(String relPath) |
protected javax.jcr.Session |
getSession() |
RdfStream |
getTriples(IdentifierConverter<com.hp.hpl.jena.rdf.model.Resource,FedoraResource> idTranslator,
Set<? extends TripleCategory> contexts)
Return the RDF properties of this object using the provided contexts
|
RdfStream |
getTriples(IdentifierConverter<com.hp.hpl.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 |
getVersionedAncestor()
When this is a frozen node, get the ancestor that was explicitly versioned
|
javax.jcr.version.VersionHistory |
getVersionHistory()
Get JCR VersionHistory for the node.
|
String |
getVersionLabelOfFrozenResource()
This method returns the version label of this frozen resource.
|
protected javax.jcr.version.VersionManager |
getVersionManager() |
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<com.hp.hpl.jena.rdf.model.Resource,FedoraResource> idTranslator,
com.hp.hpl.jena.rdf.model.Model inputModel,
RdfStream originalTriples)
Replace the properties of this object with the properties from the given
model
|
String |
toString() |
void |
updateProperties(IdentifierConverter<com.hp.hpl.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, withSession
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getChildren
protected 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()
getNode
in interface FedoraResource
public String getPath()
FedoraResource
getPath
in interface FedoraResource
public Stream<FedoraResource> getChildren(Boolean recursive)
FedoraResource
getChildren
in interface FedoraResource
recursive
- whether to recursively fetch child resourcespublic FedoraResource getContainer()
FedoraResource
getContainer
in interface FedoraResource
public FedoraResource getChild(String relPath)
FedoraResource
getChild
in interface FedoraResource
relPath
- the given pathpublic boolean hasProperty(String relPath)
FedoraResource
hasProperty
in interface FedoraResource
relPath
- the given pathpublic void delete()
FedoraResource
delete
in interface FedoraResource
public Date getCreatedDate()
FedoraResource
getCreatedDate
in interface FedoraResource
public Date getLastModifiedDate()
FedoraResource
getLastModifiedDate
in interface FedoraResource
public boolean hasType(String type)
FedoraResource
Note: 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 FedoraResource
type
- the given typepublic List<URI> getTypes()
FedoraResource
getTypes
in interface FedoraResource
public void updateProperties(IdentifierConverter<com.hp.hpl.jena.rdf.model.Resource,FedoraResource> idTranslator, String sparqlUpdateStatement, RdfStream originalTriples) throws MalformedRdfException, AccessDeniedException
FedoraResource
updateProperties
in interface FedoraResource
idTranslator
- the property of idTranslatorsparqlUpdateStatement
- sparql update statementoriginalTriples
- original triplesMalformedRdfException
- if malformed rdf exception occurredAccessDeniedException
- if access denied in updating propertiespublic RdfStream getTriples(IdentifierConverter<com.hp.hpl.jena.rdf.model.Resource,FedoraResource> idTranslator, TripleCategory context)
FedoraResource
getTriples
in interface FedoraResource
idTranslator
- the property of idTranslatorcontext
- the contextpublic RdfStream getTriples(IdentifierConverter<com.hp.hpl.jena.rdf.model.Resource,FedoraResource> idTranslator, Set<? extends TripleCategory> contexts)
FedoraResource
getTriples
in interface FedoraResource
idTranslator
- the property of idTranslatorcontexts
- the provided contextspublic javax.jcr.version.Version getBaseVersion()
FedoraResource
getBaseVersion
in interface FedoraResource
public javax.jcr.version.VersionHistory getVersionHistory()
FedoraResource
getVersionHistory
in interface FedoraResource
public Boolean isNew()
FedoraResource
isNew
in interface FedoraResource
public void replaceProperties(IdentifierConverter<com.hp.hpl.jena.rdf.model.Resource,FedoraResource> idTranslator, com.hp.hpl.jena.rdf.model.Model inputModel, RdfStream originalTriples) throws MalformedRdfException
FedoraResource
replaceProperties
in interface FedoraResource
idTranslator
- the given property of idTranslatorinputModel
- the input modeloriginalTriples
- the original triplesMalformedRdfException
- if malformed rdf exception occurredpublic String getEtagValue()
FedoraResource
getEtagValue
in interface FedoraResource
public void enableVersioning()
FedoraResource
enableVersioning
in interface FedoraResource
public void disableVersioning()
FedoraResource
disableVersioning
in interface FedoraResource
public boolean isVersioned()
FedoraResource
isVersioned
in interface FedoraResource
public boolean isFrozenResource()
FedoraResource
isFrozenResource
in interface FedoraResource
public FedoraResource getVersionedAncestor()
FedoraResource
getVersionedAncestor
in interface FedoraResource
public FedoraResource getUnfrozenResource()
FedoraResource
getUnfrozenResource
in interface FedoraResource
public javax.jcr.Node getNodeVersion(String label)
FedoraResource
getNodeVersion
in interface FedoraResource
label
- the labelpublic String getVersionLabelOfFrozenResource()
FedoraResource
getVersionLabelOfFrozenResource
in interface FedoraResource
protected javax.jcr.version.VersionManager getVersionManager()
protected javax.jcr.Session getSession()
protected javax.jcr.Property getProperty(String relPath)
Copyright © 2013–2016 DuraSpace, Inc.. All rights reserved.