public ItemDefinitionValue(ItemDefinition itemDefinition) { this.autoCreate = itemDefinition.isAutoCreated(); this.mandatory = itemDefinition.isMandatory(); this.name = itemDefinition.getName(); this.onVersion = itemDefinition.getOnParentVersion(); this.readOnly = itemDefinition.isProtected(); }
private boolean internalCanRemoveItem(String itemName, Iterable<? extends ItemDefinition> definitions) { // FIXME: should properly calculate matching definition taking residual definitions into account. for (ItemDefinition definition : definitions) { String name = definition.getName(); if (matches(itemName, name)) { if (definition.isMandatory() || definition.isProtected()) { return false; } } } return definitions.iterator().hasNext(); }
protected void init() { if (!newDef.isMandatory()) { } else { if (oldDef.isMandatory() != newDef.isMandatory() && newDef.isMandatory()) { if (!"*".equals(oldDef.getName()) && "*".equals(newDef.getName())) { if (!oldDef.getName().equals(newDef.getName())) {
private List<String> getDeletablePropertyNames(final Node node) throws RepositoryException { final List<String> names = new ArrayList<>(); for (Property property : new PropertyIterable(node.getProperties())) { final ItemDefinition definition = property.getDefinition(); final String name = property.getName(); if (!definition.isProtected() && !definition.isMandatory() && !isKnownDerivedPropertyName(name)) { names.add(name); } } return names; }
/** {@inheritDoc} */ public boolean isProtected() throws RemoteException { return def.isProtected(); }
Node autoCreated = autoCreatedIter.nextNode(); ItemDefinition definition = autoCreated.getDefinition(); if (definition.isAutoCreated() && !definition.isProtected()) { autoCreated.remove(); Property autoCreated = autoCreatedIter.nextProperty(); ItemDefinition definition = autoCreated.getDefinition(); if (definition.isAutoCreated() && !definition.isProtected()) { autoCreated.remove(); UpdaterEngine.log.debug("commit remove old child "+item.origin.getPath()); if(!definition.isProtected()) { item.origin.remove();
/** {@inheritDoc} */ public String getName() throws RemoteException { return def.getName(); }
/** {@inheritDoc} */ public boolean isMandatory() throws RemoteException { return def.isMandatory(); }
protected void addDefinition(String prefix, ItemDefinition definition) throws StoreException { BuiltinFieldDescriptor field = new BuiltinFieldDescriptor(prefix, definition, locator, this); if (definition.getDeclaringNodeType().equals(nt)) { declaredFields.put(field.getName(), field); } if ("nt:base".equals(definition.getDeclaringNodeType().getName())) { return; } fields.put(field.getName(), field); String primaryItemName = definition.getDeclaringNodeType().getPrimaryItemName(); if (primaryItemName != null && primaryItemName.equals(definition.getName())) { field.setPrimary(true); } }
/** {@inheritDoc} */ public boolean isAutoCreated() throws RemoteException { return def.isAutoCreated(); }
/** {@inheritDoc} */ public int getOnParentVersion() throws RemoteException { return def.getOnParentVersion(); }
/** {@inheritDoc} */ public RemoteNodeType getDeclaringNodeType() throws RemoteException { NodeType nt = def.getDeclaringNodeType(); if (nt == null) { return null; } else { return getFactory().getRemoteNodeType(nt); } }
private boolean internalCanRemoveItem(String itemName, Iterable<? extends ItemDefinition> definitions) { // FIXME: should properly calculate matching definition taking residual definitions into account. for (ItemDefinition definition : definitions) { String name = definition.getName(); if (matches(itemName, name)) { if (definition.isMandatory() || definition.isProtected()) { return false; } } } return definitions.iterator().hasNext(); }
if (def.isMandatory() || def.isProtected())
protected void init() { if (!newDef.isMandatory()) { } else { if (oldDef.isMandatory() != newDef.isMandatory() && newDef.isMandatory()) { if (!"*".equals(oldDef.getName()) && "*".equals(newDef.getName())) { if (!oldDef.getName().equals(newDef.getName())) {
private boolean isProtected(ItemImpl item) throws RepositoryException { ItemDefinition def; if (item.isNode()) { def = ((Node) item).getDefinition(); } else { def = ((Property) item).getDefinition(); } return def.isProtected(); }
@Override public String toString() { String typeString = modificationTypeToString(getType()); String operationString; if (isAdded()) { operationString = "ADDED"; } else if (isModified()) { operationString = "MODIFIED"; } else if (isRemoved()) { operationString = "REMOVED"; } else { operationString = "NONE"; } ItemDefinition itemDefinition = (oldDef != null) ? oldDef : newDef; return getClass().getName() + "[itemName=" + itemDefinition.getName() + ", type=" + typeString + ", operation=" + operationString + "]"; }
ItemDefinitionImpl(ItemDefinition definition) { if (definition == null) { throw new IllegalArgumentException("PropDef argument can not be null"); } name = definition.getName(); declaringNodeType = definition.getDeclaringNodeType(); isAutoCreated = definition.isAutoCreated(); isMandatory = definition.isMandatory(); isProtected = definition.isProtected(); onParentVersion = definition.getOnParentVersion(); }
private boolean internalCanRemoveItem(String itemName, Iterable<? extends ItemDefinition> definitions) { // FIXME: should properly calculate matching definition taking residual definitions into account. for (ItemDefinition definition : definitions) { String name = definition.getName(); if (matches(itemName, name)) { if (definition.isMandatory() || definition.isProtected()) { return false; } } } return definitions.iterator().hasNext(); }
if (!def.isProtected()) { if (!childData.getDefinition().isMandatory()) { throw new ConstraintViolationException(msg); for (ChildNodeEntry cne : nodeState.getChildNodeEntries(cnd.getName())) { ItemData childData = itemMgr.getItemData(cne.getId(), null, false); if (childData.getDefinition().isMandatory()) { hasMandatoryChild = true; break; if (!def.isProtected()) { String[] constraints = propDef.getValueConstraints(); if (constraints != null) {