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

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

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

origin: apache/jackrabbit-oak

  @NotNull
  @Override
  public NodeType perform() throws RepositoryException {
    Tree tree = node.getTree();
    String primaryTypeName = getPrimaryTypeName(tree);
    if (primaryTypeName != null) {
      return getNodeTypeManager().getNodeType(sessionContext.getJcrName(primaryTypeName));
    } else {
      throw new RepositoryException("Unable to retrieve primary type for Node " + getNodePath());
    }
  }
});
origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

  @Nonnull
  @Override
  public NodeType perform() throws RepositoryException {
    Tree tree = node.getTree();
    String primaryTypeName = getPrimaryTypeName(tree);
    if (primaryTypeName != null) {
      return getNodeTypeManager().getNodeType(sessionContext.getJcrName(primaryTypeName));
    } else {
      throw new RepositoryException("Unable to retrieve primary type for Node " + getNodePath());
    }
  }
});
origin: org.apache.jackrabbit/oak-jcr

  @NotNull
  @Override
  public NodeType perform() throws RepositoryException {
    Tree tree = node.getTree();
    String primaryTypeName = getPrimaryTypeName(tree);
    if (primaryTypeName != null) {
      return getNodeTypeManager().getNodeType(sessionContext.getJcrName(primaryTypeName));
    } else {
      throw new RepositoryException("Unable to retrieve primary type for Node " + getNodePath());
    }
  }
});
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);
  }
}
origin: apache/jackrabbit-oak

private void internalSetPrimaryType(final String nodeTypeName) throws RepositoryException {
  // TODO: figure out the right place for this check
  NodeType nt = getNodeTypeManager().getNodeType(nodeTypeName); // throws on not found
  if (nt.isAbstract() || nt.isMixin()) {
    throw new ConstraintViolationException(getNodePath());
  }
  // TODO: END
  PropertyState state = PropertyStates.createProperty(
      JCR_PRIMARYTYPE, getOakName(nodeTypeName), NAME);
  dlg.setProperty(state, true, true);
  dlg.setOrderableChildren(nt.hasOrderableChildNodes());
}
origin: org.apache.jackrabbit/oak-jcr

private void internalSetPrimaryType(final String nodeTypeName) throws RepositoryException {
  // TODO: figure out the right place for this check
  NodeType nt = getNodeTypeManager().getNodeType(nodeTypeName); // throws on not found
  if (nt.isAbstract() || nt.isMixin()) {
    throw new ConstraintViolationException(getNodePath());
  }
  // TODO: END
  PropertyState state = PropertyStates.createProperty(
      JCR_PRIMARYTYPE, getOakName(nodeTypeName), NAME);
  dlg.setProperty(state, true, true);
  dlg.setOrderableChildren(nt.hasOrderableChildNodes());
}
origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

private void internalSetPrimaryType(final String nodeTypeName) throws RepositoryException {
  // TODO: figure out the right place for this check
  NodeType nt = getNodeTypeManager().getNodeType(nodeTypeName); // throws on not found
  if (nt.isAbstract() || nt.isMixin()) {
    throw new ConstraintViolationException(getNodePath());
  }
  // TODO: END
  PropertyState state = PropertyStates.createProperty(
      JCR_PRIMARYTYPE, getOakName(nodeTypeName), NAME);
  dlg.setProperty(state, true, true);
  dlg.setOrderableChildren(nt.hasOrderableChildNodes());
}
org.apache.jackrabbit.oak.plugins.nodetype.writeReadWriteNodeTypeManagergetNodeType

Popular methods of ReadWriteNodeTypeManager

  • createNodeTypeTemplate
  • getDefinition
  • getEffectiveNodeType
  • getNamePathMapper
  • getOakName
  • getOrCreateNodeTypes
  • 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

  • Reactive rest calls using spring rest template
  • scheduleAtFixedRate (ScheduledExecutorService)
  • onCreateOptionsMenu (Activity)
  • setContentView (Activity)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Collectors (java.util.stream)
  • ImageIO (javax.imageio)
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top Vim plugins
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