Tabnine Logo
ReadWriteNodeTypeManager.getOrCreateNodeTypes
Code IndexAdd Tabnine to your IDE (free)

How to use
getOrCreateNodeTypes
method
in
org.apache.jackrabbit.oak.plugins.nodetype.write.ReadWriteNodeTypeManager

Best Java code snippets using org.apache.jackrabbit.oak.plugins.nodetype.write.ReadWriteNodeTypeManager.getOrCreateNodeTypes (Showing top 3 results out of 315)

origin: org.apache.jackrabbit/oak-core

@Override
public final NodeTypeIterator registerNodeTypes(
    NodeTypeDefinition[] ntds, boolean allowUpdate)
    throws RepositoryException {
  Root root = getWriteRoot();
  try {
    Tree tree = getOrCreateNodeTypes(root);
    for (NodeTypeDefinition ntd : ntds) {
      NodeTypeTemplateImpl template;
      if (ntd instanceof NodeTypeTemplateImpl) {
        template = (NodeTypeTemplateImpl) ntd;
      } else {
        // some external template implementation, copy before proceeding
        template = new NodeTypeTemplateImpl(getNamePathMapper(), ntd);
      }
      template.writeTo(tree, allowUpdate);
    }
    root.commit();
    refresh();
    List<NodeType> types = new ArrayList<NodeType>(ntds.length);
    for (NodeTypeDefinition ntd : ntds) {
      types.add(getNodeType(ntd.getName()));
    }
    return new NodeTypeIteratorAdapter(types);
  } catch (CommitFailedException e) {
    String message = "Failed to register node types.";
    throw e.asRepositoryException(message);
  }
}
origin: apache/jackrabbit-oak

@Override
public final NodeTypeIterator registerNodeTypes(
    NodeTypeDefinition[] ntds, boolean allowUpdate)
    throws RepositoryException {
  Root root = getWriteRoot();
  try {
    Tree tree = getOrCreateNodeTypes(root);
    for (NodeTypeDefinition ntd : ntds) {
      NodeTypeTemplateImpl template;
      if (ntd instanceof NodeTypeTemplateImpl) {
        template = (NodeTypeTemplateImpl) ntd;
      } else {
        // some external template implementation, copy before proceeding
        template = new NodeTypeTemplateImpl(getNamePathMapper(), ntd);
      }
      template.writeTo(tree, allowUpdate);
    }
    root.commit();
    refresh();
    List<NodeType> types = new ArrayList<NodeType>(ntds.length);
    for (NodeTypeDefinition ntd : ntds) {
      types.add(getNodeType(ntd.getName()));
    }
    return new NodeTypeIteratorAdapter(types);
  } catch (CommitFailedException e) {
    String message = "Failed to register node types.";
    throw e.asRepositoryException(message);
  }
}
origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

@Override
public final NodeTypeIterator registerNodeTypes(
    NodeTypeDefinition[] ntds, boolean allowUpdate)
    throws RepositoryException {
  Root root = getWriteRoot();
  try {
    Tree tree = getOrCreateNodeTypes(root);
    for (NodeTypeDefinition ntd : ntds) {
      NodeTypeTemplateImpl template;
      if (ntd instanceof NodeTypeTemplateImpl) {
        template = (NodeTypeTemplateImpl) ntd;
      } else {
        // some external template implementation, copy before proceeding
        template = new NodeTypeTemplateImpl(getNamePathMapper(), ntd);
      }
      template.writeTo(tree, allowUpdate);
    }
    root.commit();
    refresh();
    List<NodeType> types = new ArrayList<NodeType>(ntds.length);
    for (NodeTypeDefinition ntd : ntds) {
      types.add(getNodeType(ntd.getName()));
    }
    return new NodeTypeIteratorAdapter(types);
  } catch (CommitFailedException e) {
    String message = "Failed to register node types.";
    throw e.asRepositoryException(message);
  }
}
org.apache.jackrabbit.oak.plugins.nodetype.writeReadWriteNodeTypeManagergetOrCreateNodeTypes

Popular methods of ReadWriteNodeTypeManager

  • getNodeType
  • createNodeTypeTemplate
  • getDefinition
  • getEffectiveNodeType
  • getNamePathMapper
  • getOakName
  • getRootDefinition
  • getWriteRoot
    Called by the methods #registerNodeType(NodeTypeDefinition,boolean), #registerNodeTypes(NodeTypeDefi
  • isNodeType
  • refresh
    Called by the ReadWriteNodeTypeManager implementation methods to refresh the state of the session as
  • registerNodeType
  • registerNodeTypes
  • registerNodeType,
  • registerNodeTypes,
  • createNodeDefinitionTemplate,
  • hasNodeType

Popular in Java

  • Making http post requests using okhttp
  • findViewById (Activity)
  • getApplicationContext (Context)
  • runOnUiThread (Activity)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • ImageIO (javax.imageio)
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now