Handles user requests to delete UI elements. For ILF owned nodes it delegates to the
DeleteManager to add a delete directive. For PLF owned nodes it deletes the node outright.
483073
public static void deleteNode(Element compViewNode, IPerson person) throws PortalException {
        String ID = compViewNode.getAttribute(Constants.ATT_ID);

        if (ID.startsWith(Constants.FRAGMENT_ID_USER_PREFIX)) // ilf node
        DeleteManager.addDeleteDirective(compViewNode, ID, person);
        else {
            // plf node
            Document plf = (Document) person.getAttribute(Constants.PLF);
            Element node = plf.getElementById(ID);

            if (node == null) return;
            Element parent = (Element) node.getParentNode();
            if (parent == null) return;
            parent.removeChild(node);
        }
    }
1026218
def do_delete(endpoint, access_token):
    '''
    '''
    headers = {"Authorization": 'Bearer ' + access_token}
    headers['User-Agent'] = get_user_agent()
    return requests.delete(endpoint, headers=headers)
988510
@Deprecated
    public static void finalizeForDeletion(UIComponent component)
    {
        // remove any existing marks of deletion
        component.getAttributes().remove(MARK_DELETED);

        // finally remove any children marked as deleted
        if (component.getChildCount() > 0)
        {
            for (Iterator<UIComponent> iter = component.getChildren().iterator(); iter.hasNext();)
            {
                UIComponent child = iter.next();
                if (child.getAttributes().containsKey(MARK_DELETED))
                {
                    iter.remove();
                }
            }
        }

        // remove any facets marked as deleted
        if (component.getFacetCount() > 0)
        {
            Map<String, UIComponent> facets = component.getFacets();
            Collection<UIComponent> col = facets.values();
            for (Iterator<UIComponent> itr = col.iterator(); itr.hasNext();)
            {
                UIComponent fc = itr.next();
                if (fc.getAttributes().containsKey(MARK_DELETED))
                {
                    itr.remove();
                }
            }
        }
    }
759311
function _handleRelatedDocumentDeleted(url) {
        var liveDoc = _relatedDocuments[url];
        if (liveDoc) {
            delete _relatedDocuments[url];
        }

        if (_server) {
            _server.remove(liveDoc);
        }
        _closeDocument(liveDoc);
    }
168888
function onRemove(el, fn) {
  var observer = new MutationObserver(this.createRemoveNodeHandler(el, fn));

  observer.observe(el.parentNode, {childList: true});
}
1268618
function _handleSingleMutation(mutation) {
  var addedNodes = _toArray(mutation.addedNodes);
  var addedRefs = addedNodes.filter(_isRefNode);

  // assign added nodes
  addedRefs.map(_assignRef.bind(this));

  var removedNodes = _toArray(mutation.removedNodes);
  var removedRefs = removedNodes.filter(_isRefNode);

  // assign removed nodes
  removedRefs.map(_deleteRef.bind(this));
}
1060623
private static boolean applyEdit(Element edit, Document ilf) {
        String nodeID = edit.getAttribute(Constants.ATT_TARGET);

        Element channel = ilf.getElementById(nodeID);

        if (channel == null) return false;

        // now get the name of the parameter to be edited and find that element
        String parmName = edit.getAttribute(Constants.ATT_NAME);
        String parmValue = edit.getAttribute(Constants.ATT_USER_VALUE);
        NodeList ilfParms = channel.getChildNodes();
        Element targetParm = null;

        for (int i = 0; i < ilfParms.getLength(); i++) {
            Element ilfParm = (Element) ilfParms.item(i);
            if (ilfParm.getAttribute(Constants.ATT_NAME).equals(parmName)) {
                targetParm = ilfParm;
                break;
            }
        }
        if (targetParm == null) // parameter not found so we are free to set
        {
            Element parameter = ilf.createElement("parameter");
            parameter.setAttribute("name", parmName);
            parameter.setAttribute("value", parmValue);
            parameter.setAttribute("override", "yes");
            channel.appendChild(parameter);
            return true;
        }
        /* TODO Add support for fragments to set dlm:editAllowed attribute for
         * channel parameters. (2005.11.04 mboyd)
         *
         * In the commented code below, the check for editAllowed will never be
         * seen on a parameter element in the
         * current database schema approach used by DLM. This is because
         * parameters are second class citizens of the layout structure. They
         * are not found in the up_layout_struct table but only in the
         * up_layout_param table. DLM functionality like dlm:editAllowed,
         * dlm:moveAllowed, dlm:deleteAllowed, and dlm:addChildAllowed were
         * implemented without schema changes by adding these as parameters to
         * structural elements and upon loading any parameter that begins with
         * 'dlm:' is placed as an attribute on the containing structural
         * element. So any channel parameter entry with dlm:editAllowed has that
         * value placed as an attribute on the containing channel not on the
         * parameter that was meant to have it.
         *
         * The only solution would be to add special dlm:parm children below
         * channels that would get the editAllowed value and then when creating
         * the DOM don't create those as child elements but use them to set the
         * attribute on the corresponding parameter by having the name of the
         * dlm:parm element be the name of the parameter to which it is to be
         * related.
         *
         * The result of this lack of functionality is that fragments can't
         * mark any channel parameters as dlm:editAllowed='false' thereby
         * further restricting which channel parameters can be edited beyond
         * what the channel definition specifies during publishing.
         */
        // Attr editAllowed = targetParm.getAttributeNode( Constants.ATT_EDIT_ALLOWED );
        // if ( editAllowed != null && editAllowed.getNodeValue().equals("false"))
        //    return false;

        // target parm found. See if channel definition will still allow changes.

        Attr override = targetParm.getAttributeNode(Constants.ATT_OVERRIDE);
        if (override != null && !override.getNodeValue().equals(Constants.CAN_OVERRIDE))
            return false;

        // now see if the change is still needed
        if (targetParm.getAttribute(Constants.ATT_VALUE).equals(parmValue))
            return false; // user's edit same as fragment or chan def

        targetParm.setAttribute("value", parmValue);
        return true;
    }
