public abstract class FedoraTypesUtils extends Object implements FedoraTypes
Modifier and Type | Field and Description |
---|---|
static Predicate<String> |
hasInternalNamespace
Check whether a type should be internal.
|
static Predicate<javax.jcr.Node> |
isContainer
Predicate for determining whether this
Node is a Container . |
static Predicate<javax.jcr.Node> |
isExternalNode
Check if a node is externally managed.
|
static Predicate<javax.jcr.Node> |
isFedoraBinary
Predicate for determining whether this
Node is a Fedora
binary. |
static Predicate<FedoraResource> |
isFrozenNode
Predicate for determining whether this
FedoraResource has a frozen node |
static Predicate<javax.jcr.Node> |
isInternalNode
Check if a node is "internal" and should not be exposed e.g.
|
static Predicate<javax.jcr.Property> |
isInternalProperty
Check whether a property is an internal property that should be suppressed
from external output.
|
static Predicate<javax.jcr.Property> |
isInternalReferenceProperty
Check if a property is a reference property.
|
static Predicate<javax.jcr.Node> |
isNonRdfSourceDescription
Predicate for determining whether this
Node is a
NonRdfSourceDescription . |
static Predicate<String> |
isPublicJcrProperty
Predicate for determining whether a JCR property should be converted to the fedora namespace.
|
static Predicate<javax.jcr.Node> |
isSkolemNode
Predicate for determining whether this
Node is a Fedora Skolem node. |
static String |
REFERENCE_PROPERTY_SUFFIX |
CONTENT_DIGEST, CONTENT_SIZE, FCR_METADATA, FCR_VERSIONS, FEDORA_BINARY, FEDORA_CONTAINER, FEDORA_LASTMODIFIED, 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 |
---|
FedoraTypesUtils() |
Modifier and Type | Method and Description |
---|---|
static javax.jcr.Node |
getClosestExistingAncestor(javax.jcr.Session session,
String path)
Get the closest ancestor that current exists
|
static Optional<javax.jcr.Node> |
getContainingNode(javax.jcr.Node node)
Get the JCR Node that corresponds to the containing node in the repository.
|
static Optional<javax.jcr.nodetype.PropertyDefinition> |
getDefinitionForPropertyName(javax.jcr.Node node,
String propertyName)
Get the property definition information (containing type and multi-value
information)
|
static javax.jcr.Node |
getJcrNode(FedoraResource resource)
Retrieve the underlying JCR Node from the FedoraResource
|
static Optional<Integer> |
getPropertyType(javax.jcr.Node node,
String propertyName)
Get the JCR property type ID for a given property name.
|
static String |
getReferencePropertyName(String propertyName)
When we add certain URI properties, we also want to leave a reference node
|
static String |
getReferencePropertyOriginalName(String refPropertyName)
Given an internal reference node property, get the original name
|
static boolean |
isMultivaluedProperty(javax.jcr.Node node,
String propertyName)
Determine if a given JCR property name is single- or multi- valued.
|
static boolean |
isReferenceProperty(javax.jcr.Node node,
String propertyName)
Check if a property definition is a reference property
|
static Optional<com.hp.hpl.jena.rdf.model.Resource> |
ldpInsertedContentProperty(javax.jcr.Node node)
Given a JCR Node, fetch the parent's ldp:insertedContentRelation value, if
one exists.
|
static Function<com.hp.hpl.jena.rdf.model.Resource,Optional<String>> |
resourceToProperty(javax.jcr.Session session)
Using a JCR session, return a function that maps an RDF Resource to a corresponding property name.
|
static void |
touch(javax.jcr.Node node)
Update the fedora:lastModified date of the node.
|
static void |
touchLdpMembershipResource(javax.jcr.Node node)
Update the fedora:lastModified date of the parent's ldp:membershipResource if that node is a direct
or indirect container, provided the LDP constraints are valid.
|
public static final String REFERENCE_PROPERTY_SUFFIX
public static Predicate<javax.jcr.Node> isContainer
Node
is a Container
.public static Predicate<javax.jcr.Node> isNonRdfSourceDescription
Node
is a
NonRdfSourceDescription
.public static Predicate<javax.jcr.Node> isFedoraBinary
Node
is a Fedora
binary.public static Predicate<FedoraResource> isFrozenNode
FedoraResource
has a frozen nodepublic static Predicate<javax.jcr.Node> isSkolemNode
Node
is a Fedora Skolem node.public static Predicate<javax.jcr.Property> isInternalReferenceProperty
public static Predicate<String> hasInternalNamespace
public static Predicate<String> isPublicJcrProperty
public static Predicate<javax.jcr.Property> isInternalProperty
public static Predicate<javax.jcr.Node> isInternalNode
public static Predicate<javax.jcr.Node> isExternalNode
public FedoraTypesUtils()
public static Optional<Integer> getPropertyType(javax.jcr.Node node, String propertyName) throws javax.jcr.RepositoryException
node
- the JCR node to add the property onpropertyName
- the property namejavax.jcr.RepositoryException
- if repository exception occurredpublic static boolean isMultivaluedProperty(javax.jcr.Node node, String propertyName) throws javax.jcr.RepositoryException
node
- the JCR node to checkpropertyName
- the property name (which may or may not already exist)javax.jcr.RepositoryException
- if repository exception occurredpublic static Optional<javax.jcr.nodetype.PropertyDefinition> getDefinitionForPropertyName(javax.jcr.Node node, String propertyName) throws javax.jcr.RepositoryException
node
- the node to use for inferring the property definitionpropertyName
- the property name to retrieve a definition forjavax.jcr.RepositoryException
- if repository exception occurredpublic static String getReferencePropertyName(String propertyName)
propertyName
- the property namepublic static String getReferencePropertyOriginalName(String refPropertyName)
refPropertyName
- the reference node property namepublic static boolean isReferenceProperty(javax.jcr.Node node, String propertyName) throws javax.jcr.RepositoryException
node
- the given nodepropertyName
- the property namejavax.jcr.RepositoryException
- if repository exception occurredpublic static javax.jcr.Node getClosestExistingAncestor(javax.jcr.Session session, String path) throws javax.jcr.RepositoryException
session
- the given sessionpath
- the given pathjavax.jcr.RepositoryException
- if repository exception occurredpublic static javax.jcr.Node getJcrNode(FedoraResource resource)
resource
- the Fedora resourcepublic static Optional<com.hp.hpl.jena.rdf.model.Resource> ldpInsertedContentProperty(javax.jcr.Node node)
node
- the JCR Nodepublic static Function<com.hp.hpl.jena.rdf.model.Resource,Optional<String>> resourceToProperty(javax.jcr.Session session)
session
- The JCR sessionpublic static void touchLdpMembershipResource(javax.jcr.Node node)
node
- The JCR nodepublic static void touch(javax.jcr.Node node)
node
- The JCR nodepublic static Optional<javax.jcr.Node> getContainingNode(javax.jcr.Node node)
node
- the JCR nodeCopyright © 2013–2016 DuraSpace, Inc.. All rights reserved.