Tabnine Logo
org.apache.jackrabbit.oak.plugins.nodetype
Code IndexAdd Tabnine to your IDE (free)

How to use org.apache.jackrabbit.oak.plugins.nodetype

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

origin: apache/jackrabbit-oak

@Override
public Editor childNodeDeleted(String name, NodeState before) throws CommitFailedException {
  if (checkThisNode && effective.isMandatoryChildNode(name)) {
    constraintViolation(26, "Mandatory child node " + name + " can not be removed");
  }
  return null; // no further checking needed for the removed subtree
}
origin: apache/jackrabbit-oak

@Override
public String[] getValueConstraints() {
  // TODO: namespace mapping?
  String[] valConstraints = getStrings(JcrConstants.JCR_VALUECONSTRAINTS);
  if (valConstraints != null) {
    return valConstraints;
  } else {
    return new String[0];
  }
}
origin: apache/jackrabbit-oak

  @Override
  public int compare(final ChildNodeDefDiff o1, final ChildNodeDefDiff o2) {
    return o1.getType() - o2.getType();
  }
});
origin: org.apache.jackrabbit/oak-core

/**
 * Throws or logs the specified constraint violation.
 *
 * @param code code of this violation
 * @param message description of the violation
 * @throws CommitFailedException the constraint violation
 */
private void constraintViolation(int code, String message) throws CommitFailedException {
  List<String> nodeTypeNames = effective != null ? effective.getDirectTypeNames() : Collections.emptyList();
  
  callback.onConstraintViolation(getPath(), nodeTypeNames, code, message);
}
origin: org.apache.jackrabbit/oak-core

@Override
public int getRequiredType() {
  String string = getString(JcrConstants.JCR_REQUIREDTYPE);
  if (string != null) {
    return valueFromName(string);
  } else {
    return UNDEFINED;
  }
}
origin: apache/jackrabbit-oak

private String getPath() {
  if (parent == null) {
    return "/";
  } else if (parent.parent == null) {
    return '/' + nodeName;
  } else {
    return parent.getPath() + '/' + nodeName;
  }
}
origin: org.apache.jackrabbit/oak-core

/**
 * Constructor
 * @param oldDef old definition
 * @param newDef new definition
 */
private NodeTypeDefDiff(NodeTypeDefinition oldDef, NodeTypeDefinition newDef) {
  this.oldDef = oldDef;
  this.newDef = newDef;
  init();
}
origin: apache/jackrabbit-oak

@Override
public void propertyChanged(PropertyState before, PropertyState after)
    throws CommitFailedException {
  if (checkThisNode) {
    checkPropertyTypeConstraints(after);
  }
}
origin: apache/jackrabbit-oak

ChildItemDefDiff(ItemDefinition oldDef, ItemDefinition newDef) {
  this.oldDef = oldDef;
  this.newDef = newDef;
  init();
}
origin: apache/jackrabbit-oak

@Override
public void propertyAdded(PropertyState after)
    throws CommitFailedException {
  propertyChanged(null, after);
}
origin: apache/jackrabbit-oak

  @Override
  public Iterable<NodeDefinition> apply(NodeTypeImpl input) {
    return input.getDeclaredNamedNodeDefinitions(oakName);
  }
}));
origin: org.apache.jackrabbit/oak-core

private static boolean meetsValueConstraints(Value[] values, String[] constraints) {
  if (constraints == null || constraints.length == 0) {
    return true;
  }
  // Constraints must be met by all values
  for (Value value : values) {
    if (!meetsValueConstraints(value, constraints)) {
      return false;
    }
  }
  return true;
}
origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

@Override
public Editor childNodeAdded(String name, NodeState after)
    throws CommitFailedException {
  // TODO: add any auto-created items that are still missing
  return childNodeChanged(name, MISSING_NODE, after);
}
origin: apache/jackrabbit-oak

/**
 * Throws or logs the specified constraint violation.
 *
 * @param code code of this violation
 * @param message description of the violation
 * @throws CommitFailedException the constraint violation
 */
private void constraintViolation(int code, String message) throws CommitFailedException {
  List<String> nodeTypeNames = effective != null ? effective.getDirectTypeNames() : Collections.emptyList();
  
  callback.onConstraintViolation(getPath(), nodeTypeNames, code, message);
}
origin: org.apache.jackrabbit/oak-core

@Override
public Editor childNodeDeleted(String name, NodeState before) throws CommitFailedException {
  if (checkThisNode && effective.isMandatoryChildNode(name)) {
    constraintViolation(26, "Mandatory child node " + name + " can not be removed");
  }
  return null; // no further checking needed for the removed subtree
}
origin: org.apache.jackrabbit/oak-core

@Override
public String[] getValueConstraints() {
  // TODO: namespace mapping?
  String[] valConstraints = getStrings(JcrConstants.JCR_VALUECONSTRAINTS);
  if (valConstraints != null) {
    return valConstraints;
  } else {
    return new String[0];
  }
}
origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

private String getPath() {
  if (parent == null) {
    return "/";
  } else if (parent.parent == null) {
    return '/' + nodeName;
  } else {
    return parent.getPath() + '/' + nodeName;
  }
}
origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

/**
 * Constructor
 * @param oldDef old definition
 * @param newDef new definition
 */
private NodeTypeDefDiff(NodeTypeDefinition oldDef, NodeTypeDefinition newDef) {
  this.oldDef = oldDef;
  this.newDef = newDef;
  init();
}
origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

/**
 * Throws or logs the specified constraint violation.
 *
 * @param code code of this violation
 * @param message description of the violation
 * @throws CommitFailedException the constraint violation
 */
private void constraintViolation(int code, String message) throws CommitFailedException {
  List<String> nodeTypeNames = effective != null ? effective.getDirectTypeNames() : Collections.emptyList();
  
  callback.onConstraintViolation(getPath(), nodeTypeNames, code, message);
}
origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

@Override
public Editor childNodeDeleted(String name, NodeState before) throws CommitFailedException {
  if (checkThisNode && effective.isMandatoryChildNode(name)) {
    constraintViolation(26, "Mandatory child node " + name + " can not be removed");
  }
  return null; // no further checking needed for the removed subtree
}
org.apache.jackrabbit.oak.plugins.nodetype

Most used classes

  • ReadOnlyNodeTypeManager
    Base implementation of a NodeTypeManager with support for reading node types from the Tree returned
  • TypeEditorProvider
  • NodeTypeRegistry
    BuiltInNodeTypes is a utility class that registers the built-in node types required for a JCR repos
  • TypePredicate
    Inheritance-aware node type predicate for NodeState.
  • TypeEditor
    Validator implementation that check JCR node type constraints. TODO: check protected properties and
  • EffectiveType,
  • NodeTypeDefDiff,
  • NodeTypeTemplateImpl,
  • AbstractTypeDefinition,
  • EffectiveNodeTypeImpl,
  • ItemDefinitionImpl,
  • NodeDefinitionImpl,
  • NodeTypeDefDiff$ChildItemDefDiff,
  • NodeTypeDefDiff$ChildNodeDefDiff,
  • NodeTypeDefDiff$ChildNodeDefDiffs,
  • NodeTypeDefDiff$NodeDefinitionId,
  • NodeTypeDefDiff$PropDefDiff,
  • NodeTypeDefDiff$PropertyDefinitionId,
  • NodeTypeImpl
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