/** * This method determines the validity of the selected node in context of this dialog. Null values are always * considered invalid. Validity is based on whether the nodetype is allowed and if the node is linkable. * * @param targetModel The model providing the node to be validated. * @return If the provided node is a valid dialog selection. */ protected boolean isValidSelection(final IModel<Node> targetModel) { if (targetModel == null) { return false; } final Node targetNode = targetModel.getObject(); if (targetNode != null) { try { return isValidNodeType(targetNode) && isLinkable(targetNode); } catch (final RepositoryException e) { log.error(e.getMessage()); } } return false; }