Package org.apache.sling.jcr.base
Class NodeTypeLoader
- java.lang.Object
-
- org.apache.sling.jcr.base.NodeTypeLoader
-
public class NodeTypeLoader extends java.lang.Object
TheNodeTypeSupport
contains utility methods to register node types from a CND nodetype definition file given as an URL or InputStream with the repository.
-
-
Constructor Summary
Constructors Constructor Description NodeTypeLoader()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
registerNodeType(Session session, java.io.InputStream source)
Registers node types from the CND file read from thesource
with the node type manager available from the givensession
.static boolean
registerNodeType(Session session, java.lang.String systemId, java.io.Reader reader, boolean reregisterExisting)
static boolean
registerNodeType(Session session, java.net.URL source)
Registers node types from the CND file accessible by theURL
with the node type manager available from the givensession
.
-
-
-
Method Detail
-
registerNodeType
public static boolean registerNodeType(Session session, java.net.URL source)
Registers node types from the CND file accessible by theURL
with the node type manager available from the givensession
.The
NodeTypeManager
returned by thesession
's workspace is expected to be of typeorg.apache.jackrabbit.api.JackrabbitNodeTypeManager
for the node type registration to succeed.This method is not synchronized. It is up to the calling method to prevent paralell execution.
- Parameters:
session
- TheSession
providing the node type manager through which the node type is to be registered.source
- The URL from which to read the CND file- Returns:
true
if registration of all node types succeeded.
-
registerNodeType
public static boolean registerNodeType(Session session, java.io.InputStream source) throws java.io.IOException, RepositoryException
Registers node types from the CND file read from thesource
with the node type manager available from the givensession
.The
NodeTypeManager
returned by thesession
's workspace is expected to be of typeorg.apache.jackrabbit.api.JackrabbitNodeTypeManager
for the node type registration to succeed.This method is not synchronized. It is up to the calling method to prevent paralell execution.
- Parameters:
session
- TheSession
providing the node type manager through which the node type is to be registered.source
- TheInputStream
from which the CND file is read.- Returns:
true
if registration of all node types succeeded.- Throws:
java.io.IOException
- if there is an error parsing the input streamRepositoryException
- if another error occurs
-
registerNodeType
public static boolean registerNodeType(Session session, java.lang.String systemId, java.io.Reader reader, boolean reregisterExisting) throws java.io.IOException, RepositoryException
- Throws:
java.io.IOException
RepositoryException
-
-