public class FedoraResourceImpl extends org.modeshape.jcr.api.JcrTools implements FedoraJcrTypes, 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, EXPOSED_PROTECTED_JCR_TYPES, FCR_METADATA, FCR_VERSIONS, FEDORA_BINARY, FEDORA_CONTAINER, FEDORA_NON_RDF_SOURCE_DESCRIPTION, FEDORA_PAIRTREE, FEDORA_RESOURCE, FEDORA_SKOLEM, FEDORA_TOMBSTONE, FILENAME, FROZEN_MIXIN_TYPES, FROZEN_NODE, HAS_MIME_TYPE, JCR_CREATED, JCR_CREATEDBY, JCR_FROZEN_NODE, JCR_LASTMODIFIED, JCR_MIXIN_TYPES, JCR_PRIMARY_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, ROOT, VERSIONABLE
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
|
Iterator<FedoraResource> |
getChildren()
Get the children of this resource
|
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
|
javax.jcr.Property |
getProperty(String relPath)
Retrieve the given property value for this resource
|
protected javax.jcr.Session |
getSession() |
RdfStream |
getTriples(IdentifierConverter<com.hp.hpl.jena.rdf.model.Resource,FedoraResource> idTranslator,
Class<? extends RdfStream> context)
Return the RDF properties of this object using the provided context
|
RdfStream |
getTriples(IdentifierConverter<com.hp.hpl.jena.rdf.model.Resource,FedoraResource> idTranslator,
Iterable<? extends Class<? extends RdfStream>> contexts)
Return the RDF properties of this object using the provided contexts
|
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.
|
int |
hashCode() |
boolean |
hasProperty(String relPath)
Does this resource have a property
|
boolean |
hasType(String type)
Check if this object uses a given mixin
|
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
|
void |
setURIProperty(String relPath,
URI value)
Set the given property value for this resource as a URI, without translating any URIs that
appear to be references to repository resources.
|
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
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 Iterator<FedoraResource> getChildren()
FedoraResource
getChildren
in interface FedoraResource
public 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 javax.jcr.Property getProperty(String relPath)
FedoraResource
getProperty
in interface FedoraResource
relPath
- the given pathpublic void setURIProperty(String relPath, URI value)
setURIProperty
in interface FedoraResource
relPath
- the given pathvalue
- the URI valuepublic 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
hasType
in interface FedoraResource
type
- the given typepublic void updateProperties(IdentifierConverter<com.hp.hpl.jena.rdf.model.Resource,FedoraResource> idTranslator, String sparqlUpdateStatement, RdfStream originalTriples) throws MalformedRdfException, javax.jcr.AccessDeniedException
FedoraResource
updateProperties
in interface FedoraResource
idTranslator
- the property of idTranslatorsparqlUpdateStatement
- sparql update statementoriginalTriples
- original triplesMalformedRdfException
- if malformed rdf exception occurredjavax.jcr.AccessDeniedException
- if access denied in updating propertiespublic RdfStream getTriples(IdentifierConverter<com.hp.hpl.jena.rdf.model.Resource,FedoraResource> idTranslator, Class<? extends RdfStream> 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, Iterable<? extends Class<? extends RdfStream>> 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 labelprotected javax.jcr.Session getSession()
Copyright © 2013–2015 DuraSpace, Inc.. All rights reserved.