}
}
private void registerNodeTypes(String repositoryName) throws RepositoryException
{
ConfigurationManager configService =
(ConfigurationManager)parentContainer.getComponentInstanceOfType(ConfigurationManager.class);
ExtendedNodeTypeManager ntManager = getRepository(repositoryName).getNodeTypeManager();
//
for (int j = 0; j < addNodeTypePlugins.size(); j++)
{
AddNodeTypePlugin plugin = (AddNodeTypePlugin)addNodeTypePlugins.get(j);
List<String> autoNodeTypesFiles = plugin.getNodeTypesFiles(AddNodeTypePlugin.AUTO_CREATED);
if (autoNodeTypesFiles != null && autoNodeTypesFiles.size() > 0)
{
for (String nodeTypeFilesName : autoNodeTypesFiles)
{
InputStream inXml;
try
{
inXml = configService.getInputStream(nodeTypeFilesName);
}
catch (Exception e)
{
throw new RepositoryException(e);
}
if (log.isDebugEnabled())
{
log.debug("Trying register node types from xml-file " + nodeTypeFilesName);
}
ntManager.registerNodeTypes(inXml, ExtendedNodeTypeManager.IGNORE_IF_EXISTS,
NodeTypeDataManager.TEXT_XML);
if (log.isDebugEnabled())
{
log.debug("Node types is registered from xml-file " + nodeTypeFilesName);
}
}
List<String> defaultNodeTypesFiles = plugin.getNodeTypesFiles(repositoryName);
if (defaultNodeTypesFiles != null && defaultNodeTypesFiles.size() > 0)
{
for (String nodeTypeFilesName : defaultNodeTypesFiles)
{
InputStream inXml;
try
{
inXml = configService.getInputStream(nodeTypeFilesName);
}
catch (Exception e)
{
throw new RepositoryException(e);
}