1201534
protected boolean canDeleteNode(IUserLayoutNodeDescription node) throws PortalException {
        if (node == null) return false;

        // todo if isFragmentOwner should probably verify node is part of the
        // same layout fragment as the fragment owner to insure a misbehaving front-end doesn't
        // do an improper operation.

        return isFragmentOwner || node.isDeleteAllowed();
    }
987696
def delete(self):
        
        if not self._created:
            return
        try:
            node1 = self._nodes[0]["node"]
            adapter_number1 = self._nodes[0]["adapter_number"]
            port_number1 = self._nodes[0]["port_number"]
        except IndexError:
            return
        try:
            yield from node1.delete("/adapters/{adapter_number}/ports/{port_number}/nio".format(adapter_number=adapter_number1, port_number=port_number1), timeout=120)
        # If the node is already delete (user selected multiple element and delete all in the same time)
        except aiohttp.web.HTTPNotFound:
            pass

        try:
            node2 = self._nodes[1]["node"]
            adapter_number2 = self._nodes[1]["adapter_number"]
            port_number2 = self._nodes[1]["port_number"]
        except IndexError:
            return
        try:
            yield from node2.delete("/adapters/{adapter_number}/ports/{port_number}/nio".format(adapter_number=adapter_number2, port_number=port_number2), timeout=120)
        # If the node is already delete (user selected multiple element and delete all in the same time)
        except aiohttp.web.HTTPNotFound:
            pass
        yield from super().delete()
701795
public static void removeEditDirective(String elementId, String attributeName, IPerson person) {
        removeDirective(elementId, attributeName, Constants.ELM_EDIT, person);
    }
609887
function _cleanUpEvents(elem, type) {
  var data = Dom.getElData(elem);

  // Remove the events of a particular type if there are none left
  if (data.handlers[type].length === 0) {
    delete data.handlers[type];
    // data.handlers[type] = null;
    // Setting to null was causing an error with data.handlers

    // Remove the meta-handler from the element
    if (elem.removeEventListener) {
      elem.removeEventListener(type, data.dispatcher, false);
    } else if (elem.detachEvent) {
      elem.detachEvent('on' + type, data.dispatcher);
    }
  }

  // Remove the events object if there are no types left
  if (Object.getOwnPropertyNames(data.handlers).length <= 0) {
    delete data.handlers;
    delete data.dispatcher;
    delete data.disabled;
  }

  // Finally remove the element data if there is no data left
  if (Object.getOwnPropertyNames(data).length === 0) {
    Dom.removeElData(elem);
  }
}
1300336
@Override
    public void perform() throws PortalException {
        // push the change into the PLF
        if (nodeId.startsWith(Constants.FRAGMENT_ID_USER_PREFIX)) {
            // we are dealing with an incorporated node, adding will replace
            // an existing one for the same target node id and name
            ParameterEditManager.addParmEditDirective(nodeId, name, value, person);
        } else {
            // node owned by user so change existing parameter child directly
            Document plf = RDBMDistributedLayoutStore.getPLF(person);
            Element plfNode = plf.getElementById(nodeId);
            changeParameterChild(plfNode, name, value);
        }
        // push the change into the ILF
        changeParameterChild(ilfNode, name, value);
    }
1076709
def delete(collection)
    each_resource_with_edit_url(collection) do |resource, edit_url|
      connection.delete(edit_url, 'If-Match' => "*")
    end
    # return count
    collection.size
  end
323429
function(ev, model, collection, options) {
      if ((ev == 'add' || ev == 'remove') && collection != this) return;
      if (ev == 'destroy') {
        this._remove(model, options);
      }
      if (model && ev === 'change:' + model.idAttribute) {
        delete this._byId[model.previous(model.idAttribute)];
        this._byId[model.id] = model;
      }
      this.trigger.apply(this, arguments);
    }
868094
function (loadBalancer, node, callback) {
    var self = this,
        loadBalancerId =
          loadBalancer instanceof lb.LoadBalancer ? loadBalancer.id : loadBalancer,
        nodeId =
          node instanceof lb.Node ? node.id : node;

    self._request({
      path: urlJoin(_urlPrefix, loadBalancerId, 'nodes', nodeId),
      method: 'DELETE'
    }, function (err) {
      callback(err);
    });
  }
759599
function deleteAnnotation() {
  if (!overlay) { return; }

  let annotationId = overlay.getAttribute('data-target-id');
  let nodes = document.querySelectorAll(`[data-pdf-annotate-id="${annotationId}"]`);
  let svg = overlay.parentNode.querySelector('svg.annotationLayer');
  let { documentId } = getMetadata(svg);

  [...nodes].forEach((n) => {
    n.parentNode.removeChild(n);
  });
  
  PDFJSAnnotate.getStoreAdapter().deleteAnnotation(documentId, annotationId);

  destroyEditOverlay();
}
1300800
function (gesture, id) {
                if (this._idList[gesture]) {
                    var element = this._idList[gesture][id];
                    if (gesture == "drag" && element && element == this._activeDrag) {
                        // the element being dragged has been disposed,
                        // terminate the drag:
                        this._dragStartPosition = null;
                        disconnectMouseEvents(this);
                        this._candidateForDrag = null;
                        this._activeDrag = null;
                    }
                    delete this._idList[gesture][id];
                }
            }