From 47de29518810f2265e9e5f8ef994317849d1c691 Mon Sep 17 00:00:00 2001 From: eschleb Date: Fri, 16 Feb 2024 14:23:40 +0100 Subject: [PATCH] Improve extendability of NodeTypeConstraintAwareDropConstraint & NodeTypeConstraintAwareJcrContentClipboard --- .../dropconstraint/NodeTypeConstraintAwareDropConstraint.java | 2 +- .../NodeTypeConstraintAwareJcrContentClipboard.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/namics/oss/magnolia/appbuilder/ui5/dropconstraint/NodeTypeConstraintAwareDropConstraint.java b/src/main/java/com/namics/oss/magnolia/appbuilder/ui5/dropconstraint/NodeTypeConstraintAwareDropConstraint.java index 5edca0d..17a2303 100644 --- a/src/main/java/com/namics/oss/magnolia/appbuilder/ui5/dropconstraint/NodeTypeConstraintAwareDropConstraint.java +++ b/src/main/java/com/namics/oss/magnolia/appbuilder/ui5/dropconstraint/NodeTypeConstraintAwareDropConstraint.java @@ -46,7 +46,7 @@ public boolean allowedToMove(final com.vaadin.v7.data.Item sourceItem) { return true; } - private boolean allowedAsChild(final Node src, final Node dst) { + protected boolean allowedAsChild(final Node src, final Node dst) { try { if(Objects.equals(src.getSession().getWorkspace().getName(), dst.getSession().getWorkspace().getName())) { for (NodeDefinition allowedChildNodeDefinition : dst.getPrimaryNodeType().getChildNodeDefinitions()) { diff --git a/src/main/java/com/namics/oss/magnolia/appbuilder/ui5/dropconstraint/NodeTypeConstraintAwareJcrContentClipboard.java b/src/main/java/com/namics/oss/magnolia/appbuilder/ui5/dropconstraint/NodeTypeConstraintAwareJcrContentClipboard.java index 7f10761..42fa3a7 100644 --- a/src/main/java/com/namics/oss/magnolia/appbuilder/ui5/dropconstraint/NodeTypeConstraintAwareJcrContentClipboard.java +++ b/src/main/java/com/namics/oss/magnolia/appbuilder/ui5/dropconstraint/NodeTypeConstraintAwareJcrContentClipboard.java @@ -38,14 +38,14 @@ protected boolean canPasteInto(final JcrItemId source, final JcrItemId destinati return false; } - private boolean canPasteInto(final Property source, final Node destination) throws RepositoryException { + protected boolean canPasteInto(final Property source, final Node destination) throws RepositoryException { if (source.isMultiple()) { return destination.getPrimaryNodeType().canSetProperty(source.getName(), source.getValues()); } return destination.getPrimaryNodeType().canSetProperty(source.getName(), source.getValue()); } - private boolean canPasteInto(final Node source, final Node destination) throws RepositoryException { + protected boolean canPasteInto(final Node source, final Node destination) throws RepositoryException { for (NodeDefinition allowedChildNodeDefinition : destination.getPrimaryNodeType().getChildNodeDefinitions()) { for (NodeType allowedChildRequiredPrimaryType : allowedChildNodeDefinition.getRequiredPrimaryTypes()) { if (Objects.equals(source.getPrimaryNodeType(), allowedChildRequiredPrimaryType)) {